Initialize all common codegen passes before configuration so we can use their PassIDs.

llvm-svn: 149705
This commit is contained in:
Andrew Trick 2012-02-03 20:14:47 +00:00
parent a8a8ac5d47
commit 99d316098e
2 changed files with 8 additions and 2 deletions

View File

@ -42,8 +42,7 @@ protected:
public:
TargetPassConfig(TargetMachine *tm, PassManagerBase &pm,
bool DisableVerifyFlag)
: TM(tm), PM(pm), DisableVerify(DisableVerifyFlag) {}
bool DisableVerifyFlag);
virtual ~TargetPassConfig() {}

View File

@ -125,6 +125,13 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T, StringRef Triple,
"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,