diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-14 07:39:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-14 07:39:01 +0000 |
commit | 13daadbd256cc69cb80426f102d3637e17541e75 (patch) | |
tree | 7689d70b16e5397986ec599d9a3fd65203fe351e | |
parent | 0fec975a183002d9bf59a4c224c048ef9dfd0ba2 (diff) | |
download | external_llvm-13daadbd256cc69cb80426f102d3637e17541e75.tar.gz external_llvm-13daadbd256cc69cb80426f102d3637e17541e75.tar.bz2 external_llvm-13daadbd256cc69cb80426f102d3637e17541e75.zip |
simplify code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47116 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/SimplifyCFG.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/SimplifyCFG.cpp b/lib/Transforms/Scalar/SimplifyCFG.cpp index 3d1a5bea97..5cb2b4086b 100644 --- a/lib/Transforms/Scalar/SimplifyCFG.cpp +++ b/lib/Transforms/Scalar/SimplifyCFG.cpp @@ -162,13 +162,15 @@ static bool RemoveUnreachableBlocks(Function &F) { // Loop over all of the basic blocks that are not reachable, dropping all of // their internal references... - for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB) - if (!Reachable.count(BB)) { - for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI!=SE; ++SI) - if (Reachable.count(*SI)) - (*SI)->removePredecessor(BB); - BB->dropAllReferences(); - } + for (Function::iterator BB = ++F.begin(), E = F.end(); BB != E; ++BB) { + if (Reachable.count(BB)) + continue; + + for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) + if (Reachable.count(*SI)) + (*SI)->removePredecessor(BB); + BB->dropAllReferences(); + } for (Function::iterator I = ++F.begin(); I != F.end();) if (!Reachable.count(I)) |