[llvm-commits] [llvm] r48318 - /llvm/trunk/lib/VMCore/PassManager.cpp
Dan Gohman
gohman at apple.com
Wed Mar 12 19:08:36 PDT 2008
Author: djg
Date: Wed Mar 12 21:08:36 2008
New Revision: 48318
URL: http://llvm.org/viewvc/llvm-project?rev=48318&view=rev
Log:
Eliminate a few unnecessary uses of dynamic_cast.
Modified:
llvm/trunk/lib/VMCore/PassManager.cpp
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=48318&r1=48317&r2=48318&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Mar 12 21:08:36 2008
@@ -1038,8 +1038,7 @@
// 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 @@
// [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 @@
// [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);
More information about the llvm-commits
mailing list