[PATCH] D18617: Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 09:04:23 PDT 2016


jlebar updated this revision to Diff 53415.
jlebar added a comment.

Switch [this] to [&].


http://reviews.llvm.org/D18617

Files:
  lib/CodeGen/BackendUtil.cpp

Index: lib/CodeGen/BackendUtil.cpp
===================================================================
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -340,6 +340,14 @@
     return;
   }
 
+  // Add target-specific passes that need to run as early as possible.
+  if (TM)
+    PMBuilder.addExtension(
+        PassManagerBuilder::EP_EarlyAsPossible,
+        [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
+          TM->addEarlyAsPossiblePasses(PM);
+        });
+
   PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
                          addAddDiscriminatorsPass);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18617.53415.patch
Type: text/x-patch
Size: 622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160412/e5b90d27/attachment.bin>


More information about the cfe-commits mailing list