[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-07 Thread Nick Desaulniers via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3a604fdbcd5f: [Clang][CFG] check children statements of asm 
goto (authored by nickdesaulniers).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp
  clang/test/Analysis/uninit-asm-goto.cpp
  clang/test/Sema/array-bounds-ptr-arith.c

Index: clang/test/Sema/array-bounds-ptr-arith.c
===
--- clang/test/Sema/array-bounds-ptr-arith.c
+++ clang/test/Sema/array-bounds-ptr-arith.c
@@ -37,3 +37,15 @@
   RDar11387038_B *pRDar11387038_B;
   struct RDar11387038* y = &(*pRDar11387038_B->x)->z[4];
 }
+
+void pr51682 (void) {
+  int arr [1];
+  switch (0) {
+case 0:
+  break;
+case 1:
+  asm goto (""::"r"(arr[42] >> 1)::failed); // no-warning
+  break;
+  }
+failed:;
+}
Index: clang/test/Analysis/uninit-asm-goto.cpp
===
--- clang/test/Analysis/uninit-asm-goto.cpp
+++ clang/test/Analysis/uninit-asm-goto.cpp
@@ -3,19 +3,19 @@
 // test1: Expect no diagnostics
 int test1(int x) {
 int y;
-asm goto("nop" : "=r"(y) : "r"(x) : : err);
+asm goto("" : "=r"(y) : "r"(x) : : err);
 return y;
   err:
 return -1;
 }
 
 int test2(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
   if (x < 42)
-asm volatile goto("testl %0, %0; testl %1, %2; jne %l3" : "+S"(x), "+D"(y) : "r"(x) :: indirect_1, indirect_2);
+asm goto("" : "+S"(x), "+D"(y) : "r"(x) :: indirect_1, indirect_2);
   else
-asm volatile goto("testl %0, %1; testl %2, %3; jne %l5" : "+S"(x), "+D"(y) : "r"(x), "r"(y) :: indirect_1, indirect_2);
+asm goto("" : "+S"(x), "+D"(y) : "r"(x), "r"(y) :: indirect_1, indirect_2);
   return x + y;
 indirect_1:
   return -42;
@@ -24,9 +24,9 @@
 }
 
 int test3(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
-  asm goto("xorl %1, %0; jmp %l2" : "="(y) : "r"(x) : : fail);
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
+  asm goto("" : "="(y) : "r"(x) : : fail);
 normal:
   y += x;
   return y;
@@ -38,20 +38,20 @@
 }
 
 int test4(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
   goto forward;
 backward:
   return y; // expected-note {{uninitialized use occurs here}}
 forward:
-  asm goto("# %0 %1 %2" : "=r"(y) : "r"(x) : : backward);
+  asm goto("" : "=r"(y) : "r"(x) : : backward);
   return y;
 }
 
 // test5: Expect no diagnostics
 int test5(int x) {
   int y;
-  asm volatile goto("testl %0, %0; testl %1, %2; jne %l3" : "+S"(x), "+D"(y) : "r"(x) :: indirect, fallthrough);
+  asm goto("" : "+S"(x), "+D"(y) : "r"(x) :: indirect, fallthrough);
 fallthrough:
   return y;
 indirect:
@@ -63,9 +63,30 @@
   unsigned int val;
 
   // See through casts and unary operators.
-  asm goto("nop" : "=r" (*(unsigned int *)()) ::: indirect);
+  asm goto("" : "=r" (*(unsigned int *)()) ::: indirect);
   *x = val;
   return 0;
 indirect:
   return -1;
 }
+
+int test7(int z) {
+int x; // expected-warning {{variable 'x' is used uninitialized whenever its declaration is reached}}
+   // expected-note@-1 {{initialize the variable 'x' to silence this warning}}
+if (z)
+  asm goto ("":"=r"(x):::A1,A2);
+return 0;
+A1:
+A2:
+return x; // expected-note {{uninitialized use occurs here}}
+}
+
+int test8() {
+int x = 0; // expected-warning {{variable 'x' is used uninitialized whenever its declaration is reached}}
+   // expected-note@-1 {{variable 'x' is declared here}}
+asm goto ("":"=r"(x):::A1,A2);
+return 0;
+A1:
+A2:
+return x; // expected-note {{uninitialized use occurs here}}
+}
Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | 

