diff options
author | Chris Lattner <sabre@nondot.org> | 2006-08-27 22:30:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-08-27 22:30:17 +0000 |
commit | 5d8925c7c506a54ebdfb0bc93437ec9f602eaaa0 (patch) | |
tree | dea599a5388d6da5b94fec761128353f08be2dc3 /include/llvm/PassSupport.h | |
parent | 2dd3d423aae84649c434b2a58ba4ed7e918580d8 (diff) | |
download | llvm-5d8925c7c506a54ebdfb0bc93437ec9f602eaaa0.tar.gz llvm-5d8925c7c506a54ebdfb0bc93437ec9f602eaaa0.tar.bz2 llvm-5d8925c7c506a54ebdfb0bc93437ec9f602eaaa0.tar.xz |
Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassSupport.h')
-rw-r--r-- | include/llvm/PassSupport.h | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h index 8d978b35d1..95702c0cfa 100644 --- a/include/llvm/PassSupport.h +++ b/include/llvm/PassSupport.h @@ -179,24 +179,33 @@ template<typename PassName> struct RegisterPass : public RegisterPassBase { // Register Pass using default constructor... - RegisterPass(const char *PassArg, const char *Name) + RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor<PassName>) {} + callDefaultCtor<PassName>) { + if (CFGOnly) setOnlyUsesCFG(); + } // Register Pass using default constructor explicitly... RegisterPass(const char *PassArg, const char *Name, - Pass *(*ctor)()) - : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) {} + Pass *(*ctor)(), bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) { + if (CFGOnly) setOnlyUsesCFG(); + } // Register Pass using TargetMachine constructor... RegisterPass(const char *PassArg, const char *Name, - Pass *(*targetctor)(TargetMachine &)) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) {} + Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) { + if (CFGOnly) setOnlyUsesCFG(); + } // Generic constructor version that has an unknown ctor type... template<typename CtorType> - RegisterPass(const char *PassArg, const char *Name, CtorType *Fn) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0) {} + RegisterPass(const char *PassArg, const char *Name, CtorType *Fn, + bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), 0) { + if (CFGOnly) setOnlyUsesCFG(); + } }; /// RegisterOpt - Register something that is to show up in Opt, this is just a @@ -246,22 +255,6 @@ struct RegisterOpt : public RegisterPassBase { } }; -/// RegisterAnalysis - Register something that is to show up in Analysis, this -/// is just a shortcut for specifying RegisterPass... Analyses take a special -/// argument that, when set to true, tells the system that the analysis ONLY -/// depends on the shape of the CFG, so if a transformation preserves the CFG -/// that the analysis is not invalidated. -/// -template<typename PassName> -struct RegisterAnalysis : public RegisterPassBase { - RegisterAnalysis(const char *PassArg, const char *Name, - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor<PassName>) { - if (CFGOnly) setOnlyUsesCFG(); - } -}; - /// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_. /// Analysis groups are used to define an interface (which need not derive from |