[flang-commits] [flang] [flang][OpenMP] Expand GetOmpObjectList to all subclasses of OmpClause (PR #170351)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Wed Dec 3 07:46:26 PST 2025


================
@@ -2566,9 +2566,8 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPAllocatorsConstruct &x) {
   PushContext(x.source, dirSpec.DirId());
 
   for (const auto &clause : dirSpec.Clauses().v) {
-    if (const auto *allocClause{
-            std::get_if<parser::OmpClause::Allocate>(&clause.u)}) {
-      ResolveOmpObjectList(std::get<parser::OmpObjectList>(allocClause->v.t),
+    if (std::get_if<parser::OmpClause::Allocate>(&clause.u)) {
+      ResolveOmpObjectList(*parser::omp::GetOmpObjectList(x),
----------------
kparzysz wrote:

> Maybe we need a semantic check for unresolved object lists. I think there is a check that reports any unresolved DataRefs.

There is already a check for that somewhere.  If there is any AST node with a pointer to Symbol that is not set, flang will report an internal error.  I guess we simply never got that case in the lit tests.

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


More information about the flang-commits mailing list