summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-12-08 19:04:51 +0000
committerJustin Bogner <mail@justinbogner.com>2014-12-08 19:04:51 +0000
commitbb794d1419a75650dc9ddb16d02fa96eb6125f81 (patch)
treefbd28d4438f1276335eab8f49f476948b818f02b /lib/CodeGen/BackendUtil.cpp
parent66e56fc2fdc11dbb2460b1e1d8694b03386ac710 (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.cpp6
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);
}