[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Implement verification of modifier sets (PR #218507)

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 27 07:51:19 PDT 2026


================
@@ -1283,6 +1315,32 @@ bool OmpStructureChecker::VerifyModifierExclusive(
     }
   }
 
+  // Check modifier sets.
+  llvm::DenseMap<llvm::omp::ModifierSet, const AppliedModifier *> exclusive;
+  for (const AppliedModifier &am : info.modifiers) {
+    if (!am.setId) {
+      continue;
+    }
+    auto &sdesc{llvm::omp::getDescriptor(*am.setId)};
+    if (!sdesc.getProperties(version).test(llvm::omp::Property::Exclusive)) {
+      continue;
+    }
+    auto [where, inserted]{exclusive.insert({*am.setId, &am})};
+    if (!inserted) {
+      const AppliedModifier *prev{where->second};
+      if (prev->modifierId != am.modifierId) {
+        auto &prevDesc{llvm::omp::getDescriptor(prev->modifierId)};
+        auto &thisDesc{llvm::omp::getDescriptor(am.modifierId)};
+        context_
+            .Say(prev->source,
----------------
kparzysz wrote:

This one can't be tested yet because we can't produce an AST that would represent the problem at the moment.

https://github.com/llvm/llvm-project/pull/218507


More information about the llvm-branch-commits mailing list