Add coverage mapping generation.

This patch adds the '-fcoverage-mapping' option which
allows clang to generate the coverage mapping information
that can be used to provide code coverage analysis using
the execution counts obtained from the instrumentation 
based profiling (-fprofile-instr-generate).

llvm-svn: 214752
This commit is contained in:
Alex Lorenz
2014-08-04 18:41:51 +00:00
parent 1193b5e272
commit ee02499a8f
16 changed files with 1577 additions and 54 deletions

View File

@@ -3230,6 +3230,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.hasArg(options::OPT_coverage))
CmdArgs.push_back("-femit-coverage-data");
if (Args.hasArg(options::OPT_fcoverage_mapping) &&
!Args.hasArg(options::OPT_fprofile_instr_generate))
D.Diag(diag::err_drv_argument_only_allowed_with)
<< "-fcoverage-mapping" << "-fprofile-instr-generate";
if (Args.hasArg(options::OPT_fcoverage_mapping))
CmdArgs.push_back("-fcoverage-mapping");
if (C.getArgs().hasArg(options::OPT_c) ||
C.getArgs().hasArg(options::OPT_S)) {
if (Output.isFilename()) {