mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 16:29:50 +08:00
Update GCOVProfiling pass creation for API change in r177002. No functionality change.
llvm-svn: 177004
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user