[llvm-commits] [llvm] r115824 - /llvm/trunk/include/llvm/PassSupport.h
Owen Anderson
resistor at mac.com
Wed Oct 6 13:07:03 PDT 2010
Author: resistor
Date: Wed Oct 6 15:07:03 2010
New Revision: 115824
URL: http://llvm.org/viewvc/llvm-project?rev=115824&view=rev
Log:
Pass initialization functions should take a PassRegistry as a parameter
rather than being fixed to the global registry.
Modified:
llvm/trunk/include/llvm/PassSupport.h
Modified: llvm/trunk/include/llvm/PassSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=115824&r1=115823&r2=115824&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassSupport.h (original)
+++ llvm/trunk/include/llvm/PassSupport.h Wed Oct 6 15:07:03 2010
@@ -128,10 +128,10 @@
};
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
- void initialize##passName##Pass() { \
+ void initialize##passName##Pass(PassRegistry &Registry) { \
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
- PassRegistry::getPassRegistry()->registerPass(*PI); \
+ Registry.registerPass(*PI); \
} \
static RegisterPass<passName> passName ## _info(arg, name, cfg, analysis)
@@ -211,14 +211,13 @@
};
#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \
- void initialize##passName##Pass() { \
+ void initialize##passName##Pass(PassRegistry &Registry) { \
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
- PassRegistry::getPassRegistry()->registerPass(*PI); \
+ Registry.registerPass(*PI); \
\
PassInfo *AI = new PassInfo(name, & agName :: ID); \
- PassRegistry::getPassRegistry()->registerAnalysisGroup( \
- & agName ::ID, & passName ::ID, *AI, def); \
+ Registry.registerAnalysisGroup(& agName ::ID, & passName ::ID, *AI, def); \
} \
static RegisterPass<passName> passName ## _info(arg, name, cfg, analysis); \
static RegisterAnalysisGroup<agName, def> passName ## _ag(passName ## _info)
More information about the llvm-commits
mailing list