diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-22 06:03:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-22 06:03:06 +0000 |
commit | 476e9bd1146624fa17243ae55fdb156f905ba3d4 (patch) | |
tree | 05d19c1e722c5a9095a8517de04e345d87a79ed5 /tools | |
parent | 6f6e87db19e2976b3e581587db0f44fdfc4be0ad (diff) |
elimiante the dynamic_cast's from opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/opt/opt.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f7fd5c02b5..6ed8c9ded0 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -479,16 +479,23 @@ int main(int argc, char **argv) { addPass(Passes, P); if (AnalyzeOnly) { - if (dynamic_cast<BasicBlockPass*>(P)) + switch (P->getPassKind()) { + case PT_BasicBlock: Passes.add(new BasicBlockPassPrinter(PassInf)); - else if (dynamic_cast<LoopPass*>(P)) + break; + case PT_Loop: Passes.add(new LoopPassPrinter(PassInf)); - else if (dynamic_cast<FunctionPass*>(P)) + break; + case PT_Function: Passes.add(new FunctionPassPrinter(PassInf)); - else if (dynamic_cast<CallGraphSCCPass*>(P)) + break; + case PT_CallGraphSCC: Passes.add(new CallGraphSCCPassPrinter(PassInf)); - else + break; + default: Passes.add(new ModulePassPrinter(PassInf)); + break; + } } } |