[llvm-commits] CVS: llvm/include/llvm/PassSupport.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Oct 12 13:53:01 PDT 2003
Changes in directory llvm/include/llvm:
PassSupport.h updated: 1.13 -> 1.14
---
Log message:
Rename method to indicate what it does
---
Diffs of the changes: (+10 -7)
Index: llvm/include/llvm/PassSupport.h
diff -u llvm/include/llvm/PassSupport.h:1.13 llvm/include/llvm/PassSupport.h:1.14
--- llvm/include/llvm/PassSupport.h:1.13 Sat Jun 21 22:07:32 2003
+++ llvm/include/llvm/PassSupport.h Sun Oct 12 13:51:53 2003
@@ -152,10 +152,10 @@
void registerPass(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.
///
- void setPreservesCFG();
+ void setOnlyUsesCFG();
};
template<typename PassName>
@@ -196,25 +196,29 @@
///
template<typename PassName>
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),
PassInfo::Optimization,
callDefaultCtor<PassName>));
+ if (CFGOnly) setOnlyUsesCFG();
}
/// 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),
PassInfo::Optimization, ctor));
+ if (CFGOnly) setOnlyUsesCFG();
}
/// Register Pass using TargetMachine constructor...
///
RegisterOpt(const char *PassArg, const char *Name,
- Pass *(*targetctor)(TargetMachine &)) {
+ Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) {
registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Optimization, 0, targetctor));
+ if (CFGOnly) setOnlyUsesCFG();
}
};
@@ -231,8 +235,7 @@
registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Analysis,
callDefaultCtor<PassName>));
- if (CFGOnly)
- setPreservesCFG();
+ if (CFGOnly) setOnlyUsesCFG();
}
};
More information about the llvm-commits
mailing list