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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2013-03-14 05:14:01 +00:00
Родитель e34db6b3e7
Коммит c3ae583a9a
2 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

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