aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/property-objects.mm
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2018-03-20 01:47:58 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2018-03-20 01:47:58 +0000
commit3797638dfd454c47eb4b1fea5a44c8c96d4ce442 (patch)
tree4273481e5055fe8b76c9a24b3b1748e76233427a /test/CodeGenObjCXX/property-objects.mm
parent1e4ad8ec340cc0b252fe7fad89906ec1452a7ff7 (diff)
[CodeGen] Ignore OpaqueValueExprs that are unique references to their
source expressions when iterating over a PseudoObjectExpr's semantic subexpression list. Previously the loop in emitPseudoObjectExpr would emit the IR for each OpaqueValueExpr that was in a PseudoObjectExpr's semantic-form expression list and use the result when the OpaqueValueExpr later appeared in other expressions. This caused an assertion failure when AggExprEmitter tried to copy the result of an OpaqueValueExpr and the copied type didn't have trivial copy/move constructors or assignment operators. This patch adds flag IsUnique to OpaqueValueExpr which indicates it is a unique reference to its source expression (it is not used in multiple places). The loop in emitPseudoObjectExpr ignores OpaqueValueExprs that are unique and CodeGen visitors simply traverse the source expressions of such OpaqueValueExprs. rdar://problem/34363596 Differential Revision: https://reviews.llvm.org/D39562 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjCXX/property-objects.mm')
-rw-r--r--test/CodeGenObjCXX/property-objects.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/CodeGenObjCXX/property-objects.mm b/test/CodeGenObjCXX/property-objects.mm
index 8e0b6aebe1..62188e8bb2 100644
--- a/test/CodeGenObjCXX/property-objects.mm
+++ b/test/CodeGenObjCXX/property-objects.mm
@@ -119,11 +119,11 @@ void testB1(B *b) {
// CHECK: define void @_Z6testB0P1B([[B:%.*]]*
// CHECK: [[BVAR:%.*]] = alloca [[B]]*, align 8
// CHECK: [[TEMP:%.*]] = alloca [[B0:%.*]], align 8
-// CHECK: load [[B]]*, [[B]]** [[BVAR]]
-// CHECK-NEXT: [[X:%.*]] = getelementptr inbounds [[B0]], [[B0]]* [[TEMP]], i32 0, i32 0
+// CHECK: [[X:%.*]] = getelementptr inbounds [[B0]], [[B0]]* [[TEMP]], i32 0, i32 0
// CHECK-NEXT: [[T0:%.*]] = call i32 @_Z9b_makeIntv()
// CHECK-NEXT: [[T1:%.*]] = sext i32 [[T0]] to i64
// CHECK-NEXT: store i64 [[T1]], i64* [[X]], align 8
+// CHECK: load [[B]]*, [[B]]** [[BVAR]]
// CHECK-NOT: call
// CHECK: call void @llvm.memcpy
// CHECK-NOT: call
@@ -161,12 +161,12 @@ void testB2(B *b) {
// CHECK: define void @_Z6testB2P1B([[B]]*
// CHECK: [[BVAR:%.*]] = alloca [[B]]*, align 8
-// CHECK: load [[B]]*, [[B]]** [[BVAR]]
-// CHECK-NOT: call
+// CHECK: call void @llvm.dbg.declare(
// CHECK: call void @_ZN2B3C1Ev(
// CHECK-NEXT: [[T0:%.*]] = call i64 @_ZN2B3cv2B1Ev(
// CHECK-NOT: call
// CHECK: store i64 [[T0]],
+// CHECK: load [[B]]*, [[B]]** [[BVAR]]
// CHECK-NOT: call
// CHECK: call void @llvm.memcpy
// CHECK-NOT: call