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 | 89acd61805ca070deba4805869fcc582d96b47fd (patch) | |
tree | 05a605e891acf49d3fa92692314720a030f596d3 /llvm/lib/Transforms/Scalar/SimplifyCFG.cpp | |
parent | 64db2b9615096902c246403414572193a460029d (diff) | |
download | bcm5719-llvm-89acd61805ca070deba4805869fcc582d96b47fd.tar.gz bcm5719-llvm-89acd61805ca070deba4805869fcc582d96b47fd.zip |
simplify code, no functionality change.
llvm-svn: 47116
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFG.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp index 3d1a5bea97c..5cb2b4086b8 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFG.cpp +++ b/llvm/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)) |