Rename method to indicate what it does

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9054 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-10-12 18:51:53 +00:00
parent 5ef6ffd6c3
commit 7f9bb6e92c

View File

@ -152,10 +152,10 @@ protected:
void registerPass(PassInfo *); void registerPass(PassInfo *);
void unregisterPass(PassInfo *); void unregisterPass(PassInfo *);
/// setPreservesCFG - Notice that this pass only depends on the CFG, so /// setOnlyUsesCFG - Notice that this pass only depends on the CFG, so
/// transformations that do not modify the CFG do not invalidate this pass. /// transformations that do not modify the CFG do not invalidate this pass.
/// ///
void setPreservesCFG(); void setOnlyUsesCFG();
}; };
template<typename PassName> template<typename PassName>
@ -196,25 +196,29 @@ struct RegisterPass : public RegisterPassBase {
/// ///
template<typename PassName> template<typename PassName>
struct RegisterOpt : public RegisterPassBase { struct RegisterOpt : public RegisterPassBase {
RegisterOpt(const char *PassArg, const char *Name) { RegisterOpt(const char *PassArg, const char *Name, bool CFGOnly = false) {
registerPass(new PassInfo(Name, PassArg, typeid(PassName), registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Optimization, PassInfo::Optimization,
callDefaultCtor<PassName>)); callDefaultCtor<PassName>));
if (CFGOnly) setOnlyUsesCFG();
} }
/// Register Pass using default constructor explicitly... /// Register Pass using default constructor explicitly...
/// ///
RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)()) { RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)(),
bool CFGOnly = false) {
registerPass(new PassInfo(Name, PassArg, typeid(PassName), registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Optimization, ctor)); PassInfo::Optimization, ctor));
if (CFGOnly) setOnlyUsesCFG();
} }
/// Register Pass using TargetMachine constructor... /// Register Pass using TargetMachine constructor...
/// ///
RegisterOpt(const char *PassArg, const char *Name, RegisterOpt(const char *PassArg, const char *Name,
Pass *(*targetctor)(TargetMachine &)) { Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) {
registerPass(new PassInfo(Name, PassArg, typeid(PassName), registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Optimization, 0, targetctor)); PassInfo::Optimization, 0, targetctor));
if (CFGOnly) setOnlyUsesCFG();
} }
}; };
@ -231,8 +235,7 @@ struct RegisterAnalysis : public RegisterPassBase {
registerPass(new PassInfo(Name, PassArg, typeid(PassName), registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Analysis, PassInfo::Analysis,
callDefaultCtor<PassName>)); callDefaultCtor<PassName>));
if (CFGOnly) if (CFGOnly) setOnlyUsesCFG();
setPreservesCFG();
} }
}; };