[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-07 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 accepted this revision.
jyu2 added a comment.

Looks good to me.  Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-07 Thread Nathan Chancellor via Phabricator via cfe-commits
nathanchance added a comment.

The two false positive warnings in the kernel are fixed with this patch and 
there were no new warnings introduced.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked an inline comment as done.
nickdesaulniers added inline comments.



Comment at: clang/test/Analysis/uninit-asm-goto.cpp:84
+
+int test8() {
+int x = 0; // expected-warning {{variable 'x' is used uninitialized 
whenever its declaration is reached}}

efriedma wrote:
> Looks like this patch fixes the false negative on test8; that's good.
> 
> It looks like there's a issue with the printed diagnostic on a bunch of these 
> tests; we say the variable is used uninitialized "whenever its declaration is 
> reached", which isn't right.  We can probably leave that for a followup; this 
> is clearly an improvement.  But please file a bug.
https://github.com/llvm/llvm-project/issues/53060


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision.
efriedma added a comment.

LGTM




Comment at: clang/test/Analysis/uninit-asm-goto.cpp:84
+
+int test8() {
+int x = 0; // expected-warning {{variable 'x' is used uninitialized 
whenever its declaration is reached}}

Looks like this patch fixes the false negative on test8; that's good.

It looks like there's a issue with the printed diagnostic on a bunch of these 
tests; we say the variable is used uninitialized "whenever its declaration is 
reached", which isn't right.  We can probably leave that for a followup; this 
is clearly an improvement.  But please file a bug.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 397983.
nickdesaulniers added a comment.
This revision is now accepted and ready to land.

- MOAR TESTS RAWR!!1one


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp
  clang/test/Analysis/uninit-asm-goto.cpp
  clang/test/Sema/array-bounds-ptr-arith.c

Index: clang/test/Sema/array-bounds-ptr-arith.c
===
--- clang/test/Sema/array-bounds-ptr-arith.c
+++ clang/test/Sema/array-bounds-ptr-arith.c
@@ -37,3 +37,15 @@
   RDar11387038_B *pRDar11387038_B;
   struct RDar11387038* y = &(*pRDar11387038_B->x)->z[4];
 }
+
+void pr51682 (void) {
+  int arr [1];
+  switch (0) {
+case 0:
+  break;
+case 1:
+  asm goto (""::"r"(arr[42] >> 1)::failed); // no-warning
+  break;
+  }
+failed:;
+}
Index: clang/test/Analysis/uninit-asm-goto.cpp
===
--- clang/test/Analysis/uninit-asm-goto.cpp
+++ clang/test/Analysis/uninit-asm-goto.cpp
@@ -3,19 +3,19 @@
 // test1: Expect no diagnostics
 int test1(int x) {
 int y;
-asm goto("nop" : "=r"(y) : "r"(x) : : err);
+asm goto("" : "=r"(y) : "r"(x) : : err);
 return y;
   err:
 return -1;
 }
 
 int test2(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
   if (x < 42)
-asm volatile goto("testl %0, %0; testl %1, %2; jne %l3" : "+S"(x), "+D"(y) : "r"(x) :: indirect_1, indirect_2);
+asm goto("" : "+S"(x), "+D"(y) : "r"(x) :: indirect_1, indirect_2);
   else
-asm volatile goto("testl %0, %1; testl %2, %3; jne %l5" : "+S"(x), "+D"(y) : "r"(x), "r"(y) :: indirect_1, indirect_2);
+asm goto("" : "+S"(x), "+D"(y) : "r"(x), "r"(y) :: indirect_1, indirect_2);
   return x + y;
 indirect_1:
   return -42;
@@ -24,9 +24,9 @@
 }
 
 int test3(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
-  asm goto("xorl %1, %0; jmp %l2" : "="(y) : "r"(x) : : fail);
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
+  asm goto("" : "="(y) : "r"(x) : : fail);
 normal:
   y += x;
   return y;
@@ -38,20 +38,20 @@
 }
 
 int test4(int x) {
-  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}} \
- // expected-note {{initialize the variable}}
+  int y; // expected-warning {{variable 'y' is used uninitialized whenever its declaration is reached}}
+ // expected-note@-1 {{initialize the variable}}
   goto forward;
 backward:
   return y; // expected-note {{uninitialized use occurs here}}
 forward:
