summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjC/arc-ternary-op.m
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2015-04-10 10:13:52 +0000
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2015-04-10 10:13:52 +0000
commit914d1bd47f6252559e110929949d69a7a145881d (patch)
treeee6f946529a950f82dcac4c80668d4e360366db7 /test/CodeGenObjC/arc-ternary-op.m
parent0c6a04ea7e5f057f6a98d5198ce12840f8508c99 (diff)
Remove threshold for inserting lifetime markers for named temporaries
Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC/arc-ternary-op.m')
-rw-r--r--test/CodeGenObjC/arc-ternary-op.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenObjC/arc-ternary-op.m b/test/CodeGenObjC/arc-ternary-op.m
index 3e96e40757..2042c7a2fe 100644
--- a/test/CodeGenObjC/arc-ternary-op.m
+++ b/test/CodeGenObjC/arc-ternary-op.m
@@ -10,6 +10,8 @@ void test0(_Bool cond) {
// CHECK-NEXT: [[RELCOND:%.*]] = alloca i1
// CHECK-NEXT: zext
// CHECK-NEXT: store
+ // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8*
+ // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[XPTR1]])
// CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[COND]]
// CHECK-NEXT: [[T1:%.*]] = trunc i8 [[T0]] to i1
// CHECK-NEXT: store i1 false, i1* [[RELCOND]]
@@ -29,6 +31,8 @@ void test0(_Bool cond) {
// CHECK-NEXT: br label
// CHECK: [[T0:%.*]] = load i8*, i8** [[X]]
// CHECK-NEXT: call void @objc_release(i8* [[T0]]) [[NUW]]
+ // CHECK-NEXT: [[XPTR2:%.*]] = bitcast i8** [[X]] to i8*
+ // CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* [[XPTR2]])
// CHECK-NEXT: ret void
id x = (cond ? 0 : test0_helper());
}
@@ -49,7 +53,11 @@ void test1(int cond) {
// CHECK-NEXT: [[CONDCLEANUPSAVE:%.*]] = alloca i8*
// CHECK-NEXT: [[CONDCLEANUP:%.*]] = alloca i1
// CHECK-NEXT: store i32
+ // CHECK-NEXT: [[STRONGPTR1:%.*]] = bitcast i8** [[STRONG]] to i8*
+ // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[STRONGPTR1]])
// CHECK-NEXT: store i8* null, i8** [[STRONG]]
+ // CHECK-NEXT: [[WEAKPTR1:%.*]] = bitcast i8** [[WEAK]] to i8*
+ // CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* [[WEAKPTR1]])
// CHECK-NEXT: call i8* @objc_initWeak(i8** [[WEAK]], i8* null)
// CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[COND]]
@@ -93,6 +101,10 @@ void test1(int cond) {
// CHECK-NEXT: br label
// CHECK: call void @objc_destroyWeak(i8** [[WEAK]])
+ // CHECK: [[WEAKPTR2:%.*]] = bitcast i8** [[WEAK]] to i8*
+ // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[WEAKPTR2]])
+ // CHECK: [[STRONGPTR2:%.*]] = bitcast i8** [[STRONG]] to i8*
+ // CHECK: call void @llvm.lifetime.end(i64 8, i8* [[STRONGPTR2]])
// CHECK: ret void
}