[flang-commits] [flang] Adding parsing and semantic check support for omp masked (PR #91432)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Thu May 9 11:20:40 PDT 2024


================
@@ -1498,11 +1505,35 @@ void AccAttributeVisitor::CheckMultipleAppearances(
     AddDataSharingAttributeObject(*target);
   }
 }
+std::optional<int64_t> OmpAttributeVisitor::GetMaskedTId(
+    const parser::OmpClauseList &clauseList) {
+  for (const auto &clause : clauseList.v) {
+    if (const auto *filterClause{
+            std::get_if<parser::OmpClause::Filter>(&clause.u)}) {
+      if (const auto v{EvaluateInt64(context_, filterClause->v)}) {
+        return v;
+      }
+    }
+  }
+  // if no thread id is specified in filter clause, the masked thread id should
+  // be master's
----------------
mjklemm wrote:

Maybe even add "the ID of the primary thread (= 0)".


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


More information about the flang-commits mailing list