diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-03-14 05:14:01 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-03-14 05:14:01 +0000 |
commit | c3ae583a9a2e0e5c862a94b678c7cdfaab46a981 (patch) | |
tree | 56ed0eeddc2156a92fe66916d36dac3fa91f8c22 /lib | |
parent | e34db6b3e772e9832e1f6de1f23457076ffbec88 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 19 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 5 |
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index ab65801ce5..9c9c561380 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/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)); } diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 3c5954a696..fa592120a4 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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); } } } |