[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Jan 3 20:36:23 PST 2006
Changes in directory llvm/lib/VMCore:
PassManagerT.h updated: 1.60 -> 1.61
---
Log message:
patch #4 in Saem's passmanager refactoring.
---
Diffs of the changes: (+50 -15)
PassManagerT.h | 65 +++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 50 insertions(+), 15 deletions(-)
Index: llvm/lib/VMCore/PassManagerT.h
diff -u llvm/lib/VMCore/PassManagerT.h:1.60 llvm/lib/VMCore/PassManagerT.h:1.61
--- llvm/lib/VMCore/PassManagerT.h:1.60 Tue Jan 3 11:52:18 2006
+++ llvm/lib/VMCore/PassManagerT.h Tue Jan 3 22:36:11 2006
@@ -620,6 +620,7 @@
// Initialize the immutable pass...
IP->initializePass();
}
+
};
@@ -659,7 +660,10 @@
virtual const char *getPMName() const { return "BasicBlock"; }
virtual const char *getPassName() const { return "BasicBlock Pass Manager"; }
-
+
+ virtual bool runOnBasicBlock(BasicBlock &BB);
+
+
// TODO:Start absorbing PassManagerTraits<BasicBlock>
};
@@ -682,7 +686,12 @@
// Implement the BasicBlockPass interface...
virtual bool doInitialization(Module &M);
virtual bool doInitialization(Function &F);
- virtual bool runOnBasicBlock(BasicBlock &BB);
+
+ // Forwarded
+ virtual bool runOnBasicBlock(BasicBlock &BB) {
+ return BasicBlockPassManager::runOnBasicBlock(BB);
+ }
+
virtual bool doFinalization(Function &F);
virtual bool doFinalization(Module &M);
@@ -728,7 +737,10 @@
virtual const char *getPMName() const { return "Function"; }
virtual const char *getPassName() const { return "Function Pass Manager"; }
-
+
+ virtual bool runOnFunction(Function &F);
+
+
// TODO:Start absorbing PassManagerTraits<Function>
};
@@ -749,7 +761,12 @@
// Implement the FunctionPass interface...
virtual bool doInitialization(Module &M);
- virtual bool runOnFunction(Function &F);
+
+ // Forwarded
+ virtual bool runOnFunction(Function &F) {
+ return FunctionPassManagerT::runOnFunction(F);
+ }
+
virtual bool doFinalization(Module &M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -762,7 +779,6 @@
}
};
-
//===----------------------------------------------------------------------===//
// ModulePassManager
//
@@ -792,6 +808,8 @@
// debugging.
virtual const char *getPMName() const { return "Module"; }
+ // runOnModule - Implement the PassManager interface.
+ virtual bool runOnModule(Module &M);
// TODO:Start absorbing PassManagerTraits<Module>
};
@@ -808,9 +826,9 @@
// runPass - Specify how the pass should be run on the UnitType
static bool runPass(PassClass *P, Module *M) { return P->runOnModule(*M); }
- // runOnModule - Implement the PassManager interface.
+ // Forwarded
bool runOnModule(Module &M) {
- return ((PassManagerT<Module>*)this)->runOnUnit(&M);
+ return ModulePassManager::runOnModule(M);
}
// Forwarded
@@ -824,6 +842,31 @@
// PassManagerTraits Method Implementations
//
+// BasicBlockPassManager Implementations
+//
+
+inline bool BasicBlockPassManager::runOnBasicBlock(BasicBlock &BB) {
+ return ((PMType*)this)->runOnUnit(&BB);
+}
+
+// FunctionPassManagerT Implementations
+//
+
+inline bool FunctionPassManagerT::runOnFunction(Function &F) {
+ return ((PMType*)this)->runOnUnit(&F);
+}
+
+// ModulePassManager Implementations
+//
+
+bool ModulePassManager::runOnModule(Module &M) {
+ return ((PassManagerT<Module>*)this)->runOnUnit(&M);
+}
+
+//===----------------------------------------------------------------------===//
+// PassManagerTraits Method Implementations
+//
+
// PassManagerTraits<BasicBlock> Implementations
//
inline bool PassManagerTraits<BasicBlock>::doInitialization(Module &M) {
@@ -840,10 +883,6 @@
return Changed;
}
-inline bool PassManagerTraits<BasicBlock>::runOnBasicBlock(BasicBlock &BB) {
- return ((PMType*)this)->runOnUnit(&BB);
-}
-
inline bool PassManagerTraits<BasicBlock>::doFinalization(Function &F) {
bool Changed = false;
for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
@@ -868,10 +907,6 @@
return Changed;
}
-inline bool PassManagerTraits<Function>::runOnFunction(Function &F) {
- return ((PMType*)this)->runOnUnit(&F);
-}
-
inline bool PassManagerTraits<Function>::doFinalization(Module &M) {
bool Changed = false;
for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
More information about the llvm-commits
mailing list