[PATCH] D84353: [flang][openmp] Required clauses are allowed
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 12:16:00 PDT 2020
clementval created this revision.
clementval added reviewers: kiranchandramohan, DavidTruby, richard.barton.arm, jdoerfert, sscalpone, kiranktp, ichoyjx.
Herald added subscribers: llvm-commits, sstefan1, guansong, yaxunl.
Herald added a project: LLVM.
This patch fix a problem where clause needed to be in the allowed set even
they were in the required set. A required clause is allowed obvisouly. This allow
to remove the duplicate in OMP.td
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84353
Files:
flang/lib/Semantics/check-omp-structure.cpp
llvm/include/llvm/Frontend/OpenMP/OMP.td
Index: llvm/include/llvm/Frontend/OpenMP/OMP.td
===================================================================
--- llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -402,7 +402,6 @@
}
def OMP_TargetData : Directive<"target data"> {
let allowedClauses = [
- VersionedClause<OMPC_Map>,
VersionedClause<OMPC_UseDevicePtr>,
VersionedClause<OMPC_UseDeviceAddr, 50>
];
@@ -427,8 +426,7 @@
}
def OMP_TargetExitData : Directive<"target exit data"> {
let allowedClauses = [
- VersionedClause<OMPC_Depend>,
- VersionedClause<OMPC_Map>
+ VersionedClause<OMPC_Depend>
];
let allowedOnceClauses = [
VersionedClause<OMPC_Device>,
Index: flang/lib/Semantics/check-omp-structure.cpp
===================================================================
--- flang/lib/Semantics/check-omp-structure.cpp
+++ flang/lib/Semantics/check-omp-structure.cpp
@@ -44,7 +44,8 @@
void OmpStructureChecker::CheckAllowed(llvm::omp::Clause type) {
if (!GetContext().allowedClauses.test(type) &&
!GetContext().allowedOnceClauses.test(type) &&
- !GetContext().allowedExclusiveClauses.test(type)) {
+ !GetContext().allowedExclusiveClauses.test(type) &&
+ !GetContext().requiredClauses.test(type)) {
context_.Say(GetContext().clauseSource,
"%s clause is not allowed on the %s directive"_err_en_US,
parser::ToUpperCaseLetters(llvm::omp::getOpenMPClauseName(type).str()),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84353.279909.patch
Type: text/x-patch
Size: 1471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/e6cf0029/attachment.bin>
More information about the llvm-commits
mailing list