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);
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));
}

View File

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