summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-03-14 05:14:01 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-03-14 05:14:01 +0000
commitc8bf8249ce5b5b952957f7d47e08c9877ea72bbc (patch)
treeeae56c4c654680e954ff7a4d68fcb8a5bae78606 /clang/lib/CodeGen/BackendUtil.cpp
parente68672fed26597fc653aaf335a49c8f041735052 (diff)
downloadbcm5719-llvm-c8bf8249ce5b5b952957f7d47e08c9877ea72bbc.tar.gz
bcm5719-llvm-c8bf8249ce5b5b952957f7d47e08c9877ea72bbc.zip
Update GCOVProfiling pass creation for API change in r177002. No functionality change.
llvm-svn: 177004
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index ab65801ce56..9c9c5613805 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -303,13 +303,18 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
PassManager *MPM = getPerModulePasses(TM);
if (CodeGenOpts.EmitGcovArcs || CodeGenOpts.EmitGcovNotes) {
- MPM->add(createGCOVProfilerPass(CodeGenOpts.EmitGcovNotes,
- CodeGenOpts.EmitGcovArcs,
- CodeGenOpts.CoverageVersion,
- CodeGenOpts.CoverageExtraChecksum,
- CodeGenOpts.DisableRedZone,
- CodeGenOpts.CoverageFunctionNamesInData));
-
+ // Not using 'GCOVOptions::getDefault' allows us to avoid exiting if
+ // LLVM's -default-gcov-version flag is set to something invalid.
+ GCOVOptions Options;
+ Options.EmitNotes = CodeGenOpts.EmitGcovNotes;
+ Options.EmitData = CodeGenOpts.EmitGcovArcs;
+ memcpy(Options.Version, CodeGenOpts.CoverageVersion, 4);
+ Options.UseCfgChecksum = CodeGenOpts.CoverageExtraChecksum;
+ Options.NoRedZone = CodeGenOpts.DisableRedZone;
+ // FIXME: the clang flag name is backwards.
+ Options.FunctionNamesInData =
+ !CodeGenOpts.CoverageFunctionNamesInData;
+ MPM->add(createGCOVProfilerPass(Options));
if (CodeGenOpts.getDebugInfo() == CodeGenOptions::NoDebugInfo)
MPM->add(createStripSymbolsPass(true));
}
OpenPOWER on IntegriCloud