mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Eliminate a few unnecessary uses of dynamic_cast.
llvm-svn: 48318
This commit is contained in:
parent
548e24d9ae
commit
e84a9f3740
@ -1038,8 +1038,7 @@ FunctionPassManager::FunctionPassManager(ModuleProvider *P) {
|
|||||||
// FPM is the top level manager.
|
// FPM is the top level manager.
|
||||||
FPM->setTopLevelManager(FPM);
|
FPM->setTopLevelManager(FPM);
|
||||||
|
|
||||||
PMDataManager *PMD = dynamic_cast<PMDataManager *>(FPM);
|
AnalysisResolver *AR = new AnalysisResolver(*FPM);
|
||||||
AnalysisResolver *AR = new AnalysisResolver(*PMD);
|
|
||||||
FPM->setResolver(AR);
|
FPM->setResolver(AR);
|
||||||
|
|
||||||
MP = P;
|
MP = P;
|
||||||
@ -1471,14 +1470,13 @@ void FunctionPass::assignPassManager(PMStack &PMS,
|
|||||||
|
|
||||||
// [3] Assign manager to manage this new manager. This may create
|
// [3] Assign manager to manage this new manager. This may create
|
||||||
// and push new managers into PMS
|
// and push new managers into PMS
|
||||||
Pass *P = dynamic_cast<Pass *>(FPP);
|
|
||||||
|
|
||||||
// If Call Graph Pass Manager is active then use it to manage
|
// If Call Graph Pass Manager is active then use it to manage
|
||||||
// this new Function Pass manager.
|
// this new Function Pass manager.
|
||||||
if (PMD->getPassManagerType() == PMT_CallGraphPassManager)
|
if (PMD->getPassManagerType() == PMT_CallGraphPassManager)
|
||||||
P->assignPassManager(PMS, PMT_CallGraphPassManager);
|
FPP->assignPassManager(PMS, PMT_CallGraphPassManager);
|
||||||
else
|
else
|
||||||
P->assignPassManager(PMS);
|
FPP->assignPassManager(PMS);
|
||||||
|
|
||||||
// [4] Push new manager into PMS
|
// [4] Push new manager into PMS
|
||||||
PMS.push(FPP);
|
PMS.push(FPP);
|
||||||
@ -1517,8 +1515,7 @@ void BasicBlockPass::assignPassManager(PMStack &PMS,
|
|||||||
|
|
||||||
// [3] Assign manager to manage this new manager. This may create
|
// [3] Assign manager to manage this new manager. This may create
|
||||||
// and push new managers into PMS
|
// and push new managers into PMS
|
||||||
Pass *P = dynamic_cast<Pass *>(BBP);
|
BBP->assignPassManager(PMS);
|
||||||
P->assignPassManager(PMS);
|
|
||||||
|
|
||||||
// [4] Push new manager into PMS
|
// [4] Push new manager into PMS
|
||||||
PMS.push(BBP);
|
PMS.push(BBP);
|
||||||
|
Loading…
Reference in New Issue
Block a user