[cfe-commits] r47579 - /cfe/trunk/AST/CFG.cpp

Ted Kremenek kremenek at apple.com
Mon Feb 25 16:22:58 PST 2008


Author: kremenek
Date: Mon Feb 25 18:22:58 2008
New Revision: 47579

URL: http://llvm.org/viewvc/llvm-project?rev=47579&view=rev
Log:
Fixed bug in CFG construction when a CompoundStmt ended with a NullStmt.
This caused the whole body to get dropped from the CFG.

Modified:
    cfe/trunk/AST/CFG.cpp

Modified: cfe/trunk/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/CFG.cpp?rev=47579&r1=47578&r2=47579&view=diff

==============================================================================
--- cfe/trunk/AST/CFG.cpp (original)
+++ cfe/trunk/AST/CFG.cpp Mon Feb 25 18:22:58 2008
@@ -447,17 +447,13 @@
 }
 
 CFGBlock* CFGBuilder::VisitCompoundStmt(CompoundStmt* C) {
-  //   The value returned from this function is the last created CFGBlock
-  //   that represents the "entry" point for the translated AST node.
-  CFGBlock* LastBlock = 0;
-  
-  for (CompoundStmt::reverse_body_iterator I = C->body_rbegin(),
-       E = C->body_rend(); I != E; ++I )
-    // Add the statement to the current block.
-    if (!(LastBlock=Visit(*I)))
-      return NULL;
 
-  return LastBlock;
+  for (CompoundStmt::reverse_body_iterator I=C->body_rbegin(), E=C->body_rend();
+                                                               I != E; ++I ) {
+    Visit(*I);
+  }
+
+  return Block;
 }
 
 CFGBlock* CFGBuilder::VisitIfStmt(IfStmt* I) {





More information about the cfe-commits mailing list