[flang-commits] [flang] [llvm] [mlir] [flang][OpenMP] Implement the error directive (PR #206175)

via flang-commits flang-commits at lists.llvm.org
Wed Jul 1 07:08:29 PDT 2026


================
@@ -2626,6 +2626,38 @@ void OmpStructureChecker::Enter(const parser::OpenMPDispatchConstruct &x) {
   }
 }
 
+void OmpStructureChecker::Enter(const parser::OmpErrorDirective &x) {
+  // Defaults per spec: AT(compilation), SEVERITY(fatal)
+  auto atKind{parser::OmpAtClause::ActionTime::Compilation};
+  auto sevKind{parser::OmpSeverityClause::SevLevel::Fatal};
+  std::optional<std::string> message;
+
+  for (const parser::OmpClause &clause : x.v.Clauses().v) {
----------------
Ritanya-B-Bharadwaj wrote:

I noticed the atKind/sevKind/message extraction loop is basically duplicated between genErrorDirective and here. Don't you think it'd be worth pulling this into a shared helper so the two don't drift apart over time?

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


More information about the flang-commits mailing list