diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-22 05:37:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-22 05:37:10 +0000 |
commit | 77c95ed74a4d5f122b3c9810209a0190dbf17504 (patch) | |
tree | a6a71c265f8949172f5fad906174135524b02f31 /lib/Analysis/IPA/CallGraphSCCPass.cpp | |
parent | 3660ecabbb85b31308f38938ce3f56f0a330a84b (diff) |
eliminate a bunch more unneeded dynamic_cast's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index bb2a2cc8c3..d31d814153 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -400,13 +400,14 @@ void CallGraphSCCPass::assignPassManager(PMStack &PMS, PMS.top()->getPassManagerType() > PMT_CallGraphPassManager) PMS.pop(); - assert (!PMS.empty() && "Unable to handle Call Graph Pass"); - CGPassManager *CGP = dynamic_cast<CGPassManager *>(PMS.top()); - - // Create new Call Graph SCC Pass Manager if it does not exist. - if (!CGP) { - - assert (!PMS.empty() && "Unable to create Call Graph Pass Manager"); + assert(!PMS.empty() && "Unable to handle Call Graph Pass"); + CGPassManager *CGP; + + if (PMS.top()->getPassManagerType() == PMT_CallGraphPassManager) + CGP = (CGPassManager*)PMS.top(); + else { + // Create new Call Graph SCC Pass Manager if it does not exist. + assert(!PMS.empty() && "Unable to create Call Graph Pass Manager"); PMDataManager *PMD = PMS.top(); // [1] Create new Call Graph Pass Manager @@ -418,7 +419,7 @@ void CallGraphSCCPass::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 *>(CGP); + Pass *P = CGP; TPM->schedulePass(P); // [4] Push new manager into PMS |