public:
PassManager_New();
+ ~PassManager_New();
/// 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
public:
FunctionPassManager_New(ModuleProvider *P);
FunctionPassManager_New();
- ~FunctionPassManager_New() { /* TODO */ };
+ ~FunctionPassManager_New();
/// add - Add a pass to the queue of passes to run. This passes
/// ownership of the Pass to the PassManager. When the
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();
}
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);
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
//===----------------------------------------------------------------------===//
// 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) {
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