[llvm-commits] [llvm] r149705 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp

Andrew Trick atrick at apple.com
Fri Feb 3 12:14:47 PST 2012


Author: atrick
Date: Fri Feb  3 14:14:47 2012
New Revision: 149705

URL: http://llvm.org/viewvc/llvm-project?rev=149705&view=rev
Log:
Initialize all common codegen passes before configuration so we can use their PassIDs.

Modified:
    llvm/trunk/include/llvm/CodeGen/Passes.h
    llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp

Modified: llvm/trunk/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=149705&r1=149704&r2=149705&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/Passes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Feb  3 14:14:47 2012
@@ -42,8 +42,7 @@
 
 public:
   TargetPassConfig(TargetMachine *tm, PassManagerBase &pm,
-                   bool DisableVerifyFlag)
-    : TM(tm), PM(pm), DisableVerify(DisableVerifyFlag) {}
+                   bool DisableVerifyFlag);
 
   virtual ~TargetPassConfig() {}
 

Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=149705&r1=149704&r2=149705&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Fri Feb  3 14:14:47 2012
@@ -125,6 +125,13 @@
          "and that InitializeAllTargetMCs() is being invoked!");
 }
 
+TargetPassConfig::TargetPassConfig(TargetMachine *tm, PassManagerBase &pm,
+                                   bool DisableVerifyFlag)
+  : TM(tm), PM(pm), DisableVerify(DisableVerifyFlag) {
+  // Register all target independent codegen passes to activate their PassIDs.
+  initializeCodeGen(*PassRegistry::getPassRegistry());
+}
+
 /// createPassConfig - Create a pass configuration object to be used by
 /// addPassToEmitX methods for generating a pipeline of CodeGen passes.
 TargetPassConfig *LLVMTargetMachine::createPassConfig(PassManagerBase &PM,





More information about the llvm-commits mailing list