[flang-commits] [flang] [llvm] [Flang][OpenMP][Sema] Adding parsing and semantic support for scan directive. (PR #102792)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Aug 29 03:39:31 PDT 2024


================
@@ -1591,6 +1593,20 @@ bool OmpAttributeVisitor::Pre(
   default:
     break;
   }
+  if (standaloneDir.v == llvm::omp::Directive::OMPD_scan) {
+    if ((std::get<parser::OmpClauseList>(x.t).v.size() != 1)) {
+      context_.Say(standaloneDir.source,
+          "Exactly one of `exclusive` or `inclusive` clause is expected"_err_en_US);
+    }
+    if (!parentContext ||
+        (llvm::omp::getDirectiveAssociation(parentContext->directive) !=
----------------
skatrak wrote:

If clang was checking this incorrectly and it's not a lot of effort to fix, maybe it's worth creating a small PR to address it there too. Or creating an issue for it with a small reproducer if you're not sure how to fix it yourself.

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


More information about the flang-commits mailing list