From 5f0d700278b98f00a7f1cd792e10acbb76447be1 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 6 Oct 2010 20:07:03 +0000 Subject: [PATCH] Pass initialization functions should take a PassRegistry as a parameter rather than being fixed to the global registry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115824 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/PassSupport.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h index 933a1455a52..ac61eb6a073 100644 --- a/include/llvm/PassSupport.h +++ b/include/llvm/PassSupport.h @@ -128,10 +128,10 @@ private: }; #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 ## _info(arg, name, cfg, analysis) @@ -211,14 +211,13 @@ struct RegisterAnalysisGroup : public RegisterAGBase { }; #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 ## _info(arg, name, cfg, analysis); \ static RegisterAnalysisGroup passName ## _ag(passName ## _info)