summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiangning Liu <jiangning.liu@arm.com>2014-06-13 22:57:59 +0000
committerJiangning Liu <jiangning.liu@arm.com>2014-06-13 22:57:59 +0000
commitc5bc067a0fb05fe36761bb280d630dce5611f400 (patch)
tree85ee401bdc015e66816aad6babcd46198420941e /include
parent7354a3fe576b34919b0752306fd1b382f879a115 (diff)
downloadllvm-c5bc067a0fb05fe36761bb280d630dce5611f400.tar.gz
llvm-c5bc067a0fb05fe36761bb280d630dce5611f400.tar.bz2
llvm-c5bc067a0fb05fe36761bb280d630dce5611f400.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/Passes.h17
-rw-r--r--include/llvm/PassSupport.h12
2 files changed, 17 insertions, 12 deletions
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index bf31de78b4..17477fe6b0 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/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/include/llvm/PassSupport.h b/include/llvm/PassSupport.h
index a4ef09d679..449bc92810 100644
--- a/include/llvm/PassSupport.h
+++ b/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, \