[PATCH] D57690: [OPENMP] issue error messages for multiple teams contructs in a target constructs
Kelvin Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 4 12:33:21 PST 2019
kkwli0 updated this revision to Diff 185125.
kkwli0 marked an inline comment as done.
kkwli0 added a comment.
Update based on review comment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57690/new/
https://reviews.llvm.org/D57690
Files:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/nesting_of_regions.cpp
Index: clang/test/OpenMP/nesting_of_regions.cpp
===================================================================
--- clang/test/OpenMP/nesting_of_regions.cpp
+++ clang/test/OpenMP/nesting_of_regions.cpp
@@ -4080,6 +4080,13 @@
}
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
{
+#pragma omp teams // expected-note {{directive outside teams construct here}}
+ ++a;
+#pragma omp teams // expected-note {{nested teams construct here}}
+ ++a;
+ }
+#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
+ {
++a; // expected-note {{statement outside teams construct here}}
#pragma omp teams // expected-note {{nested teams construct here}}
++a;
@@ -12693,6 +12700,13 @@
}
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
{
+#pragma omp teams // expected-note {{directive outside teams construct here}}
+ ++a;
+#pragma omp teams // expected-note {{nested teams construct here}}
+ ++a;
+ }
+#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
+ {
++a; // expected-note {{statement outside teams construct here}}
#pragma omp teams // expected-note {{nested teams construct here}}
++a;
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -7067,7 +7067,9 @@
auto I = CS->body_begin();
while (I != CS->body_end()) {
const auto *OED = dyn_cast<OMPExecutableDirective>(*I);
- if (!OED || !isOpenMPTeamsDirective(OED->getDirectiveKind())) {
+ if (!OED || !isOpenMPTeamsDirective(OED->getDirectiveKind()) ||
+ OMPTeamsFound) {
+
OMPTeamsFound = false;
break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57690.185125.patch
Type: text/x-patch
Size: 2056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190204/176f7ae6/attachment.bin>
More information about the cfe-commits
mailing list