summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-04-21 23:44:07 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-04-21 23:44:07 +0000
commit207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2 (patch)
tree67fd0c79fd80cc3291be876dcdb13d8bb6eca39d /clang/lib/Frontend/CompilerInvocation.cpp
parent6aea59268a51d2fb2cc7bdc47f9e65e343aeb2a1 (diff)
downloadbcm5719-llvm-207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2.tar.gz
bcm5719-llvm-207bce31e15e63ebc5fcde0f7d2f8db0a99a89a2.zip
Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both. This does not yet add the profile_rt library to the link step if -fprofile-arcs is enabled when linking. llvm-svn: 129956
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index bf863d7feae..5449df2b03e 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -123,6 +123,10 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
Res.push_back("-dwarf-debug-flags");
Res.push_back(Opts.DwarfDebugFlags);
}
+ if (Opts.EmitGcovArcs)
+ Res.push_back("-femit-coverage-data");
+ if (Opts.EmitGcovNotes)
+ Res.push_back("-femit-coverage-notes");
if (!Opts.MergeAllConstants)
Res.push_back("-fno-merge-all-constants");
if (Opts.NoCommon)
@@ -960,6 +964,8 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions);
Opts.InstrumentForProfiling = Args.hasArg(OPT_pg);
+ Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
+ Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
llvm::StringRef Name = A->getValue(Args);
OpenPOWER on IntegriCloud