[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Mon Apr 16 13:40:20 PDT 2007
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.149 -> 1.150
---
Log message:
Print and delete on the fly pass managers.
---
Diffs of the changes: (+19 -3)
PassManager.cpp | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.149 llvm/lib/VMCore/PassManager.cpp:1.150
--- llvm/lib/VMCore/PassManager.cpp:1.149 Mon Apr 16 15:27:05 2007
+++ llvm/lib/VMCore/PassManager.cpp Mon Apr 16 15:39:59 2007
@@ -180,7 +180,17 @@
public:
MPPassManager(int Depth) : PMDataManager(Depth) { }
-
+
+ // Delete on the fly managers.
+ virtual ~MPPassManager() {
+ for (std::map<Pass *, FPPassManager *>::iterator
+ I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end();
+ I != E; ++I) {
+ FPPassManager *FPP = I->second;
+ delete FPP;
+ }
+ }
+
/// 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 runOnModule(Module &M);
@@ -210,6 +220,8 @@
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index);
MP->dumpPassStructure(Offset + 1);
+ if (FPPassManager *FPP = OnTheFlyManagers[MP])
+ FPP->dumpPassStructure(Offset + 2);
dumpLastUses(MP, Offset+1);
}
}
@@ -625,6 +637,7 @@
std::vector<Pass *> DeadPasses;
+ // If this is a on the fly manager then it does not have TPM.
if (!TPM)
return;
@@ -795,8 +808,11 @@
void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{
std::vector<Pass *> LUses;
-
- assert (TPM && "Top Level Manager is missing");
+
+ // If this is a on the fly manager then it does not have TPM.
+ if (!TPM)
+ return;
+
TPM->collectLastUses(LUses, P);
for (std::vector<Pass *>::iterator I = LUses.begin(),
More information about the llvm-commits
mailing list