diff options
author | Dan Gohman <gohman@apple.com> | 2008-03-13 02:08:36 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-03-13 02:08:36 +0000 |
commit | 59ef015c65cecee948d1cf13812c5d0b47cb792a (patch) | |
tree | d5f76fc98841b00fde9dff44733ffb9ce3924296 /lib/VMCore/PassManager.cpp | |
parent | 9769cee9f74947429f2b05ed7d41d206690e350d (diff) | |
download | external_llvm-59ef015c65cecee948d1cf13812c5d0b47cb792a.zip external_llvm-59ef015c65cecee948d1cf13812c5d0b47cb792a.tar.gz external_llvm-59ef015c65cecee948d1cf13812c5d0b47cb792a.tar.bz2 |
Eliminate a few unnecessary uses of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index b68d305..5a85a16 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -1038,8 +1038,7 @@ FunctionPassManager::FunctionPassManager(ModuleProvider *P) { // FPM is the top level manager. FPM->setTopLevelManager(FPM); - PMDataManager *PMD = dynamic_cast<PMDataManager *>(FPM); - AnalysisResolver *AR = new AnalysisResolver(*PMD); + AnalysisResolver *AR = new AnalysisResolver(*FPM); FPM->setResolver(AR); MP = P; @@ -1471,14 +1470,13 @@ void FunctionPass::assignPassManager(PMStack &PMS, // [3] Assign manager to manage this new manager. This may create // and push new managers into PMS - Pass *P = dynamic_cast<Pass *>(FPP); // If Call Graph Pass Manager is active then use it to manage // this new Function Pass manager. if (PMD->getPassManagerType() == PMT_CallGraphPassManager) - P->assignPassManager(PMS, PMT_CallGraphPassManager); + FPP->assignPassManager(PMS, PMT_CallGraphPassManager); else - P->assignPassManager(PMS); + FPP->assignPassManager(PMS); // [4] Push new manager into PMS PMS.push(FPP); @@ -1517,8 +1515,7 @@ void BasicBlockPass::assignPassManager(PMStack &PMS, // [3] Assign manager to manage this new manager. This may create // and push new managers into PMS - Pass *P = dynamic_cast<Pass *>(BBP); - P->assignPassManager(PMS); + BBP->assignPassManager(PMS); // [4] Push new manager into PMS PMS.push(BBP); |