diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-22 21:17:12 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-22 21:17:12 +0000 |
commit | 790462cc37eb4ee9424408ca56a74bca9b3ef693 (patch) | |
tree | d75ecf941e7e23a1c07385e4904e73a5db387c81 /lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | 53e9d7970557c6b1e6924cc30eb3bcf317aa8861 (diff) |
Diffstat (limited to 'lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r-- | lib/CodeGen/CGOpenMPRuntime.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index 3b97ba2469ae..015a7396ffbe 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -3548,14 +3548,16 @@ void CGOpenMPRuntime::emitReduction(CodeGenFunction &CGF, SourceLocation Loc, E = CGF.EmitAnyExpr(EExpr); CGF.EmitOMPAtomicSimpleUpdateExpr( X, E, BO, /*IsXLHSInRHSPart=*/true, llvm::Monotonic, Loc, - [&CGF, UpExpr, VD, IPriv](RValue XRValue) { + [&CGF, UpExpr, VD, IPriv, Loc](RValue XRValue) { CodeGenFunction::OMPPrivateScope PrivateScope(CGF); - PrivateScope.addPrivate(VD, [&CGF, VD, XRValue]() -> Address { - Address LHSTemp = CGF.CreateMemTemp(VD->getType()); - CGF.EmitStoreThroughLValue( - XRValue, CGF.MakeAddrLValue(LHSTemp, VD->getType())); - return LHSTemp; - }); + PrivateScope.addPrivate( + VD, [&CGF, VD, XRValue, Loc]() -> Address { + Address LHSTemp = CGF.CreateMemTemp(VD->getType()); + CGF.emitOMPSimpleStore( + CGF.MakeAddrLValue(LHSTemp, VD->getType()), XRValue, + VD->getType().getNonReferenceType(), Loc); + return LHSTemp; + }); (void)PrivateScope.Privatize(); return CGF.EmitAnyExpr(UpExpr); }); |