[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Tue Nov 7 14:23:57 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.3 -> 1.4
---
Log message:
Add PassManager_New.
---
Diffs of the changes: (+41 -0)
PassManager.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.3 llvm/lib/VMCore/PassManager.cpp:1.4
--- llvm/lib/VMCore/PassManager.cpp:1.3 Tue Nov 7 16:03:15 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 16:23:34 2006
@@ -163,3 +163,44 @@
return Changed;
}
+/// Schedule all passes from the queue by adding them in their
+/// respective manager's queue.
+void
+PassManager_New::schedulePasses() {
+ /* TODO */
+}
+
+/// Add pass P to the queue of passes to run.
+void
+PassManager_New::add(Pass *P) {
+ /* TODO */
+}
+
+// PassManager_New implementation
+/// Add P into active pass manager or use new module pass manager to
+/// manage it.
+bool
+PassManager_New::addPass (Pass *P) {
+
+ if (!activeManager) {
+ activeManager = new ModulePassManager_New();
+ PassManagers.push_back(activeManager);
+ }
+
+ return activeManager->addPass(P);
+}
+
+/// run - Execute all of the passes scheduled for execution. Keep track of
+/// whether any of the passes modifies the module, and if so, return true.
+bool
+PassManager_New::run(Module &M) {
+
+ schedulePasses();
+ bool Changed = false;
+ for (std::vector<ModulePassManager_New *>::iterator itr = PassManagers.begin(),
+ e = PassManagers.end(); itr != e; ++itr) {
+ ModulePassManager_New *pm = *itr;
+ Changed |= pm->runOnModule(M);
+ }
+ return Changed;
+}
More information about the llvm-commits
mailing list