simplify code.

llvm-svn: 94159
This commit is contained in:
Chris Lattner 2010-01-22 05:54:03 +00:00
parent 2a96a8340e
commit 8b02bfe487

View File

@ -476,21 +476,16 @@ int main(int argc, char **argv) {
errs() << argv[0] << ": cannot create pass: "
<< PassInf->getPassName() << "\n";
if (P) {
bool isBBPass = dynamic_cast<BasicBlockPass*>(P) != 0;
bool isLPass = !isBBPass && dynamic_cast<LoopPass*>(P) != 0;
bool isFPass = !isLPass && dynamic_cast<FunctionPass*>(P) != 0;
bool isCGSCCPass = !isFPass && dynamic_cast<CallGraphSCCPass*>(P) != 0;
addPass(Passes, P);
if (AnalyzeOnly) {
if (isBBPass)
if (dynamic_cast<BasicBlockPass*>(P))
Passes.add(new BasicBlockPassPrinter(PassInf));
else if (isLPass)
else if (dynamic_cast<LoopPass*>(P))
Passes.add(new LoopPassPrinter(PassInf));
else if (isFPass)
else if (dynamic_cast<FunctionPass*>(P))
Passes.add(new FunctionPassPrinter(PassInf));
else if (isCGSCCPass)
else if (dynamic_cast<CallGraphSCCPass*>(P))
Passes.add(new CallGraphSCCPassPrinter(PassInf));
else
Passes.add(new ModulePassPrinter(PassInf));