[PATCH] D83398: [OPENMP50]Perform data mapping analysis only for explicitly mapped data.
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 13 08:37:21 PDT 2020
ABataev updated this revision to Diff 277446.
ABataev added a comment.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83398/new/
https://reviews.llvm.org/D83398
Files:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/target_map_messages.cpp
Index: clang/test/OpenMP/target_map_messages.cpp
===================================================================
--- clang/test/OpenMP/target_map_messages.cpp
+++ clang/test/OpenMP/target_map_messages.cpp
@@ -604,6 +604,7 @@
const int (&l)[5] = da;
SC1 s;
SC1 *p;
+ int Arr[10];
#pragma omp target data map // expected-error {{expected '(' after 'map'}} le45-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}} le50-error {{expected at least one 'map', 'use_device_ptr', or 'use_device_addr' clause for '#pragma omp target data'}}
#pragma omp target data map( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
#pragma omp target data map() // expected-error {{expected expression}}
@@ -750,6 +751,12 @@
#pragma omp target map(iarr[:2:d]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
{}
+#pragma omp target data map(Arr[0:4]) // le45-note {{used here}}
+ {
+#pragma omp target
+ Arr[0] = 2; // le45-error {{original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage}}
+ }
+
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}
}
#endif
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -17478,6 +17478,7 @@
/*CurrentRegionOnly=*/true, CurComponents, CKind))
break;
if (CKind == OMPC_map &&
+ (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) &&
checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr,
/*CurrentRegionOnly=*/false, CurComponents, CKind))
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83398.277446.patch
Type: text/x-patch
Size: 2023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200713/339daa91/attachment-0001.bin>
More information about the cfe-commits
mailing list