summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorIvan A. Kosarev <ikosarev@accesssoftek.com>2018-01-25 14:21:55 +0000
committerIvan A. Kosarev <ikosarev@accesssoftek.com>2018-01-25 14:21:55 +0000
commit1860b520a2327702e1b50455c87882879eb777d3 (patch)
tree7e232f614a5d8208872ccbdcc452be4855faecd8 /clang/lib/CodeGen/CGStmtOpenMP.cpp
parent929697bd55fdf384880cd6b15b3f276875085a1c (diff)
downloadbcm5719-llvm-1860b520a2327702e1b50455c87882879eb777d3.tar.gz
bcm5719-llvm-1860b520a2327702e1b50455c87882879eb777d3.zip
[CodeGen] Decorate aggregate accesses with TBAA tags
Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp12
1 files changed, 8 insertions, 4 deletions
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<BinaryOperator>(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<VarDecl *>(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<CXXConstructExpr>(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,
OpenPOWER on IntegriCloud