[cfe-commits] [PATCH] In CFGBuilder, reverse the RHSBlock of LogicalOp && and ||

Zhongxing Xu xuzhongxing at gmail.com
Fri Oct 3 21:06:32 PDT 2008


[xing at nc8430 clang]$ svn diff
Index: lib/AST/CFG.cpp
===================================================================
--- lib/AST/CFG.cpp     (revision 57001)
+++ lib/AST/CFG.cpp     (working copy)
@@ -458,6 +458,7 @@
         Succ = ConfluenceBlock;
         Block = NULL;
         CFGBlock* RHSBlock = Visit(B->getRHS());
+        FinishBlock(RHSBlock);

         // Now link the LHSBlock with RHSBlock.
         if (B->getOpcode() == BinaryOperator::LOr) {


Test case:

void f() {
  int i;
  if (i >3 && (i < 10, i < 11)) {
    i = 10;
  }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20081004/b8d8b8f4/attachment.html>


More information about the cfe-commits mailing list