diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-07-14 05:04:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-07-14 05:04:10 +0000 |
commit | b50e716bac45a9713144869b01c2850ef8048100 (patch) | |
tree | 0277aa2738596438d54cbe59b51d56264031ae5f /clang/test/SemaCXX/uninitialized.cpp | |
parent | a16436f51e83ba5b55540b96c266c3c6265381cf (diff) | |
download | bcm5719-llvm-b50e716bac45a9713144869b01c2850ef8048100.tar.gz bcm5719-llvm-b50e716bac45a9713144869b01c2850ef8048100.zip |
Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively. This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.
Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for
one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.
It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).
llvm-svn: 160218
Diffstat (limited to 'clang/test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | clang/test/SemaCXX/uninitialized.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp index b15779443d8..e8272362310 100644 --- a/clang/test/SemaCXX/uninitialized.cpp +++ b/clang/test/SemaCXX/uninitialized.cpp @@ -25,7 +25,7 @@ int l = k ? l : l; // expected-warning 2{{variable 'l' is uninitialized when us int m = 1 + (k ? m : m); // expected-warning 2{{variable 'm' is uninitialized when used within its own initialization}} int n = -n; // expected-warning {{variable 'n' is uninitialized when used within its own initialization}} -void test () { +void test_stuff () { int a = a; // no-warning: used to signal intended lack of initialization. int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}} int c = (c + c); // expected-warning {{variable 'c' is uninitialized when used within its own initialization}} |