-  asm goto("# %0 %1 %2" : "=r"(y) : "r"(x) : : backward);
+  asm goto("" : "=r"(y) : "r"(x) : : backward);
   return y;
 }
 
 // test5: Expect no diagnostics
 int test5(int x) {
   int y;
-  asm volatile goto("testl %0, %0; testl %1, %2; jne %l3" : "+S"(x), "+D"(y) : "r"(x) :: indirect, fallthrough);
+  asm goto("" : "+S"(x), "+D"(y) : "r"(x) :: indirect, fallthrough);
 fallthrough:
   return y;
 indirect:
@@ -63,9 +63,30 @@
   unsigned int val;
 
   // See through casts and unary operators.
-  asm goto("nop" : "=r" (*(unsigned int *)()) ::: indirect);
+  asm goto("" : "=r" (*(unsigned int *)()) ::: indirect);
   *x = val;
   return 0;
 indirect:
   return -1;
 }
+
+int test7(int z) {
+int x; // expected-warning {{variable 'x' is used uninitialized whenever its declaration is reached}}
+   // expected-note@-1 {{initialize the variable 'x' to silence this warning}}
+if (z)
+  asm goto ("":"=r"(x):::A1,A2);
+return 0;
+A1:
+A2:
+return x; // expected-note {{uninitialized use occurs here}}
+}
+
+int test8() {
+int x = 0; // expected-warning {{variable 'x' is used uninitialized whenever its declaration is reached}}
+   // expected-note@-1 {{variable 'x' is declared here}}
+asm goto ("":"=r"(x):::A1,A2);
+return 0;
+A1:
+A2:
+return x; // expected-note {{uninitialized use occurs here}}
+}
Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu 

[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers planned changes to this revision.
nickdesaulniers added a comment.

will add more tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 397965.
nickdesaulniers added a comment.
This revision is now accepted and ready to land.

- add previously red -Warray-bounds test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp
  clang/test/Sema/array-bounds-ptr-arith.c

Index: clang/test/Sema/array-bounds-ptr-arith.c
===
--- clang/test/Sema/array-bounds-ptr-arith.c
+++ clang/test/Sema/array-bounds-ptr-arith.c
@@ -37,3 +37,15 @@
   RDar11387038_B *pRDar11387038_B;
   struct RDar11387038* y = &(*pRDar11387038_B->x)->z[4];
 }
+
+void pr51682 (void) {
+  int arr [1];
+  switch (0) {
+case 0:
+  break;
+case 1:
+  asm goto (""::"r"(arr[42] >> 1)::failed); // no-warning
+  break;
+  }
+failed:;
+}
Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,12 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +33,9 @@
 }
 
 // CHECK: [B4]
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +51,20 @@
 }
 
 // CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? [B3.1] : [B4.4]
+// CHECK-NEXT: T: asm goto ("" :  : "r" ([B2.1]) :  : error);
+// CHECK-NEXT: Preds (2): B3 B4
+// CHECK-NEXT: Succs (1): B1
Index: clang/lib/Analysis/UninitializedValues.cpp
===
--- clang/lib/Analysis/UninitializedValues.cpp
+++ clang/lib/Analysis/UninitializedValues.cpp
@@ -819,12 +819,11 @@
 while (const auto *UO = dyn_cast(Ex))
   Ex = stripCasts(C, UO->getSubExpr());
 
+// Mark the variable as potentially uninitialized for those cases where
+// it's used on an indirect path, where it's not guaranteed to be
+// defined.
 if (const VarDecl *VD = findVar(Ex).getDecl())
-  if (vals[VD] != Initialized)
-// If the variable isn't initialized by the time we get here, then we
-// mark it as potentially uninitialized for those cases where it's used
-// on an indirect path, where it's not guaranteed to be defined.
-vals[VD] = MayUninitialized;
+  vals[VD] = MayUninitialized;
   }
 }
 
Index: clang/lib/Analysis/CFG.cpp
===
--- clang/lib/Analysis/CFG.cpp
+++ clang/lib/Analysis/CFG.cpp
@@ -3354,7 +3354,7 @@
   // Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
   // used to avoid adding "Succ" again.
   BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
-  return Block;
+  return VisitChildren(G);
 }
 
 CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

Yes, messed up the warning flag.

