Add comment.
[oota-llvm.git] / lib / Transforms / Scalar / SimplifyCFG.cpp
index 3d1a5bea97ce1e23c7b90615d36d03443ef7a4bf..5cb2b4086b8af4cf05f3cb78323ff0813cbdb1b4 100644 (file)
@@ -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))