[llvm-commits] [llvm] r47116 - /llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp

Chris Lattner sabre at nondot.org
Wed Feb 13 23:39:01 PST 2008


Author: lattner
Date: Thu Feb 14 01:39:01 2008
New Revision: 47116

URL: http://llvm.org/viewvc/llvm-project?rev=47116&view=rev
Log:
simplify code, no functionality change.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=47116&r1=47115&r2=47116&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Thu Feb 14 01:39:01 2008
@@ -162,13 +162,15 @@
   
   // 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))





More information about the llvm-commits mailing list