Did some brief experiments on trunk; I'd like to see the following two 
testcases as regression tests:

  int a(int z) {
  int x;
  if (z)
asm goto ("":"=r"(x):::A1,A2);
  return 0;
  A1:
  A2:
  return x; // expected warning: conditional use of uninitialized var
  }
  
  int b() {
  int x = 0;
  asm goto ("":"=r"(x):::A1,A2);
  return 0;
  A1:
  A2:
  return x; // expected warning: use of uninitialized variable
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment.

In D116059#3225862 , @efriedma wrote:

> Do we have testcases for how -Wuninitialized/-Wmaybe-uninitialized interact 
> with asm goto?

We have tests for `-Wuninitialized`; clang/test/Analysis/uninit-asm-goto.cpp 
(D71314 ).

Clang doesn't implement `-Wmaybe-unitialized`; perhaps you're thinking of 
`-Wsometimes-unitialized`?

clang/test/Analysis/uninit-sometimes.cpp does not contain any `asm goto` tests 
(for `-Wsometimes-unitialized`).

> If not, can you add them?

`-Wsometimes-unitialized` is part of the diag group for `-Wunitialized`. Adding 
another `RUN` line to clang/test/Analysis/uninit-asm-goto.cpp that tests 
`-Wsometimes-unitialized` rather than `-Wunitialized` produces the same result, 
so unless there's a different case you can think of, I don't see testing 
`-Wsometimes-unitialized` w/ `asm goto` as improving our test coverage at all.

> Also, an explicit test for -Warray-bounds or whatever would be nice, although 
> I guess the CFG tests sort of cover that.

Sure, I can add one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

Do we have testcases for how -Wuninitialized/-Wmaybe-uninitialized interact 
with asm goto?  If not, can you add them?

Also, an explicit test for -Warray-bounds or whatever would be nice, although I 
guess the CFG tests sort of cover that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2022-01-05 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 397728.
nickdesaulniers added a comment.

- don't bother checking if a Val is Initialized


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp


Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,12 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +33,9 @@
 }
 
 // CHECK: [B4]
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +51,20 @@
 }
 
 // CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? [B3.1] : [B4.4]
+// CHECK-NEXT: T: asm goto ("" :  : "r" ([B2.1]) :  : error);
+// CHECK-NEXT: Preds (2): B3 B4
+// CHECK-NEXT: Succs (1): B1
Index: clang/lib/Analysis/UninitializedValues.cpp
===
--- clang/lib/Analysis/UninitializedValues.cpp
+++ clang/lib/Analysis/UninitializedValues.cpp
@@ -819,12 +819,11 @@
 while (const auto *UO = dyn_cast(Ex))
   Ex = stripCasts(C, UO->getSubExpr());
 
+// Mark the variable as potentially uninitialized for those cases where
+// it's used on an indirect path, where it's not guaranteed to be
+// defined.
 if (const VarDecl *VD = findVar(Ex).getDecl())
-  if (vals[VD] != Initialized)
-// If the variable isn't initialized by the time we get here, then we
-// mark it as potentially uninitialized for those cases where it's used
-// on an indirect path, where it's not guaranteed to be defined.
-vals[VD] = MayUninitialized;
+  vals[VD] = MayUninitialized;
   }
 }
 
Index: clang/lib/Analysis/CFG.cpp
===
--- clang/lib/Analysis/CFG.cpp
+++ clang/lib/Analysis/CFG.cpp
@@ -3354,7 +3354,7 @@
   // Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
   // used to avoid adding "Succ" again.
   BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
-  return Block;
+  return VisitChildren(G);
 }
 
 CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {


Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,12 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +33,9 @@
 }
 
 // CHECK: [B4]
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +51,20 @@
 }
 
 // CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? [B3.1] : 

