summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-03-03 20:06:18 +0000
committerDiego Novillo <dnovillo@google.com>2014-03-03 20:06:18 +0000
commite1e6798cc7a56ce249c97ab470033e446acb66ba (patch)
treea08da8f5f8880a711027f945150272fb205c86bb /lib/CodeGen/BackendUtil.cpp
parenta98780d2d15e3f6a0e40643f3317142825026d3c (diff)
Schedule discriminator pass.
This needs to modify a line table test to account for the new lexical block created to hold the new discriminator value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 809333aaa1..478993a9f0 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -166,6 +166,11 @@ static void addSampleProfileLoaderPass(const PassManagerBuilder &Builder,
PM.add(createSampleProfileLoaderPass(CGOpts.SampleProfileFile));
}
+static void addAddDiscriminatorsPass(const PassManagerBuilder &Builder,
+ PassManagerBase &PM) {
+ PM.add(createAddDiscriminatorsPass());
+}
+
static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
PassManagerBase &PM) {
PM.add(createBoundsCheckingPass());
@@ -246,6 +251,9 @@ void EmitAssemblyHelper::CreatePasses() {
PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
PMBuilder.RerollLoops = CodeGenOpts.RerollLoops;
+ PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
+ addAddDiscriminatorsPass);
+
if (!CodeGenOpts.SampleProfileFile.empty())
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
addSampleProfileLoaderPass);