summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-07-23 02:15:11 +0000
committerJordan Rose <jordan_rose@apple.com>2013-07-23 02:15:11 +0000
commit7b982b30c0f24b8c937dfbcc5317a0e8c0b9bdbc (patch)
tree65ed98665c2e8d3f068fa61077fddd19f6c449e8 /clang/test
parentdb90f65bbe8bb490f9f3dd526af58e2c70aa3c97 (diff)
downloadbcm5719-llvm-7b982b30c0f24b8c937dfbcc5317a0e8c0b9bdbc.tar.gz
bcm5719-llvm-7b982b30c0f24b8c937dfbcc5317a0e8c0b9bdbc.zip
Revert "[analyzer] Add very limited support for temporary destructors"
The analyzer doesn't currently expect CFG blocks with terminators to be empty, but this can happen when generating conditional destructors for a complex logical expression, such as (a && (b || Temp{})). Moreover, the branch conditions for these expressions are not persisted in the state. Even for handling noreturn destructors this needs more work. This reverts r186498. llvm-svn: 186925
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/analyzer-config.c2
-rw-r--r--clang/test/Analysis/analyzer-config.cpp2
-rw-r--r--clang/test/Analysis/dtor.cpp15
-rw-r--r--clang/test/Analysis/temp-obj-dtors-cfg-output.cpp51
4 files changed, 2 insertions, 68 deletions
diff --git a/clang/test/Analysis/analyzer-config.c b/clang/test/Analysis/analyzer-config.c
index c80eb164b99..55b1df9ca8a 100644
--- a/clang/test/Analysis/analyzer-config.c
+++ b/clang/test/Analysis/analyzer-config.c
@@ -6,7 +6,7 @@ void foo() { bar(); }
// CHECK: [config]
// CHECK-NEXT: cfg-conditional-static-initializers = true
-// CHECK-NEXT: cfg-temporary-dtors = true
+// CHECK-NEXT: cfg-temporary-dtors = false
// CHECK-NEXT: faux-bodies = true
// CHECK-NEXT: graph-trim-interval = 1000
// CHECK-NEXT: ipa = dynamic-bifurcate
diff --git a/clang/test/Analysis/analyzer-config.cpp b/clang/test/Analysis/analyzer-config.cpp
index 4160508a382..521344a5119 100644
--- a/clang/test/Analysis/analyzer-config.cpp
+++ b/clang/test/Analysis/analyzer-config.cpp
@@ -17,7 +17,7 @@ public:
// CHECK-NEXT: c++-stdlib-inlining = true
// CHECK-NEXT: c++-template-inlining = true
// CHECK-NEXT: cfg-conditional-static-initializers = true
-// CHECK-NEXT: cfg-temporary-dtors = true
+// CHECK-NEXT: cfg-temporary-dtors = false
// CHECK-NEXT: faux-bodies = true
// CHECK-NEXT: graph-trim-interval = 1000
// CHECK-NEXT: ipa = dynamic-bifurcate
diff --git a/clang/test/Analysis/dtor.cpp b/clang/test/Analysis/dtor.cpp
index 80b31570697..58bdcea6317 100644
--- a/clang/test/Analysis/dtor.cpp
+++ b/clang/test/Analysis/dtor.cpp
@@ -416,19 +416,4 @@ namespace NoReturn {
f(&x);
*x = 47; // no warning
}
-
- void g2(int *x) {
- if (! x) NR();
- *x = 47; // no warning
- }
-
- void f3(int **x) {
- NR();
- }
-
- void g3() {
- int *x;
- f3(&x);
- *x = 47; // no warning
- }
}
diff --git a/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp b/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
index ff68a876e91..1ddccb704b1 100644
--- a/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
+++ b/clang/test/Analysis/temp-obj-dtors-cfg-output.cpp
@@ -108,24 +108,6 @@ TestCtorInits::TestCtorInits()
: a(int(A()) + int(B()))
, b() {}
-class NoReturn {
-public:
- ~NoReturn() __attribute__((noreturn));
- void f();
-};
-
-void test_noreturn1() {
- int a;
- NoReturn().f();
- int b;
-}
-
-void test_noreturn2() {
- int a;
- NoReturn(), 47;
- int b;
-}
-
// CHECK: [B1 (ENTRY)]
// CHECK: Succs (1): B0
// CHECK: [B0 (EXIT)]
@@ -864,36 +846,3 @@ void test_noreturn2() {
// CHECK: [B0 (EXIT)]
// CHECK: Preds (1): B1
-// CHECK: [B3 (ENTRY)]
-// CHECK: Succs (1): B2
-// CHECK: [B1]
-// CHECK: 1: int b;
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: int a;
-// CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
-// CHECK: 3: [B2.2] (BindTemporary)
-// CHECK: 4: [B2.3].f
-// CHECK: 5: [B2.4]()
-// CHECK: 6: ~NoReturn() (Temporary object destructor)
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B2
-
-// CHECK: [B3 (ENTRY)]
-// CHECK: Succs (1): B2
-// CHECK: [B1]
-// CHECK: 1: int b;
-// CHECK: Succs (1): B0
-// CHECK: [B2]
-// CHECK: 1: int a;
-// CHECK: 2: NoReturn() (CXXConstructExpr, class NoReturn)
-// CHECK: 3: [B2.2] (BindTemporary)
-// CHECK: 4: 47
-// CHECK: 5: ... , [B2.4]
-// CHECK: 6: ~NoReturn() (Temporary object destructor)
-// CHECK: Preds (1): B3
-// CHECK: Succs (1): B0
-// CHECK: [B0 (EXIT)]
-// CHECK: Preds (2): B1 B2
OpenPOWER on IntegriCloud