[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-21 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments.



Comment at: clang/lib/Analysis/UninitializedValues.cpp:826
+// it as potentially uninitialized for those cases where it's used on
+// an indirect path, where it's not guaranteed to be defined.
 vals[VD] = MayUninitialized;

nickdesaulniers wrote:
> efriedma wrote:
> > The old and the new code here seem to be doing very different things.  It 
> > isn't clear why.
> > 
> > Actually, I'm not sure why we're checking whether the variable is 
> > initialized.  Whether the variable is initialized going into the inline asm 
> > isn't really related to whether it's initialized when we exit the inline 
> > asm.  For register outputs, the output isn't even in the same register as 
> > the old value of the variable.
> I suspect we're now eagerly marking variables initialized by visiting the 
> child nodes, which we weren't doing previously.
> 
> See also: https://reviews.llvm.org/D71314.
I'm very confused as well. You're basically going from a strong statement - 
(This variable is initialized) - to a weaker statement - (This variable may be 
uninitialized). That doesn't make a lot of sense to me. Could you explain it 
better in the comment?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments.



Comment at: clang/lib/Analysis/UninitializedValues.cpp:826
+// it as potentially uninitialized for those cases where it's used on
+// an indirect path, where it's not guaranteed to be defined.
 vals[VD] = MayUninitialized;

efriedma wrote:
> The old and the new code here seem to be doing very different things.  It 
> isn't clear why.
> 
> Actually, I'm not sure why we're checking whether the variable is 
> initialized.  Whether the variable is initialized going into the inline asm 
> isn't really related to whether it's initialized when we exit the inline asm. 
>  For register outputs, the output isn't even in the same register as the old 
> value of the variable.
I suspect we're now eagerly marking variables initialized by visiting the child 
nodes, which we weren't doing previously.

See also: https://reviews.llvm.org/D71314.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-20 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments.



Comment at: clang/lib/Analysis/UninitializedValues.cpp:826
+// it as potentially uninitialized for those cases where it's used on
+// an indirect path, where it's not guaranteed to be defined.
 vals[VD] = MayUninitialized;

The old and the new code here seem to be doing very different things.  It isn't 
clear why.

Actually, I'm not sure why we're checking whether the variable is initialized.  
Whether the variable is initialized going into the inline asm isn't really 
related to whether it's initialized when we exit the inline asm.  For register 
outputs, the output isn't even in the same register as the old value of the 
variable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 395539.
nickdesaulniers added a comment.

- VisitChildren rather than VisitStmt


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp


Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu 
-analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,12 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +33,9 @@
 }
 
 // CHECK: [B4]
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +51,20 @@
 }
 
 // CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? [B3.1] : [B4.4]
+// CHECK-NEXT: T: asm goto ("" :  : "r" ([B2.1]) :  : error);
+// CHECK-NEXT: Preds (2): B3 B4
+// CHECK-NEXT: Succs (1): B1
Index: clang/lib/Analysis/UninitializedValues.cpp
===
--- clang/lib/Analysis/UninitializedValues.cpp
+++ clang/lib/Analysis/UninitializedValues.cpp
@@ -820,10 +820,10 @@
   Ex = stripCasts(C, UO->getSubExpr());
 
 if (const VarDecl *VD = findVar(Ex).getDecl())
-  if (vals[VD] != Initialized)
-// If the variable isn't initialized by the time we get here, then we
-// mark it as potentially uninitialized for those cases where it's used
-// on an indirect path, where it's not guaranteed to be defined.
+  if (vals[VD] == Initialized)
+// If the variable is initialized by the time we get here, then we mark
+// it as potentially uninitialized for those cases where it's used on
+// an indirect path, where it's not guaranteed to be defined.
 vals[VD] = MayUninitialized;
   }
 }
Index: clang/lib/Analysis/CFG.cpp
===
--- clang/lib/Analysis/CFG.cpp
+++ clang/lib/Analysis/CFG.cpp
@@ -3356,7 +3356,7 @@
   // Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
   // used to avoid adding "Succ" again.
   BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
-  return Block;
+  return VisitChildren(G);
 }
 
 CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {


Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,12 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +33,9 @@
 }
 
 // CHECK: [B4]
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +51,20 @@
 }
 
 // CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
+// CHECK-NEXT: T: asm goto
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? 

[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers planned changes to this revision.
nickdesaulniers added inline comments.



Comment at: clang/lib/Analysis/CFG.cpp:3359
+
+  return VisitStmt(G, asc);
 }

I think this should actually be `return VisitChildren(G);`; it produces a 
simpler CFG with the `asm goto` Node marked as the terminator directly. Will 
update this and the test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116059/new/

https://reviews.llvm.org/D116059

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116059: [Clang][CFG] check children statements of asm goto

2021-12-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision.
nickdesaulniers added reviewers: void, jyknight, jyu2, efriedma.
nickdesaulniers requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When performing CFG based analyses, don't forget to check the child
statements of an asm goto, such as the expressions used for
inputs+outputs.

Fixes: https://github.com/llvm/llvm-project/issues/51024
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1439


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116059

