diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-12-08 19:04:51 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-12-08 19:04:51 +0000 |
commit | bb794d1419a75650dc9ddb16d02fa96eb6125f81 (patch) | |
tree | fbd28d4438f1276335eab8f49f476948b818f02b /lib/CodeGen/BackendUtil.cpp | |
parent | 66e56fc2fdc11dbb2460b1e1d8694b03386ac710 (diff) |
InstrProf: Use LLVM's -instrprof pass for profiling
The logic for lowering profiling counters has been moved to an LLVM
pass. Emit the intrinsics rather than duplicating the whole pass in
clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 41f21312bc..97485b7392 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -366,6 +366,12 @@ void EmitAssemblyHelper::CreatePasses() { MPM->add(createStripSymbolsPass(true)); } + if (CodeGenOpts.ProfileInstrGenerate) { + InstrProfOptions Options; + Options.NoRedZone = CodeGenOpts.DisableRedZone; + MPM->add(createInstrProfilingPass(Options)); + } + PMBuilder.populateModulePassManager(*MPM); } |