[cfe-commits] r105384 - /cfe/trunk/lib/Analysis/CFG.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Jun 2 23:43:23 PDT 2010


Author: zhongxingxu
Date: Thu Jun  3 01:43:23 2010
New Revision: 105384

URL: http://llvm.org/viewvc/llvm-project?rev=105384&view=rev
Log:
Make addStmt always add stmt. Delegate other cases to Visit() directly.

Modified:
    cfe/trunk/lib/Analysis/CFG.cpp

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=105384&r1=105383&r2=105384&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu Jun  3 01:43:23 2010
@@ -171,8 +171,8 @@
   void autoCreateBlock() { if (!Block) Block = createBlock(); }
   CFGBlock *createBlock(bool add_successor = true);
   bool FinishBlock(CFGBlock* B);
-  CFGBlock *addStmt(Stmt *S, AddStmtChoice asc = AddStmtChoice::AlwaysAdd) {
-    return Visit(S, asc);
+  CFGBlock *addStmt(Stmt *S) {
+    return Visit(S, AddStmtChoice::AlwaysAdd);
   }
   
   void AppendStmt(CFGBlock *B, Stmt *S,
@@ -664,13 +664,13 @@
 
   Succ = ConfluenceBlock;
   Block = NULL;
-  CFGBlock* LHSBlock = addStmt(C->getLHS(), asc);
+  CFGBlock* LHSBlock = Visit(C->getLHS(), asc);
   if (!FinishBlock(LHSBlock))
     return 0;
 
   Succ = ConfluenceBlock;
   Block = NULL;
-  CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
+  CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
   if (!FinishBlock(RHSBlock))
     return 0;
 
@@ -722,7 +722,7 @@
   Block = NULL;
   CFGBlock* LHSBlock = NULL;
   if (C->getLHS()) {
-    LHSBlock = addStmt(C->getLHS(), asc);
+    LHSBlock = Visit(C->getLHS(), asc);
     if (!FinishBlock(LHSBlock))
       return 0;
     Block = NULL;
@@ -730,7 +730,7 @@
 
   // Create the block for the RHS expression.
   Succ = ConfluenceBlock;
-  CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
+  CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
   if (!FinishBlock(RHSBlock))
     return 0;
 





More information about the cfe-commits mailing list