mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-23 11:34:27 +00:00
Implement PassManager_New destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -97,6 +97,7 @@ class PassManager_New {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
PassManager_New();
|
PassManager_New();
|
||||||
|
~PassManager_New();
|
||||||
|
|
||||||
/// add - Add a pass to the queue of passes to run. This passes ownership of
|
/// 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
|
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
|
||||||
@@ -121,7 +122,7 @@ class FunctionPassManager_New {
|
|||||||
public:
|
public:
|
||||||
FunctionPassManager_New(ModuleProvider *P);
|
FunctionPassManager_New(ModuleProvider *P);
|
||||||
FunctionPassManager_New();
|
FunctionPassManager_New();
|
||||||
~FunctionPassManager_New() { /* TODO */ };
|
~FunctionPassManager_New();
|
||||||
|
|
||||||
/// add - Add a pass to the queue of passes to run. This passes
|
/// add - Add a pass to the queue of passes to run. This passes
|
||||||
/// ownership of the Pass to the PassManager. When the
|
/// ownership of the Pass to the PassManager. When the
|
||||||
|
|||||||
@@ -126,6 +126,15 @@ public:
|
|||||||
Pass *findAnalysisPass(AnalysisID AID);
|
Pass *findAnalysisPass(AnalysisID AID);
|
||||||
|
|
||||||
virtual ~PMTopLevelManager() {
|
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();
|
PassManagers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,6 +191,15 @@ public:
|
|||||||
initializeAnalysisInfo();
|
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
|
/// Return true IFF pass P's required analysis set does not required new
|
||||||
/// manager.
|
/// manager.
|
||||||
bool manageablePass(Pass *P);
|
bool manageablePass(Pass *P);
|
||||||
@@ -914,6 +932,10 @@ FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P) {
|
|||||||
MP = P;
|
MP = P;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionPassManager_New::~FunctionPassManager_New() {
|
||||||
|
delete FPM;
|
||||||
|
}
|
||||||
|
|
||||||
/// add - Add a pass to the queue of passes to run. This passes
|
/// add - Add a pass to the queue of passes to run. This passes
|
||||||
/// ownership of the Pass to the PassManager. When the
|
/// ownership of the Pass to the PassManager. When the
|
||||||
/// PassManager_X is destroyed, the pass will be destroyed as well, so
|
/// PassManager_X is destroyed, the pass will be destroyed as well, so
|
||||||
@@ -1187,8 +1209,7 @@ ModulePassManager_New::runOnModule(Module &M) {
|
|||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// PassManagerImpl implementation
|
// PassManagerImpl implementation
|
||||||
|
//
|
||||||
// PassManager_New implementation
|
|
||||||
/// Add P into active pass manager or use new module pass manager to
|
/// Add P into active pass manager or use new module pass manager to
|
||||||
/// manage it.
|
/// manage it.
|
||||||
bool PassManagerImpl_New::addPass(Pass *P) {
|
bool PassManagerImpl_New::addPass(Pass *P) {
|
||||||
@@ -1232,6 +1253,10 @@ PassManager_New::PassManager_New() {
|
|||||||
PM->setTopLevelManager(PM);
|
PM->setTopLevelManager(PM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PassManager_New::~PassManager_New() {
|
||||||
|
delete PM;
|
||||||
|
}
|
||||||
|
|
||||||
/// add - Add a pass to the queue of passes to run. This passes ownership of
|
/// 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
|
/// 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
|
/// will be destroyed as well, so there is no need to delete the pass. This
|
||||||
|
|||||||
Reference in New Issue
Block a user