[llvm-commits] CVS: llvm/include/llvm/PassSupport.h
Misha Brukman
brukman at cs.uiuc.edu
Fri Nov 7 12:57:01 PST 2003
Changes in directory llvm/include/llvm:
PassSupport.h updated: 1.15 -> 1.16
---
Log message:
Added ability to register FunctionPasses as optimizations, with
TargetMachine-accepting constructors (thanks to Chris).
---
Diffs of the changes: (+20 -0)
Index: llvm/include/llvm/PassSupport.h
diff -u llvm/include/llvm/PassSupport.h:1.15 llvm/include/llvm/PassSupport.h:1.16
--- llvm/include/llvm/PassSupport.h:1.15 Mon Oct 20 15:19:14 2003
+++ llvm/include/llvm/PassSupport.h Fri Nov 7 12:56:32 2003
@@ -219,12 +219,32 @@
if (CFGOnly) setOnlyUsesCFG();
}
+ /// Register FunctionPass using default constructor explicitly...
+ ///
+ RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*ctor)(),
+ bool CFGOnly = false) {
+ registerPass(new PassInfo(Name, PassArg, typeid(PassName),
+ PassInfo::Optimization, (Pass*(*)())ctor));
+ if (CFGOnly) setOnlyUsesCFG();
+ }
+
/// Register Pass using TargetMachine constructor...
///
RegisterOpt(const char *PassArg, const char *Name,
Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) {
registerPass(new PassInfo(Name, PassArg, typeid(PassName),
PassInfo::Optimization, 0, targetctor));
+ if (CFGOnly) setOnlyUsesCFG();
+ }
+
+ /// Register FunctionPass using TargetMachine constructor...
+ ///
+ RegisterOpt(const char *PassArg, const char *Name,
+ FunctionPass *(*targetctor)(TargetMachine &),
+ bool CFGOnly = false) {
+ registerPass(new PassInfo(Name, PassArg, typeid(PassName),
+ PassInfo::Optimization, 0,
+ (Pass*(*)(TargetMachine&))targetctor));
if (CFGOnly) setOnlyUsesCFG();
}
};
More information about the llvm-commits
mailing list