[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Sep 3 21:07:54 PDT 2006
Changes in directory llvm/lib/VMCore:
Pass.cpp updated: 1.71 -> 1.72
---
Log message:
Add explicit doInitialization/doFinalization methods instead of making
the FunctionPassManager redo this for each function.
---
Diffs of the changes: (+14 -1)
Pass.cpp | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletion(-)
Index: llvm/lib/VMCore/Pass.cpp
diff -u llvm/lib/VMCore/Pass.cpp:1.71 llvm/lib/VMCore/Pass.cpp:1.72
--- llvm/lib/VMCore/Pass.cpp:1.71 Sun Aug 27 17:21:55 2006
+++ llvm/lib/VMCore/Pass.cpp Sun Sep 3 23:07:39 2006
@@ -94,13 +94,26 @@
FunctionPassManager::~FunctionPassManager() { delete PM; }
void FunctionPassManager::add(FunctionPass *P) { PM->add(P); }
void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); }
+
+/// doInitialization - Run all of the initializers for the function passes.
+///
+bool FunctionPassManager::doInitialization() {
+ return PM->doInitialization(*MP->getModule());
+}
+
bool FunctionPassManager::run(Function &F) {
std::string errstr;
if (MP->materializeFunction(&F, &errstr)) {
std::cerr << "Error reading bytecode file: " << errstr << "\n";
abort();
}
- return PM->run(F);
+ return PM->runOnFunction(F);
+}
+
+/// doFinalization - Run all of the initializers for the function passes.
+///
+bool FunctionPassManager::doFinalization() {
+ return PM->doFinalization(*MP->getModule());
}
More information about the llvm-commits
mailing list