Files:
  clang/lib/Analysis/CFG.cpp
  clang/lib/Analysis/UninitializedValues.cpp
  clang/test/Analysis/asm-goto.cpp

Index: clang/test/Analysis/asm-goto.cpp
===
--- clang/test/Analysis/asm-goto.cpp
+++ clang/test/Analysis/asm-goto.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1  -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-// RUN: %clang_analyze_cc1  -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
+// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
 
 int foo(int cond)
 {
@@ -17,11 +17,13 @@
 // CHECK-NEXT: Succs (1): B0
 
 // CHECK-LABEL: label_true
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B3.1]
 // CHECK-NEXT: asm goto
+// CHECK-NEXT: T: [B3.3]
 // CHECK-NEXT: Preds (2): B3 B4
 // CHECK-NEXT: Succs (3): B2 B3 B1
 
-
 int bar(int cond)
 {
   asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
@@ -32,7 +34,10 @@
 }
 
 // CHECK: [B4]
+// CHECK-NEXT: cond
+// CHECK-NEXT: [B4.1]
 // CHECK-NEXT: asm goto
+// CHECK-NEXT: T: [B4.3]
 // CHECK-NEXT: Preds (1): B5
 // CHECK-NEXT: Succs (3): B3 B2 B1
 
@@ -48,6 +53,22 @@
 }
 
 // CHECK-LABEL: A1
+// CHECK-NEXT: n
+// CHECK-NEXT: [B4.1]
 // CHECK-NEXT: asm goto
+// CHECK-NEXT: T: [B4.3]
 // CHECK-NEXT: Preds (2): B5 B4
 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
+
+void baz(void)
+{
+  asm goto("" :: "r"(1 ? 2 : 0 << -1) :: error);
+error:;
+}
+
+// CHECK: [B2]
+// CHECK-NEXT: 1: [B5.2] ? [B3.1] : [B4.4]
+// CHECK-NEXT: 2: asm goto ("" :  : "r" ([B2.1]) :  : error);
+// CHECK-NEXT: T: [B2.2]
+// CHECK-NEXT: Preds (2): B3 B4
+// CHECK-NEXT: Succs (1): B1
Index: clang/lib/Analysis/UninitializedValues.cpp
===
--- clang/lib/Analysis/UninitializedValues.cpp
+++ clang/lib/Analysis/UninitializedValues.cpp
@@ -820,10 +820,10 @@
   Ex = stripCasts(C, UO->getSubExpr());
 
 if (const VarDecl *VD = findVar(Ex).getDecl())
-  if (vals[VD] != Initialized)
-// If the variable isn't initialized by the time we get here, then we
-// mark it as potentially uninitialized for those cases where it's used
-// on an indirect path, where it's not guaranteed to be defined.
+  if (vals[VD] == Initialized)
+// If the variable is initialized by the time we get here, then we mark
+// it as potentially uninitialized for those cases where it's used on
+// an indirect path, where it's not guaranteed to be defined.
 vals[VD] = MayUninitialized;
   }
 }
Index: clang/lib/Analysis/CFG.cpp
===
--- clang/lib/Analysis/CFG.cpp
+++ clang/lib/Analysis/CFG.cpp
@@ -3340,23 +3340,23 @@
 CFGBlock *CFGBuilder::VisitGCCAsmStmt(GCCAsmStmt *G, AddStmtChoice asc) {
   // Goto is a control-flow statement.  Thus we stop processing the current
   // block and create a new one.
+  if (G->isAsmGoto()) {
+if (Block) {
+  Succ = Block;
+  if (badCFG)
+return nullptr;
+}
 
-  if (!G->isAsmGoto())
-return VisitStmt(G, asc);
-
-  if (Block) {
-Succ = Block;
-if (badCFG)
-  return nullptr;
+Block = createBlock();
+Block->setTerminator(G);
+// We will backpatch this block later for all the labels.
+BackpatchBlocks.push_back(JumpSource(Block, ScopePos));
+// Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
+// used to avoid adding "Succ" again.
+BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
   }
-  Block = createBlock();
-  Block->setTerminator(G);
-  // We will backpatch this block later for all the labels.
-  BackpatchBlocks.push_back(JumpSource(Block, ScopePos));
-  // Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
-  // used to avoid adding "Succ" again.
-  BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
-  return Block;
+
+  return VisitStmt(G, asc);
 }
 
 CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits