diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-03-20 01:47:58 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-03-20 01:47:58 +0000 |
commit | 797afe3a4ed475d26786a31ede9ac6a9e790608d (patch) | |
tree | 4f2914b8f20f3294ead7d5335e2af0e2b2aed277 /clang/test/CodeGenCXX/ms-property.cpp | |
parent | cbd498ac10427778a6133b9dc3a78c3a5e9ec6cd (diff) | |
download | bcm5719-llvm-797afe3a4ed475d26786a31ede9ac6a9e790608d.tar.gz bcm5719-llvm-797afe3a4ed475d26786a31ede9ac6a9e790608d.zip |
[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
llvm-svn: 327939
Diffstat (limited to 'clang/test/CodeGenCXX/ms-property.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/ms-property.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/ms-property.cpp b/clang/test/CodeGenCXX/ms-property.cpp index 88a906d5fcd..4f01528dda8 100644 --- a/clang/test/CodeGenCXX/ms-property.cpp +++ b/clang/test/CodeGenCXX/ms-property.cpp @@ -75,11 +75,11 @@ int main(int argc, char **argv) { // CHECK: call void @"??$foo@H@@YAXHH@Z"(i32 %{{.+}}, i32 %{{.+}}) foo(argc, (int)argv[0][0]); // CHECK: [[P2:%.+]] = load %class.St*, %class.St** % - // CHECK: [[T_X:%.+]] = call i32 @"?get_x@Test1@@QEBAHXZ"(%class.Test1* %{{.+}}) // CHECK: [[P1:%.+]] = load %class.S*, %class.S** % // CHECK: [[P1_X_22_33:%.+]] = call i32 @"?GetX@S@@QEAAHHH@Z"(%class.S* [[P1]], i32 22, i32 33) // CHECK: [[CAST:%.+]] = sitofp i32 [[P1_X_22_33]] to double // CHECK: [[ARGC:%.+]] = load i32, i32* % + // CHECK: [[T_X:%.+]] = call i32 @"?get_x@Test1@@QEBAHXZ"(%class.Test1* %{{.+}}) // CHECK: [[CAST2:%.+]] = trunc i32 [[T_X]] to i8 // CHECK: call void @"?PutY@?$St@M@@QEAAXDHN@Z"(%class.St* [[P2]], i8 [[CAST2]], i32 [[ARGC]], double [[CAST]]) p2->y[t.X][argc] = p1->x[22][33]; |