From 1860b520a2327702e1b50455c87882879eb777d3 Mon Sep 17 00:00:00 2001 From: "Ivan A. Kosarev" Date: Thu, 25 Jan 2018 14:21:55 +0000 Subject: [CodeGen] Decorate aggregate accesses with TBAA tags Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421 --- clang/lib/CodeGen/CGStmtOpenMP.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp') diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index cdf46f04207..fb919d7b028 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -692,7 +692,9 @@ void CodeGenFunction::EmitOMPCopy(QualType OriginalType, Address DestAddr, auto *BO = dyn_cast(Copy); if (BO && BO->getOpcode() == BO_Assign) { // Perform simple memcpy for simple copying. - EmitAggregateAssign(DestAddr, SrcAddr, OriginalType); + LValue Dest = MakeAddrLValue(DestAddr, OriginalType); + LValue Src = MakeAddrLValue(SrcAddr, OriginalType); + EmitAggregateAssign(Dest, Src, OriginalType); } else { // For arrays with complex element types perform element by element // copying. @@ -765,7 +767,8 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D, DeclRefExpr DRE(const_cast(OrigVD), /*RefersToEnclosingVariableOrCapture=*/FD != nullptr, (*IRef)->getType(), VK_LValue, (*IRef)->getExprLoc()); - Address OriginalAddr = EmitLValue(&DRE).getAddress(); + LValue OriginalLVal = EmitLValue(&DRE); + Address OriginalAddr = OriginalLVal.getAddress(); QualType Type = VD->getType(); if (Type->isArrayType()) { // Emit VarDecl with copy init for arrays. @@ -776,8 +779,9 @@ bool CodeGenFunction::EmitOMPFirstprivateClause(const OMPExecutableDirective &D, auto *Init = VD->getInit(); if (!isa(Init) || isTrivialInitializer(Init)) { // Perform simple memcpy. - EmitAggregateAssign(Emission.getAllocatedAddress(), OriginalAddr, - Type); + LValue Dest = MakeAddrLValue(Emission.getAllocatedAddress(), + Type); + EmitAggregateAssign(Dest, OriginalLVal, Type); } else { EmitOMPAggregateAssign( Emission.getAllocatedAddress(), OriginalAddr, Type, -- cgit v1.2.3