Update GCOVProfiling pass creation for API change in r177002. No functionality change.

llvm-svn: 177004
This commit is contained in:
Nick Lewycky
2013-03-14 05:14:01 +00:00
parent e68672fed2
commit c8bf8249ce
2 changed files with 13 additions and 11 deletions

View File

@@ -303,13 +303,18 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
PassManager *MPM = getPerModulePasses(TM); PassManager *MPM = getPerModulePasses(TM);
if (CodeGenOpts.EmitGcovArcs || CodeGenOpts.EmitGcovNotes) { if (CodeGenOpts.EmitGcovArcs || CodeGenOpts.EmitGcovNotes) {
MPM->add(createGCOVProfilerPass(CodeGenOpts.EmitGcovNotes, // Not using 'GCOVOptions::getDefault' allows us to avoid exiting if
CodeGenOpts.EmitGcovArcs, // LLVM's -default-gcov-version flag is set to something invalid.
CodeGenOpts.CoverageVersion, GCOVOptions Options;
CodeGenOpts.CoverageExtraChecksum, Options.EmitNotes = CodeGenOpts.EmitGcovNotes;
CodeGenOpts.DisableRedZone, Options.EmitData = CodeGenOpts.EmitGcovArcs;
CodeGenOpts.CoverageFunctionNamesInData)); 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) if (CodeGenOpts.getDebugInfo() == CodeGenOptions::NoDebugInfo)
MPM->add(createStripSymbolsPass(true)); MPM->add(createStripSymbolsPass(true));
} }

View File

@@ -394,10 +394,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
<< Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args) << Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args)
<< CoverageVersion; << CoverageVersion;
} else { } else {
Opts.CoverageVersion[0] = CoverageVersion[3]; memcpy(Opts.CoverageVersion, CoverageVersion.data(), 4);
Opts.CoverageVersion[1] = CoverageVersion[2];
Opts.CoverageVersion[2] = CoverageVersion[1];
Opts.CoverageVersion[3] = CoverageVersion[0];
} }
} }
} }