summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-22 05:54:03 +0000
committerChris Lattner <sabre@nondot.org>2010-01-22 05:54:03 +0000
commit6f6e87db19e2976b3e581587db0f44fdfc4be0ad (patch)
treed7f502327b8a5c24600d43128864170f43c3aa3c /tools
parentc5e5b3c830db331974ddae3d8fb98e678b3a7152 (diff)
downloadllvm-6f6e87db19e2976b3e581587db0f44fdfc4be0ad.tar.gz
llvm-6f6e87db19e2976b3e581587db0f44fdfc4be0ad.tar.bz2
llvm-6f6e87db19e2976b3e581587db0f44fdfc4be0ad.tar.xz
simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/opt/opt.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 292a42aab4..f7fd5c02b5 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -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));