Skip to content

[flang][OpenMP] Pass OpenMP version to getOpenMPDirectiveName #139131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 9, 2025

Conversation

kparzysz
Copy link
Contributor

@kparzysz kparzysz commented May 8, 2025

The OpenMP version is stored in LangOptions in SemanticsContext. Use the fallback version where SemanticsContext is unavailable (mostly in case of debug dumps).

RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507

kparzysz added 8 commits May 8, 2025 11:23
Some OpenMP directives have different spellings in different versions
of the OpenMP spec. To use the proper spelling for a given spec version
pass "version" as a parameter to getOpenMPDirectiveName.

This parameter won't be used at the moment, and will have a default
value to allow callers not to pass it, for gradual adoption in various
components.

RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507
The OpenMP version is stored in language options in Sema. For use in
objects that do not have access to Sema, add OpenMP version field to
PrintingPolicy, giving it 8 bits.

RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507
The OpenMP version is stored in LangOptions in SemanticsContext. Use the
fallback version where SemanticsContext is unavailable (mostly in case of
debug dumps).

RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507
@llvmbot
Copy link
Member

llvmbot commented May 8, 2025

@llvm/pr-subscribers-flang-openmp
@llvm/pr-subscribers-flang-driver

@llvm/pr-subscribers-flang-semantics

Author: Krzysztof Parzyszek (kparzysz)

Changes

The OpenMP version is stored in LangOptions in SemanticsContext. Use the fallback version where SemanticsContext is unavailable (mostly in case of debug dumps).

RFC: https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507


Patch is 24.47 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139131.diff

15 Files Affected:

  • (modified) flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp (+3-2)
  • (modified) flang/include/flang/Parser/dump-parse-tree.h (+3-2)
  • (modified) flang/include/flang/Parser/unparse.h (+7)
  • (modified) flang/include/flang/Semantics/unparse-with-symbols.h (+5)
  • (modified) flang/lib/Frontend/ParserActions.cpp (+2-1)
  • (modified) flang/lib/Lower/OpenMP/ClauseProcessor.h (+3-1)
  • (modified) flang/lib/Lower/OpenMP/Decomposer.cpp (+2-1)
  • (modified) flang/lib/Lower/OpenMP/OpenMP.cpp (+4-2)
  • (modified) flang/lib/Parser/openmp-parsers.cpp (+2-1)
  • (modified) flang/lib/Parser/parse-tree.cpp (+4-1)
  • (modified) flang/lib/Parser/unparse.cpp (+24-15)
  • (modified) flang/lib/Semantics/check-omp-structure.cpp (+9-9)
  • (modified) flang/lib/Semantics/mod-file.cpp (+6-5)
  • (modified) flang/lib/Semantics/resolve-directives.cpp (+16-9)
  • (modified) flang/lib/Semantics/unparse-with-symbols.cpp (+3-3)
