summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjCXX/arc-exceptions.mm
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-10-17 02:28:37 +0000
committerJohn McCall <rjmccall@apple.com>2012-10-17 02:28:37 +0000
commite68b8f4dcc2b3a6ab03326ad4167f1164cae61e4 (patch)
tree52ff6180b7eaa5d763de780d9a521ae5b60d631c /clang/test/CodeGenObjCXX/arc-exceptions.mm
parent6f7206132fa567268b561608268639db5edafdcb (diff)
downloadbcm5719-llvm-e68b8f4dcc2b3a6ab03326ad4167f1164cae61e4.tar.gz
bcm5719-llvm-e68b8f4dcc2b3a6ab03326ad4167f1164cae61e4.zip
At -O0, prefer objc_storeStrong with a null new value to the
combination of a load+objc_release; this is generally better for tools that try to track why values are retained and released. Also use objc_storeStrong when copying a block (again, only at -O0), which requires us to do a preliminary store of null in order to compensate for objc_storeStrong's assign semantics. llvm-svn: 166085
Diffstat (limited to 'clang/test/CodeGenObjCXX/arc-exceptions.mm')
-rw-r--r--clang/test/CodeGenObjCXX/arc-exceptions.mm10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/test/CodeGenObjCXX/arc-exceptions.mm b/clang/test/CodeGenObjCXX/arc-exceptions.mm
index b1fa8ca2403..fb5300d15e4 100644
--- a/clang/test/CodeGenObjCXX/arc-exceptions.mm
+++ b/clang/test/CodeGenObjCXX/arc-exceptions.mm
@@ -20,9 +20,8 @@ void test0(void) {
// CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retain(i8* [[T2]]) nounwind
// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[ETY]]*
// CHECK-NEXT: store [[ETY]]* [[T4]], [[ETY]]** [[E]]
-// CHECK-NEXT: [[T0:%.*]] = load [[ETY]]** [[E]]
-// CHECK-NEXT: [[T1:%.*]] = bitcast [[ETY]]* [[T0]] to i8*
-// CHECK-NEXT: call void @objc_release(i8* [[T1]]) nounwind
+// CHECK-NEXT: [[T0:%.*]] = bitcast [[ETY]]** [[E]] to i8**
+// CHECK-NEXT: call void @objc_storeStrong(i8** [[T0]], i8* null) nounwind
// CHECK-NEXT: call void @objc_end_catch() nounwind
void test1_helper(void);
@@ -60,9 +59,8 @@ void test2(void) {
// CHECK-NEXT: [[T3:%.*]] = call i8* @objc_retain(i8* [[T2]]) nounwind
// CHECK-NEXT: [[T4:%.*]] = bitcast i8* [[T3]] to [[ETY]]*
// CHECK-NEXT: store [[ETY]]* [[T4]], [[ETY]]** [[E]]
-// CHECK-NEXT: [[T0:%.*]] = load [[ETY]]** [[E]]
-// CHECK-NEXT: [[T1:%.*]] = bitcast [[ETY]]* [[T0]] to i8*
-// CHECK-NEXT: call void @objc_release(i8* [[T1]]) nounwind
+// CHECK-NEXT: [[T0:%.*]] = bitcast [[ETY]]** [[E]] to i8**
+// CHECK-NEXT: call void @objc_storeStrong(i8** [[T0]], i8* null) nounwind
// CHECK-NEXT: call void @__cxa_end_catch() nounwind
void test3_helper(void);
OpenPOWER on IntegriCloud