diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-08-22 03:34:30 +0000 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-08-22 03:34:30 +0000 |
commit | 7d5bc554333e28749554c313a207d8267da69837 (patch) | |
tree | b41c71b0e04a7666e817cfc6e75af2a8c0fe7426 /clang/lib/Sema/SemaExpr.cpp | |
parent | 0a8e634b3bb939407c49f11cd724eb656ca9f2cc (diff) | |
download | bcm5719-llvm-7d5bc554333e28749554c313a207d8267da69837.tar.gz bcm5719-llvm-7d5bc554333e28749554c313a207d8267da69837.zip |
[OpenMP] Permit map with DSA on combined directive
For `map`, the following restriction changed in OpenMP 5.0:
* OpenMP 4.5 [2.15.5.1, Restrictions]: "A list item cannot appear in
both a map clause and a data-sharing attribute clause on the same
construct.
* OpenMP 5.0 [2.19.7.1, Restrictions]: "A list item cannot appear in
both a map clause and a data-sharing attribute clause on the same
construct unless the construct is a combined construct."
This patch removes this restriction in the case of combined constructs
and OpenMP 5.0, and it updates Sema not to capture a scalar by copy in
the target region when `firstprivate` and `map` appear for that scalar
on a combined target construct.
This patch also adds a fixme to a test that now reveals that a
diagnostic about loop iteration variables is dropped in the case of
OpenMP 5.0. That bug exists regardless of this patch's changes.
Reviewed By: ABataev, jdoerfert, hfinkel, kkwli0
Differential Revision: https://reviews.llvm.org/D65835
llvm-svn: 369619
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e2ff34a8a79..03f968e7d22 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -15660,7 +15660,8 @@ static bool captureInCapturedRegion(CapturedRegionScopeInfo *RSI, if (HasConst) DeclRefType.addConst(); } - ByRef = S.isOpenMPCapturedByRef(Var, RSI->OpenMPLevel); + ByRef = S.isOpenMPCapturedByRef(Var, RSI->OpenMPLevel, + RSI->OpenMPCaptureLevel); } if (ByRef) |