diff options
author | Jiangning Liu <jiangning.liu@arm.com> | 2014-06-11 07:04:37 +0000 |
---|---|---|
committer | Jiangning Liu <jiangning.liu@arm.com> | 2014-06-11 07:04:37 +0000 |
commit | e65c40320b1e9cda26e7ea3c7f16c6f97a0f2be6 (patch) | |
tree | 3194435f76f61125ba4d872b7adddde761b7e312 /lib/CodeGen/CodeGenPrepare.cpp | |
parent | f847ccb87afc8814519bda98000260d80f7b6e74 (diff) | |
download | llvm-e65c40320b1e9cda26e7ea3c7f16c6f97a0f2be6.tar.gz llvm-e65c40320b1e9cda26e7ea3c7f16c6f97a0f2be6.tar.bz2 llvm-e65c40320b1e9cda26e7ea3c7f16c6f97a0f2be6.tar.xz |
Create macro INITIALIZE_TM_PASS.
Pass initialization requires to initialize TargetMachine for back-end
specific passes. This commit creates a new macro INITIALIZE_TM_PASS to
simplify this kind of initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenPrepare.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp index 3133993981..ccac40c669 100644 --- a/lib/CodeGen/CodeGenPrepare.cpp +++ b/lib/CodeGen/CodeGenPrepare.cpp @@ -151,19 +151,8 @@ typedef DenseMap<Instruction *, Type *> InstrToOrigTy; } char CodeGenPrepare::ID = 0; -static void *initializeCodeGenPreparePassOnce(PassRegistry &Registry) { - initializeTargetLibraryInfoPass(Registry); - PassInfo *PI = new PassInfo( - "Optimize for code generation", "codegenprepare", &CodeGenPrepare::ID, - PassInfo::NormalCtor_t(callDefaultCtor<CodeGenPrepare>), false, false, - PassInfo::TargetMachineCtor_t(callTargetMachineCtor<CodeGenPrepare>)); - Registry.registerPass(*PI, true); - return PI; -} - -void llvm::initializeCodeGenPreparePass(PassRegistry &Registry) { - CALL_ONCE_INITIALIZATION(initializeCodeGenPreparePassOnce) -} +INITIALIZE_TM_PASS(CodeGenPrepare, "codegenprepare", + "Optimize for code generation", false, false) FunctionPass *llvm::createCodeGenPreparePass(const TargetMachine *TM) { return new CodeGenPrepare(TM); |