diff options
Diffstat (limited to 'tools/opt/opt.cpp')
-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 f7fd5c0..6ed8c9d 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; + } } } |