diff options
author | Jiangning Liu <jiangning.liu@arm.com> | 2014-06-13 22:57:59 +0000 |
---|---|---|
committer | Jiangning Liu <jiangning.liu@arm.com> | 2014-06-13 22:57:59 +0000 |
commit | 96e92c1d7529c094ee2f3a79e7a67faa0c5ea621 (patch) | |
tree | a18e4d09d736285bad3593d6b21c969f367ca449 /llvm/include | |
parent | 3e61c523522d25f033d9663018ff7714d615e942 (diff) | |
download | bcm5719-llvm-96e92c1d7529c094ee2f3a79e7a67faa0c5ea621.tar.gz bcm5719-llvm-96e92c1d7529c094ee2f3a79e7a67faa0c5ea621.zip |
Move GlobalMerge from Transform to CodeGen.
This patch is to move GlobalMerge pass from Transform/Scalar
to CodeGen, because GlobalMerge depends on TargetMachine.
In the mean time, the macro INITIALIZE_TM_PASS is also moved
to CodeGen/Passes.h. With this fix we can avoid making
libScalarOpts depend on libCodeGen.
llvm-svn: 210951
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/Passes.h | 17 | ||||
-rw-r--r-- | llvm/include/llvm/PassSupport.h | 12 |
2 files changed, 17 insertions, 12 deletions
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h index bf31de78b40..17477fe6b05 100644 --- a/llvm/include/llvm/CodeGen/Passes.h +++ b/llvm/include/llvm/CodeGen/Passes.h @@ -592,4 +592,21 @@ namespace llvm { ModulePass *createJumpInstrTablesPass(); } // End llvm namespace +/// This initializer registers TargetMachine constructor, so the pass being +/// initialized can use target dependent interfaces. Please do not move this +/// macro to be together with INITIALIZE_PASS, which is a complete target +/// independent initializer, and we don't want to make libScalarOpts depend +/// on libCodeGen. +#define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \ + static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ + PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ + PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis, \ + PassInfo::TargetMachineCtor_t(callTargetMachineCtor< passName >)); \ + Registry.registerPass(*PI, true); \ + return PI; \ + } \ + void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ + CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ + } + #endif diff --git a/llvm/include/llvm/PassSupport.h b/llvm/include/llvm/PassSupport.h index a4ef09d679a..449bc928108 100644 --- a/llvm/include/llvm/PassSupport.h +++ b/llvm/include/llvm/PassSupport.h @@ -53,18 +53,6 @@ class TargetMachine; } \ TsanHappensAfter(&initialized); -#define INITIALIZE_TM_PASS(passName, arg, name, cfg, analysis) \ - static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ - PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ - PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis, \ - PassInfo::TargetMachineCtor_t(callTargetMachineCtor< passName >)); \ - Registry.registerPass(*PI, true); \ - return PI; \ - } \ - void llvm::initialize##passName##Pass(PassRegistry &Registry) { \ - CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \ - } - #define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \ static void* initialize##passName##PassOnce(PassRegistry &Registry) { \ PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \ |