diff options
author | Devang Patel <dpatel@apple.com> | 2006-12-07 22:09:36 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-12-07 22:09:36 +0000 |
commit | 0ac961d9c1c511204abfb02f5c25c92da6b75eb6 (patch) | |
tree | 96374456cd4eeca53fb456d87f580fe82c1fadc0 | |
parent | b917e38c84fa9c7c434762a0e587af63eec939e5 (diff) | |
download | external_llvm-0ac961d9c1c511204abfb02f5c25c92da6b75eb6.zip external_llvm-0ac961d9c1c511204abfb02f5c25c92da6b75eb6.tar.gz external_llvm-0ac961d9c1c511204abfb02f5c25c92da6b75eb6.tar.bz2 |
Make current pass info available _after_ removing info that is not
preserved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32329 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/PassManager.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 8324631..29d0ec1 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -533,12 +533,11 @@ void PMDataManager::addPassToManager(Pass *P, bool ProcessAnalysis) { if (ProcessAnalysis) { - // Take a note of analysis required and made available by this pass - initializeAnalysisImpl(P); - recordAvailableAnalysis(P); - + // Take a note of analysis required and made available by this pass. // Remove the analysis not preserved by this pass + initializeAnalysisImpl(P); removeNotPreservedAnalysis(P); + recordAvailableAnalysis(P); } // Add pass @@ -600,10 +599,10 @@ BasicBlockPassManager_New::runOnFunction(Function &F) { e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; - recordAvailableAnalysis(P); BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P); Changed |= BP->runOnBasicBlock(*I); removeNotPreservedAnalysis(P); + recordAvailableAnalysis(P); removeDeadPasses(P); } return Changed; @@ -718,10 +717,10 @@ bool FunctionPassManagerImpl_New::runOnModule(Module &M) { e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; - recordAvailableAnalysis(P); FunctionPass *FP = dynamic_cast<FunctionPass*>(P); Changed |= FP->runOnFunction(*I); removeNotPreservedAnalysis(P); + recordAvailableAnalysis(P); removeDeadPasses(P); } return Changed; @@ -739,10 +738,10 @@ bool FunctionPassManagerImpl_New::runOnFunction(Function &F) { e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; - recordAvailableAnalysis(P); FunctionPass *FP = dynamic_cast<FunctionPass*>(P); Changed |= FP->runOnFunction(F); removeNotPreservedAnalysis(P); + recordAvailableAnalysis(P); removeDeadPasses(P); } return Changed; @@ -848,10 +847,10 @@ ModulePassManager_New::runOnModule(Module &M) { e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; - recordAvailableAnalysis(P); ModulePass *MP = dynamic_cast<ModulePass*>(P); Changed |= MP->runOnModule(M); removeNotPreservedAnalysis(P); + recordAvailableAnalysis(P); removeDeadPasses(P); } return Changed; |