diff --git a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
index dbbf86a6c6151..bf66151d59950 100644
--- a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
+++ b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
@@ -267,8 +267,9 @@ void OpenMPCounterVisitor::Post(const OmpScheduleClause::Kind &c) {
       "type=" + std::string{OmpScheduleClause::EnumToString(c)} + ";";
 }
 void OpenMPCounterVisitor::Post(const OmpDirectiveNameModifier &c) {
-  clauseDetails +=
-      "name_modifier=" + llvm::omp::getOpenMPDirectiveName(c.v).str() + ";";
+  clauseDetails += "name_modifier=" +
+      llvm::omp::getOpenMPDirectiveName(c.v, llvm::omp::FallbackVersion).str() +
+      ";";
 }
 void OpenMPCounterVisitor::Post(const OmpClause &c) {
   PostClauseCommon(normalize_clause_name(c.source.ToString()));
diff --git a/flang/include/flang/Parser/dump-parse-tree.h b/flang/include/flang/Parser/dump-parse-tree.h
index a3721bc8410ba..df9278697346f 100644
--- a/flang/include/flang/Parser/dump-parse-tree.h
+++ b/flang/include/flang/Parser/dump-parse-tree.h
@@ -17,6 +17,7 @@
 #include "flang/Common/idioms.h"
 #include "flang/Common/indirection.h"
 #include "flang/Support/Fortran.h"
+#include "llvm/Frontend/OpenMP/OMP.h"
 #include "llvm/Support/raw_ostream.h"
 #include <string>
 #include <type_traits>
@@ -545,8 +546,8 @@ class ParseTreeDumper {
   NODE(parser, OmpBeginSectionsDirective)
   NODE(parser, OmpBlockDirective)
   static std::string GetNodeName(const llvm::omp::Directive &x) {
-    return llvm::Twine(
-        "llvm::omp::Directive = ", llvm::omp::getOpenMPDirectiveName(x))
+    return llvm::Twine("llvm::omp::Directive = ",
+        llvm::omp::getOpenMPDirectiveName(x, llvm::omp::FallbackVersion))
         .str();
   }
   NODE(parser, OmpClause)
diff --git a/flang/include/flang/Parser/unparse.h b/flang/include/flang/Parser/unparse.h
index 40094ecbc85e5..349597213d904 100644
--- a/flang/include/flang/Parser/unparse.h
+++ b/flang/include/flang/Parser/unparse.h
@@ -18,6 +18,10 @@ namespace llvm {
 class raw_ostream;
 }
 
+namespace Fortran::common {
+class LangOptions;
+}
+
 namespace Fortran::evaluate {
 struct GenericExprWrapper;
 struct GenericAssignmentWrapper;
@@ -47,14 +51,17 @@ struct AnalyzedObjectsAsFortran {
 // Converts parsed program (or fragment) to out as Fortran.
 template <typename A>
 void Unparse(llvm::raw_ostream &out, const A &root,
+    const common::LangOptions &langOpts,
     Encoding encoding = Encoding::UTF_8, bool capitalizeKeywords = true,
     bool backslashEscapes = true, preStatementType *preStatement = nullptr,
     AnalyzedObjectsAsFortran * = nullptr);
 
 extern template void Unparse(llvm::raw_ostream &out, const Program &program,
+    const common::LangOptions &langOpts,
     Encoding encoding, bool capitalizeKeywords, bool backslashEscapes,
     preStatementType *preStatement, AnalyzedObjectsAsFortran *);
 extern template void Unparse(llvm::raw_ostream &out, const Expr &expr,
+    const common::LangOptions &langOpts,
     Encoding encoding, bool capitalizeKeywords, bool backslashEscapes,
     preStatementType *preStatement, AnalyzedObjectsAsFortran *);
 } // namespace Fortran::parser
diff --git a/flang/include/flang/Semantics/unparse-with-symbols.h b/flang/include/flang/Semantics/unparse-with-symbols.h
index 5e18b3fc3063d..702911bbab627 100644
--- a/flang/include/flang/Semantics/unparse-with-symbols.h
+++ b/flang/include/flang/Semantics/unparse-with-symbols.h
@@ -16,6 +16,10 @@ namespace llvm {
 class raw_ostream;
 }
 
+namespace Fortran::common {
+class LangOptions;
+}
+
 namespace Fortran::parser {
 struct Program;
 }
@@ -23,6 +27,7 @@ struct Program;
 namespace Fortran::semantics {
 class SemanticsContext;
 void UnparseWithSymbols(llvm::raw_ostream &, const parser::Program &,
+    const common::LangOptions &,
     parser::Encoding encoding = parser::Encoding::UTF_8);
 void UnparseWithModules(llvm::raw_ostream &, SemanticsContext &,
     const parser::Program &,
diff --git a/flang/lib/Frontend/ParserActions.cpp b/flang/lib/Frontend/ParserActions.cpp
index cc7e72f696f96..4fe575b06d29f 100644
--- a/flang/lib/Frontend/ParserActions.cpp
+++ b/flang/lib/Frontend/ParserActions.cpp
@@ -119,7 +119,7 @@ void debugUnparseNoSema(CompilerInstance &ci, llvm::raw_ostream &out) {
   auto &parseTree{ci.getParsing().parseTree()};
 
   // TODO: Options should come from CompilerInvocation
-  Unparse(out, *parseTree,
+  Unparse(out, *parseTree, ci.getInvocation().getLangOpts(),
           /*encoding=*/parser::Encoding::UTF_8,
           /*capitalizeKeywords=*/true, /*backslashEscapes=*/false,
           /*preStatement=*/nullptr,
@@ -131,6 +131,7 @@ void debugUnparseWithSymbols(CompilerInstance &ci) {
   auto &parseTree{*ci.getParsing().parseTree()};
 
   semantics::UnparseWithSymbols(llvm::outs(), parseTree,
+                                ci.getInvocation().getLangOpts(),
                                 /*encoding=*/parser::Encoding::UTF_8);
 }
 
diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.h b/flang/lib/Lower/OpenMP/ClauseProcessor.h
index 3d3f26f06da26..593c9f478c73e 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.h
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.h
@@ -196,9 +196,11 @@ void ClauseProcessor::processTODO(mlir::Location currentLocation,
   auto checkUnhandledClause = [&](llvm::omp::Clause id, const auto *x) {
     if (!x)
       return;
+    unsigned version = semaCtx.langOptions().OpenMPVersion;
     TODO(currentLocation,
          "Unhandled clause " + llvm::omp::getOpenMPClauseName(id).upper() +
-             " in " + llvm::omp::getOpenMPDirectiveName(directive).upper() +
+             " in " +
+             llvm::omp::getOpenMPDirectiveName(directive, version).upper() +
              " construct");
   };
 
diff --git a/flang/lib/Lower/OpenMP/Decomposer.cpp b/flang/lib/Lower/OpenMP/Decomposer.cpp
index 33568bf96b5df..0c7f485d94820 100644
--- a/flang/lib/Lower/OpenMP/Decomposer.cpp
+++ b/flang/lib/Lower/OpenMP/Decomposer.cpp
@@ -16,6 +16,7 @@
 #include "Utils.h"
 #include "flang/Lower/PFTBuilder.h"
 #include "flang/Semantics/semantics.h"
+#include "flang/Support/LangOptions.h"
 #include "flang/Tools/CrossToolHelpers.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "llvm/ADT/ArrayRef.h"
@@ -70,7 +71,7 @@ struct ConstructDecomposition {
 namespace Fortran::lower::omp {
 LLVM_DUMP_METHOD llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
                                                const UnitConstruct &uc) {
-  os << llvm::omp::getOpenMPDirectiveName(uc.id);
+  os << llvm::omp::getOpenMPDirectiveName(uc.id, llvm::omp::FallbackVersion);
   for (auto [index, clause] : llvm::enumerate(uc.clauses)) {
     os << (index == 0 ? '\t' : ' ');
     os << llvm::omp::getOpenMPClauseName(clause.id);
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 099d5c604060f..efdf5c6f545fe 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -3751,9 +3751,11 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
                        item);
     break;
   case llvm::omp::Directive::OMPD_tile:
-  case llvm::omp::Directive::OMPD_unroll:
+  case llvm::omp::Directive::OMPD_unroll: {
+    unsigned version = semaCtx.langOptions().OpenMPVersion;
     TODO(loc, "Unhandled loop directive (" +
-                  llvm::omp::getOpenMPDirectiveName(dir) + ")");
+                  llvm::omp::getOpenMPDirectiveName(dir, version) + ")");
+  }
   // case llvm::omp::Directive::OMPD_workdistribute:
   case llvm::omp::Directive::OMPD_workshare:
     newOp = genWorkshareOp(converter, symTable, stmtCtx, semaCtx, eval, loc,
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index c4728e0fabe61..ffee57144f7fb 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -125,7 +125,8 @@ OmpDirectiveNameParser::directives() const {
 void OmpDirectiveNameParser::initTokens(NameWithId *table) const {
   for (size_t i{0}, e{llvm::omp::Directive_enumSize}; i != e; ++i) {
     auto id{static_cast<llvm::omp::Directive>(i)};
-    llvm::StringRef name{llvm::omp::getOpenMPDirectiveName(id)};
+    llvm::StringRef name{
+        llvm::omp::getOpenMPDirectiveName(id, llvm::omp::FallbackVersion)};
     table[i] = std::make_pair(name.str(), id);
   }
   // Sort the table with respect to the directive name length in a descending
diff --git a/flang/lib/Parser/parse-tree.cpp b/flang/lib/Parser/parse-tree.cpp
index 5839e7862b38b..3dd87ad9a3650 100644
--- a/flang/lib/Parser/parse-tree.cpp
+++ b/flang/lib/Parser/parse-tree.cpp
@@ -11,6 +11,7 @@
 #include "flang/Common/indirection.h"
 #include "flang/Parser/tools.h"
 #include "flang/Parser/user-state.h"
+#include "llvm/Frontend/OpenMP/OMP.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 
@@ -305,7 +306,9 @@ std::string OmpTraitSelectorName::ToString() const {
             return std::string(EnumToString(v));
           },
           [&](llvm::omp::Directive d) {
-            return llvm::omp::getOpenMPDirectiveName(d).str();
+            return llvm::omp::getOpenMPDirectiveName(
+                d, llvm::omp::FallbackVersion)
+                .str();
           },
           [&](const std::string &s) { //
             return s;
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index 1ee9096fcda56..3747665f6320b 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -17,6 +17,7 @@
 #include "flang/Parser/parse-tree.h"
 #include "flang/Parser/tools.h"
 #include "flang/Support/Fortran.h"
+#include "flang/Support/LangOptions.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 #include <cinttypes>
@@ -27,12 +28,14 @@ namespace Fortran::parser {
 
 class UnparseVisitor {
 public:
-  UnparseVisitor(llvm::raw_ostream &out, int indentationAmount,
-      Encoding encoding, bool capitalize, bool backslashEscapes,
-      preStatementType *preStatement, AnalyzedObjectsAsFortran *asFortran)
-      : out_{out}, indentationAmount_{indentationAmount}, encoding_{encoding},
-        capitalizeKeywords_{capitalize}, backslashEscapes_{backslashEscapes},
-        preStatement_{preStatement}, asFortran_{asFortran} {}
+  UnparseVisitor(llvm::raw_ostream &out, const common::LangOptions &langOpts,
+      int indentationAmount, Encoding encoding, bool capitalize,
+      bool backslashEscapes, preStatementType *preStatement,
+      AnalyzedObjectsAsFortran *asFortran)
+      : out_{out}, langOpts_{langOpts}, indentationAmount_{indentationAmount},
+        encoding_{encoding}, capitalizeKeywords_{capitalize},
+        backslashEscapes_{backslashEscapes}, preStatement_{preStatement},
+        asFortran_{asFortran} {}
 
   // In nearly all cases, this code avoids defining Boolean-valued Pre()
   // callbacks for the parse tree walking framework in favor of two void
@@ -2102,7 +2105,8 @@ class UnparseVisitor {
     Walk(":", std::get<std::optional<OmpReductionCombiner>>(x.t));
   }
   void Unparse(const llvm::omp::Directive &x) {
-    Word(llvm::omp::getOpenMPDirectiveName(x).str());
+    unsigned OMPVersion{langOpts_.OpenMPVersion};
+    Word(llvm::omp::getOpenMPDirectiveName(x, OMPVersion).str());
   }
   void Unparse(const OmpDirectiveSpecification &x) {
     auto unparseArgs{[&]() {
@@ -2167,7 +2171,8 @@ class UnparseVisitor {
         x.u);
   }
   void Unparse(const OmpDirectiveNameModifier &x) {
-    Word(llvm::omp::getOpenMPDirectiveName(x.v));
+    unsigned OMPVersion{langOpts_.OpenMPVersion};
+    Word(llvm::omp::getOpenMPDirectiveName(x.v, OMPVersion));
   }
   void Unparse(const OmpIteratorSpecifier &x) {
     Walk(std::get<TypeDeclarationStmt>(x.t));
@@ -3249,6 +3254,7 @@ class UnparseVisitor {
   }
 
   llvm::raw_ostream &out_;
+  const common::LangOptions &langOpts_;
   int indent_{0};
   const int indentationAmount_{1};
   int column_{1};
@@ -3341,17 +3347,20 @@ void UnparseVisitor::Word(const std::string_view &str) {
 }
 
 template <typename A>
-void Unparse(llvm::raw_ostream &out, const A &root, Encoding encoding,
+void Unparse(llvm::raw_ostream &out, const A &root,
+    const common::LangOptions &langOpts, Encoding encoding,
     bool capitalizeKeywords, bool backslashEscapes,
     preStatementType *preStatement, AnalyzedObjectsAsFortran *asFortran) {
-  UnparseVisitor visitor{out, 1, encoding, capitalizeKeywords, backslashEscapes,
-      preStatement, asFortran};
+  UnparseVisitor visitor{out, langOpts, 1, encoding, capitalizeKeywords,
+      backslashEscapes, preStatement, asFortran};
   Walk(root, visitor);
   visitor.Done();
 }
 
-template void Unparse<Program>(llvm::raw_ostream &, const Program &, Encoding,
-    bool, bool, preStatementType *, AnalyzedObjectsAsFortran *);
-template void Unparse<Expr>(llvm::raw_ostream &, const Expr &, Encoding, bool,
-    bool, preStatementType *, AnalyzedObjectsAsFortran *);
+template void Unparse<Program>(llvm::raw_ostream &, const Program &,
+    const common::LangOptions &, Encoding, bool, bool, preStatementType *,
+    AnalyzedObjectsAsFortran *);
+template void Unparse<Expr>(llvm::raw_ostream &, const Expr &,
+    const common::LangOptions &, Encoding, bool, bool, preStatementType *,
+    AnalyzedObjectsAsFortran *);
 } // namespace Fortran::parser
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index f17de42ca2466..f2c1197097f09 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -2434,8 +2434,7 @@ void OmpStructureChecker::Enter(
     break;
   default:
     context_.Say(dirName.source, "%s is not a cancellable construct"_err_en_US,
-        parser::ToUpperCaseLetters(
-            llvm::omp::getOpenMPDirectiveName(dirName.v).str()));
+        parser::ToUpperCaseLetters(getDirectiveName(dirName.v).str()));
     break;
   }
 }
@@ -2468,7 +2467,7 @@ std::optional<llvm::omp::Directive> OmpStructureChecker::GetCancelType(
   // Given clauses from CANCEL or CANCELLATION_POINT, identify the construct
   // to which the cancellation applies.
   std::optional<llvm::omp::Directive> cancelee;
-  llvm::StringRef cancelName{llvm::omp::getOpenMPDirectiveName(cancelDir)};
+  llvm::StringRef cancelName{getDirectiveName(cancelDir)};
 
   for (const parser::OmpClause &clause : maybeClauses->v) {
     using CancellationConstructType =
@@ -2496,7 +2495,7 @@ std::optional<llvm::omp::Directive> OmpStructureChecker::GetCancelType(
 
 void OmpStructureChecker::CheckCancellationNest(
     const parser::CharBlock &source, llvm::omp::Directive type) {
-  llvm::StringRef typeName{llvm::omp::getOpenMPDirectiveName(type)};
+  llvm::StringRef typeName{getDirectiveName(type)};
 
   if (CurrentDirectiveIsNested()) {
     // If construct-type-clause is taskgroup, the cancellation construct must be
@@ -4002,10 +4001,10 @@ void OmpStructureChecker::Enter(const parser::OmpClause::If &x) {
     if (auto *dnm{OmpGetUniqueModifier<parser::OmpDirectiveNameModifier>(
             modifiers)}) {
       llvm::omp::Directive sub{dnm->v};
-      std::string subName{parser::ToUpperCaseLetters(
-          llvm::omp::getOpenMPDirectiveName(sub).str())};
-      std::string dirName{parser::ToUpperCaseLetters(
-          llvm::omp::getOpenMPDirectiveName(dir).str())};
+      std::string subName{
+          parser::ToUpperCaseLetters(getDirectiveName(sub).str())};
+      std::string dirName{
+          parser::ToUpperCaseLetters(getDirectiveName(dir).str())};
 
       parser::CharBlock modifierSource{OmpGetModifierSource(modifiers, dnm)};
       auto desc{OmpGetDescriptor<parser::OmpDirectiveNameModifier>()};
@@ -5348,7 +5347,8 @@ llvm::StringRef OmpStructureChecker::getClauseName(llvm::omp::Clause clause) {
 
 llvm::StringRef OmpStructureChecker::getDirectiveName(
     llvm::omp::Directive directive) {
-  return llvm::omp::getOpenMPDirectiveName(directive);
+  unsigned version{context_.langOptions().OpenMPVersion};
+  return llvm::omp::getOpenMPDirectiveName(directive, version);
 }
 
 const Symbol *OmpStructureChecker::GetObjectSymbol(
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp
index ee356e56e4458..12fc553518cfd 100644
--- a/flang/lib/Semantics/mod-file.cpp
+++ b/flang/lib/Semantics/mod-file.cpp
@@ -50,7 +50,7 @@ static void CollectSymbols(
     const Scope &, SymbolVector &, SymbolVector &, SourceOrderedSymbolSet &);
 static void PutPassName(llvm::raw_ostream &, const std::optional<SourceName> &);
 static void PutInit(llvm::raw_ostream &, const Symbol &, const MaybeExpr &,
-    const parser::Expr *);
+    const parser::Expr *, SemanticsContext &);
 static void PutInit(llvm::raw_ostream &, const MaybeIntExpr &);
 static void PutBound(llvm::raw_ostream &, const Bound &);
 static void PutShapeSpec(llvm::raw_ostream &, const ShapeSpec &);
@@ -605,7 +605,7 @@ void ModFileWriter::PutDECStructure(
         }
         decls_ << ref->name();
         PutShape(decls_, object->shape(), '(', ')');
-        PutInit(decls_, *ref, object->init(), nullptr);
+        PutInit(decls_, *ref, object->init(), nullptr, context_);
         emittedDECFields_.insert(*ref);
       } else if (any) {
         break; // any later use of this structure will use RECORD/str/
@@ -944,7 +944,8 @@ void ModFileWriter::PutObjectEntity(
       getSymbolAttrsToWrite(symbol));
   PutShape(os, details.shape(), '(', ')');
   PutShape(os, details.coshape(), '[', ']');
-  PutInit(os, symbol, details.init(), details.unanalyzedPDTComponentInit());
+  PutInit(os, symbol, details.init(), details.unanalyzedPDTComponentInit(),
+      context_);
   os << '\n';
   if (auto tkr{GetIgnoreTKR(symbol)}; !tkr.empty()) {
     os << "!dir$ ignore_tkr(";
@@ -1036,11 +1037,11 @@ void ModFileWriter::PutTypeParam(llvm::raw_ostream &os, const Symbol &symbol) {
 }
 
 void PutInit(llvm::raw_ostream &os, const Symbol &symbol, const MaybeExpr &init,
-    const parser::Expr *unanalyzed) {
+    const parser::Expr *unanalyzed, SemanticsContext &context) {
   if (IsNamedConstant(symbol) || symbol.owner().IsDerivedType()) {
     const char *assign{symbol.attrs().test(Attr::POINTER) ? "=>" : "="};
     if (unanalyzed) {
-      parser::Unparse(os << assign, *unanalyzed);
+      parser::Unparse(os << assign, *unanalyzed, context.langOptions());
     } else if (init) {
       init->AsFortran(os << assign);
     }
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 8b1caca34a6a7..60531538e6d59 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -1887,6 +1887,7 @@ std::int64_t OmpAttributeVisitor::GetAssociatedLoopLevelFromClauses(
 //     construct with multiple associated do-loops are lastprivate.
 void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
     const parser::OpenMPLoopConstruct &x) {
+  unsigned version{context_.langOptions().OpenMPVersion};
   std::int64_t level{GetContext().associatedLoopLevel};
   if (level <= 0) {
     return;
@@ -1922,7 +1923,8 @@ void OmpAttributeVisitor::PrivatizeAssociatedLoopIndexAndCheckLoopLevel(
     context_.Say(GetContext().directiveSource,
         "A DO loop must follow the %s directive"_err_en_US,
         parser::ToUpperCaseLetters(
-            llvm::omp::getOpenMPDirectiveName(GetContext().directive).str()));
+            llvm::omp::getOpenMPDirectiveName(GetContext().directive, version)
+                .str()));
   }
 }
 void OmpAttributeVisitor::CheckAssocLoopLevel(
@@ -2442,6 +2444,7 @@ static bool SymbolOrEquivalentIsInNamelist(const Symbol &symbol) {
 
 void OmpAttributeVisitor::ResolveOmpObject(
     const parser::OmpObject &ompObject, Symbol::Flag ompFlag) {
+  unsigned version{context_.langOptions().OpenMPVersion};
   common::visit(
       common::visitors{
           [&](const parser::Designator &designator) {
@@ -2464,7 +2467,7 @@ void OmpAttributeVisitor::ResolveOmpObject(
                             Symbol::OmpFlagToClauseName(secondOmpFlag),
                             parser::ToUpperCaseLetters(
                                 llvm::omp::getOpenMPDirectiveName(
-                                    GetContext().directive)
+                                    GetContext().directive, version)
                                     .str()));
                       }
                     };
@@ -2500,7 +2503,7 @@ void OmpAttribu...
[truncated]

Copy link

github-actions bot commented May 8, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@kparzysz
Copy link
Contributor Author

kparzysz commented May 8, 2025

Previous PR: #139115

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Base automatically changed from users/kparzysz/spr/v02-omp-nameversion-clang to main May 9, 2025 12:41
@kparzysz kparzysz merged commit 41aa674 into main May 9, 2025
11 checks passed
@kparzysz kparzysz deleted the users/kparzysz/spr/v03-omp-nameversion-flang branch May 9, 2025 12:42
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request May 9, 2025
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request May 9, 2025
…39131)

The OpenMP version is stored in LangOptions in SemanticsContext. Use the
fallback version where SemanticsContext is unavailable (mostly in case
of debug dumps).

RFC:
https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507

Reland with a fix for build break in f18-parse-demo.
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 9, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-8-cmake-build-only running on rocm-docker-rhel-8 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/8855

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[7271/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Support.cpp.o
[7272/7799] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/cmake_pch.hxx.gch
[7273/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Transformational.cpp.o
[7274/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7275/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o
[7276/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7277/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Reduction.cpp.o
[7278/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7279/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7280/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::__cxx11::string CompileFortran(std::__cxx11::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:224:64: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
             Fortran::common::LanguageFeature::BackslashEscapes));
                                                                ^
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
 void Unparse(llvm::raw_ostream &out, const A &root,
      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:245:64: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
             Fortran::common::LanguageFeature::BackslashEscapes));
                                                                ^
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
 void Unparse(llvm::raw_ostream &out, const A &root,
      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
cc1plus: warning: unrecognized command line option ‘-Wno-unnecessary-virtual-specifier’
[7281/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/constant.cpp.o
[7282/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/integer.cpp.o
[7283/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/static-data.cpp.o
[7284/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/logical.cpp.o
[7285/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/target.cpp.o
[7286/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/call.cpp.o
[7287/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/real.cpp.o
[7288/7799] Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[7271/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Support.cpp.o
[7272/7799] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/cmake_pch.hxx.gch
[7273/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Transformational.cpp.o
[7274/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7275/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/FIRBuilder.cpp.o
[7276/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7277/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Reduction.cpp.o
[7278/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7279/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7280/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::__cxx11::string CompileFortran(std::__cxx11::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:224:64: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
             Fortran::common::LanguageFeature::BackslashEscapes));
                                                                ^
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
 void Unparse(llvm::raw_ostream &out, const A &root,
      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:245:64: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
             Fortran::common::LanguageFeature::BackslashEscapes));
                                                                ^
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
 void Unparse(llvm::raw_ostream &out, const A &root,
      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
cc1plus: warning: unrecognized command line option ‘-Wno-unnecessary-virtual-specifier’
[7281/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/constant.cpp.o
[7282/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/integer.cpp.o
[7283/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/static-data.cpp.o
[7284/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/logical.cpp.o
[7285/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/target.cpp.o
[7286/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/call.cpp.o
[7287/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/real.cpp.o
[7288/7799] Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 9, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-9-cmake-build-only running on rocm-docker-rhel-9 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/205/builds/8833

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[7297/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/CUFCommon.cpp.o
[7298/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7299/7799] Building CXX object tools/flang/lib/Optimizer/Analysis/CMakeFiles/FIRAnalysis.dir/AliasAnalysis.cpp.o
[7300/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7301/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Reduction.cpp.o
[7302/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7303/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/expression.test.dir/expression.cpp.o
[7304/7799] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o
[7305/7799] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/SimplifyHLFIRIntrinsics.cpp.o
[7306/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::string CompileFortran(std::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[7307/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7308/7799] Building CXX object tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIROps.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[7297/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/CUFCommon.cpp.o
[7298/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7299/7799] Building CXX object tools/flang/lib/Optimizer/Analysis/CMakeFiles/FIRAnalysis.dir/AliasAnalysis.cpp.o
[7300/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7301/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Reduction.cpp.o
[7302/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7303/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/expression.test.dir/expression.cpp.o
[7304/7799] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o
[7305/7799] Building CXX object tools/flang/lib/Optimizer/HLFIR/Transforms/CMakeFiles/HLFIRTransforms.dir/SimplifyHLFIRIntrinsics.cpp.o
[7306/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::string CompileFortran(std::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[7307/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7308/7799] Building CXX object tools/flang/lib/Optimizer/Dialect/CMakeFiles/FIRDialect.dir/FIROps.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 9, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-ubuntu-22-cmake-build-only running on rocm-docker-ubu-22 while building flang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/10042

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[7283/7799] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/CUFGPUToLLVMConversion.cpp.o
[7284/7799] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/message.cpp.o
[7285/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7286/7799] Building CXX object tools/flang/lib/Optimizer/Analysis/CMakeFiles/FIRAnalysis.dir/AliasAnalysis.cpp.o
[7287/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/HLFIRTools.cpp.o
[7288/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7289/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7290/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/expression.test.dir/expression.cpp.o
[7291/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7292/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::string CompileFortran(std::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[7293/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/logical.cpp.o
[7294/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/integer.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[7283/7799] Building CXX object tools/flang/lib/Optimizer/Transforms/CMakeFiles/FIRTransforms.dir/CUFGPUToLLVMConversion.cpp.o
[7284/7799] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/message.cpp.o
[7285/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/folding.test.dir/folding.cpp.o
[7286/7799] Building CXX object tools/flang/lib/Optimizer/Analysis/CMakeFiles/FIRAnalysis.dir/AliasAnalysis.cpp.o
[7287/7799] Building CXX object tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/HLFIRTools.cpp.o
[7288/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/common.cpp.o
[7289/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/complex.cpp.o
[7290/7799] Building CXX object tools/flang/unittests/Evaluate/CMakeFiles/expression.test.dir/expression.cpp.o
[7291/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/host.cpp.o
[7292/7799] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -fpch-preprocess -O3 -DNDEBUG -fno-semantic-interposition  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp: In function ‘std::string CompileFortran(std::string, Fortran::parser::Options, DriverOptions&)’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:45: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |                                      ~~~~~~~^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:12: error: no matching function for call to ‘Unparse(llvm::raw_fd_ostream&, Fortran::parser::Program&, Fortran::parser::Encoding&, bool, bool)’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244 |         options.features.IsEnabled(
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |             Fortran::common::LanguageFeature::BackslashEscapes));
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/dump-parse-tree.h:16,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:25:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate: ‘template<class A> void Fortran::parser::Unparse(llvm::raw_ostream&, const A&, const Fortran::common::LangOptions&, Fortran::parser::Encoding, bool, bool, Fortran::parser::preStatementType*, Fortran::parser::AnalyzedObjectsAsFortran*)’
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note:   template argument deduction/substitution failed:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:42: note:   cannot convert ‘driver.DriverOptions::encoding’ (type ‘Fortran::parser::Encoding’) to type ‘const Fortran::common::LangOptions&’
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |                                   ~~~~~~~^~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[7293/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/logical.cpp.o
[7294/7799] Building CXX object tools/flang/lib/Evaluate/CMakeFiles/FortranEvaluate.dir/integer.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 10, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building flang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/27555

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
66.323 [98/21/6688] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/scope.cpp.o
66.324 [98/20/6689] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-do-forall.cpp.o
66.325 [98/19/6690] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/runtime-type-info.cpp.o
66.331 [98/18/6691] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names-utils.cpp.o
66.347 [98/17/6692] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/symbol.cpp.o
66.355 [98/16/6693] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/pointer-assignment.cpp.o
74.576 [98/15/6694] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/fc1_main.cpp.o
77.127 [98/14/6695] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o
85.943 [98/13/6696] Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
95.031 [98/12/6697] Building CXX object tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o
FAILED: tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/clang.19.1.7/bin/clang++ -DFLANG_INCLUDE_TESTS=1 -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/tools/f18-parse-demo -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/tools/f18-parse-demo -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/flang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/llvm/include -isystem /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/../mlir/include -isystem /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/mlir/include -isystem /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/clang/include -isystem /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -Xclang -fno-pch-timestamp -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -MF tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o.d -o tools/flang/tools/f18-parse-demo/CMakeFiles/f18-parse-demo.dir/f18-parse-demo.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:222:5: error: no matching function for call to 'Unparse'
  222 |     Unparse(llvm::outs(), parseTree, driver.encoding, true /*capitalize*/,
      |     ^~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate function template not viable: no known conversion from 'Fortran::parser::Encoding' to 'const common::LangOptions' for 3rd argument
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^
   54 |     const common::LangOptions &langOpts, Encoding encoding = Encoding::UTF_8,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/tools/f18-parse-demo/f18-parse-demo.cpp:243:5: error: no matching function for call to 'Unparse'
  243 |     Unparse(tmpSource, parseTree, driver.encoding, true /*capitalize*/,
      |     ^~~~~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/flang/include/flang/Parser/unparse.h:53:6: note: candidate function template not viable: no known conversion from 'Fortran::parser::Encoding' to 'const common::LangOptions' for 3rd argument
   53 | void Unparse(llvm::raw_ostream &out, const A &root,
      |      ^
   54 |     const common::LangOptions &langOpts, Encoding encoding = Encoding::UTF_8,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
110.700 [98/11/6698] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/cmake_pch.hxx.pch
117.087 [98/10/6699] Building CXX object tools/flang/tools/bbc/CMakeFiles/bbc.dir/bbc.cpp.o
125.393 [98/9/6700] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/tools.cpp.o
131.111 [98/8/6701] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/unparse.cpp.o
132.110 [98/7/6702] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/unparse-with-symbols.cpp.o
137.546 [98/6/6703] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/cmake_pch.hxx.pch
138.541 [98/5/6704] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/mod-file.cpp.o
160.017 [98/4/6705] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o
193.883 [98/3/6706] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-directives.cpp.o
253.208 [98/2/6707] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/expression.cpp.o
263.784 [98/1/6708] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-omp-structure.cpp.o
ninja: build stopped: subcommand failed.

@mgorny
Copy link
Member

mgorny commented May 10, 2025

I'm also seeing this failure, so I'm going to revert.

@mgorny
Copy link
Member

mgorny commented May 10, 2025

…or I'll try fixing it first, it seems to be a trivial case of missing include.

@mgorny
Copy link
Member

mgorny commented May 10, 2025

Filed #139371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants