[flang-commits] [flang] [Flang] [Semantics] [OpenMP] Fix semantic check to not report error for compound OMP TARGET directives. (PR #112059)
Raghu Maddhipatla via flang-commits
flang-commits at lists.llvm.org
Fri Oct 11 23:24:37 PDT 2024
================
@@ -2418,10 +2418,16 @@ void OmpAttributeVisitor::ResolveOmpObject(
Symbol::Flag::OmpLastPrivate, Symbol::Flag::OmpShared,
Symbol::Flag::OmpLinear};
- for (Symbol::Flag ompFlag1 : dataMappingAttributeFlags) {
- for (Symbol::Flag ompFlag2 : dataSharingAttributeFlags) {
- checkExclusivelists(
- hostAssocSym, ompFlag1, symbol, ompFlag2);
+ // For OMP TARGET TEAMS directive some sharing attribute
+ // flags and mapping attribute flags can co-exist.
+ if (!(llvm::omp::allTeamsSet.test(GetContext().directive) ||
+ llvm::omp::allParallelSet.test(
----------------
raghavendhra wrote:
allParallelSet is needed because there can be compound directive OMP TARGET PARALLEL which can have SHARED clause but OMP TARGET PARALLEL is not covered in allTeamsSet. All variations of PARALLEL are under allParallelSet. This if condition is inside allTargetSet so with this additional if condition mentioned here in the commit makes it kind of intersection set between TARGET and PARALLEL directives which brings us all variations of TARGET PARALLEL compound directives covered. Similar thing with TARGET TEAMS compound directive variations.
https://github.com/llvm/llvm-project/pull/112059
More information about the flang-commits
mailing list