[PATCH] D141531: [OpenMP][FIX] Allow multiple `depend` clauses on a `taskwait nowait`
Johannes Doerfert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 11 22:38:36 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa8eccca93415: [OpenMP][FIX] Allow multiple `depend` clauses on a `taskwait nowait` (authored by jdoerfert).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141531/new/
https://reviews.llvm.org/D141531
Files:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/taskwait_ast_print.cpp
Index: clang/test/OpenMP/taskwait_ast_print.cpp
===================================================================
--- clang/test/OpenMP/taskwait_ast_print.cpp
+++ clang/test/OpenMP/taskwait_ast_print.cpp
@@ -25,6 +25,7 @@
static T a;
#pragma omp taskwait
#pragma omp taskwait depend(in:a, argc) nowait
+#pragma omp taskwait depend(in:a) depend(in:argc) nowait
return a + argc;
}
@@ -41,12 +42,15 @@
// CHECK: static T a;
// CHECK-NEXT: #pragma omp taskwait{{$}}
// CHECK-NEXT: #pragma omp taskwait depend(in : a,argc) nowait{{$}}
+// CHECK-NEXT: #pragma omp taskwait depend(in : a) depend(in : argc) nowait{{$}}
// CHECK: static int a;
// CHECK-NEXT: #pragma omp taskwait
// CHECK-NEXT: #pragma omp taskwait depend(in : a,argc) nowait{{$}}
+// CHECK-NEXT: #pragma omp taskwait depend(in : a) depend(in : argc) nowait{{$}}
// CHECK: static char a;
// CHECK-NEXT: #pragma omp taskwait
// CHECK-NEXT: #pragma omp taskwait depend(in : a,argc) nowait{{$}}
+// CHECK-NEXT: #pragma omp taskwait depend(in : a) depend(in : argc) nowait{{$}}
int main(int argc, char **argv) {
static int a;
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -11109,9 +11109,10 @@
SourceLocation EndLoc) {
const OMPNowaitClause *NowaitC =
OMPExecutableDirective::getSingleClause<OMPNowaitClause>(Clauses);
- const OMPDependClause *DependC =
- OMPExecutableDirective::getSingleClause<OMPDependClause>(Clauses);
- if (NowaitC && !DependC) {
+ bool HasDependC =
+ !OMPExecutableDirective::getClausesOfKind<OMPDependClause>(Clauses)
+ .empty();
+ if (NowaitC && !HasDependC) {
Diag(StartLoc, diag::err_omp_nowait_clause_without_depend);
return StmtError();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141531.488481.patch
Type: text/x-patch
Size: 1890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230112/639e0357/attachment.bin>
More information about the cfe-commits
mailing list