summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-12-13 00:09:23 +0000
committerDevang Patel <dpatel@apple.com>2006-12-13 00:09:23 +0000
commitab97cf4c7cbc58961f38b092c772943897f133e0 (patch)
tree45bfe3d4ba07f0f00adcbd7fe6f1d66cc95b2e30 /llvm/lib
parent209b13990f2d0a428712d48b1a4bc14cc67d74bd (diff)
downloadbcm5719-llvm-ab97cf4c7cbc58961f38b092c772943897f133e0.tar.gz
bcm5719-llvm-ab97cf4c7cbc58961f38b092c772943897f133e0.zip
Implement PassManager_New destructors.
llvm-svn: 32517
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/PassManager.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp
index 5a3def33161..e6f69c07a6a 100644
--- a/llvm/lib/VMCore/PassManager.cpp
+++ b/llvm/lib/VMCore/PassManager.cpp
@@ -126,6 +126,15 @@ public:
Pass *findAnalysisPass(AnalysisID AID);
virtual ~PMTopLevelManager() {
+
+ for (std::vector<Pass *>::iterator I = PassManagers.begin(),
+ E = PassManagers.end(); I != E; ++I)
+ delete *I;
+
+ for (std::vector<ImmutablePass *>::iterator
+ I = ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I)
+ delete *I;
+
PassManagers.clear();
}
@@ -182,6 +191,15 @@ public:
initializeAnalysisInfo();
}
+ virtual ~PMDataManager() {
+
+ for (std::vector<Pass *>::iterator I = PassVector.begin(),
+ E = PassVector.end(); I != E; ++I)
+ delete *I;
+
+ PassVector.clear();
+ }
+
/// Return true IFF pass P's required analysis set does not required new
/// manager.
bool manageablePass(Pass *P);
@@ -914,6 +932,10 @@ FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P) {
MP = P;
}
+FunctionPassManager_New::~FunctionPassManager_New() {
+ delete FPM;
+}
+
/// add - Add a pass to the queue of passes to run. This passes
/// ownership of the Pass to the PassManager. When the
/// PassManager_X is destroyed, the pass will be destroyed as well, so
@@ -1187,8 +1209,7 @@ ModulePassManager_New::runOnModule(Module &M) {
//===----------------------------------------------------------------------===//
// PassManagerImpl implementation
-
-// PassManager_New implementation
+//
/// Add P into active pass manager or use new module pass manager to
/// manage it.
bool PassManagerImpl_New::addPass(Pass *P) {
@@ -1232,6 +1253,10 @@ PassManager_New::PassManager_New() {
PM->setTopLevelManager(PM);
}
+PassManager_New::~PassManager_New() {
+ delete PM;
+}
+
/// add - Add a pass to the queue of passes to run. This passes ownership of
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
/// will be destroyed as well, so there is no need to delete the pass. This
OpenPOWER on IntegriCloud