[llvm-branch-commits] [flang] [flang][openmp] Add parser/semantic support for workdistribute (PR #154377)

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 22 09:55:17 PDT 2025


================
@@ -4497,6 +4572,25 @@ void OmpStructureChecker::CheckWorkshareBlockStmts(
   }
 }
 
+void OmpStructureChecker::CheckWorkdistributeBlockStmts(
+    const parser::Block &block, parser::CharBlock source) {
+  unsigned version{context_.langOptions().OpenMPVersion};
+  if (version < 60)
+    context_.Say(source,
+        "WORKDISTRIBUTE construct is only supported from openMP 6.0"_err_en_US);
----------------
kparzysz wrote:

We usually generate messages in the form of `"xyz is not allowed in %s, %s"`, with the string arguments being `ThisVersion(version)` and `TryVersion(sinceVersion)`.  ThisVersion(v) expands to "OpenMP v.v", TryVersion(v) expands to "try -fopenmp-version=v".
See https://github.com/llvm/llvm-project/blob/main/flang/lib/Semantics/check-omp-structure.cpp#L205-L207 for an example.

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


More information about the llvm-branch-commits mailing list