[flang] [llvm] [flang][OpenMP] Store list of expressions in InitializerT (PR #170923)

Kareem Ergawy via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 7 22:09:20 PST 2025


================
@@ -982,21 +982,23 @@ Init make(const parser::OmpClause::Init &inp,
 Initializer make(const parser::OmpClause::Initializer &inp,
                  semantics::SemanticsContext &semaCtx) {
   const parser::OmpInitializerExpression &iexpr = inp.v.v;
-  const parser::OmpStylizedInstance &styleInstance = iexpr.v.front();
-  const parser::OmpStylizedInstance::Instance &instance =
-      std::get<parser::OmpStylizedInstance::Instance>(styleInstance.t);
-  if (const auto *as = std::get_if<parser::AssignmentStmt>(&instance.u)) {
-    auto &expr = std::get<parser::Expr>(as->t);
-    return Initializer{makeExpr(expr, semaCtx)};
-  } else if (const auto *call = std::get_if<parser::CallStmt>(&instance.u)) {
-    if (call->typedCall) {
+  Initializer initializer;
+  for (const parser::OmpStylizedInstance &styleInstance : iexpr.v) {
----------------
ergawy wrote:

Newbie question, does the spec allow more than an initializer expression in one initializer clause? Should we instead emit a semantic error when there is more than one?

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


More information about the llvm-commits mailing list