@@ -672,7 +672,7 @@ const char *const inferReturnTypesParserCode = R"(
672672// / The code snippet used to generate a parser call for a region list.
673673// /
674674// / {0}: The name for the region list.
675- const char *regionListParserCode = R"(
675+ static const char *regionListParserCode = R"(
676676 {
677677 std::unique_ptr<::mlir::Region> region;
678678 auto firstRegionResult = parser.parseOptionalRegion(region);
@@ -695,23 +695,23 @@ const char *regionListParserCode = R"(
695695// / The code snippet used to ensure a list of regions have terminators.
696696// /
697697// / {0}: The name of the region list.
698- const char *regionListEnsureTerminatorParserCode = R"(
698+ static const char *regionListEnsureTerminatorParserCode = R"(
699699 for (auto ®ion : {0}Regions)
700700 ensureTerminator(*region, parser.getBuilder(), result.location);
701701)" ;
702702
703703// / The code snippet used to ensure a list of regions have a block.
704704// /
705705// / {0}: The name of the region list.
706- const char *regionListEnsureSingleBlockParserCode = R"(
706+ static const char *regionListEnsureSingleBlockParserCode = R"(
707707 for (auto ®ion : {0}Regions)
708708 if (region->empty()) region->emplaceBlock();
709709)" ;
710710
711711// / The code snippet used to generate a parser call for an optional region.
712712// /
713713// / {0}: The name of the region.
714- const char *optionalRegionParserCode = R"(
714+ static const char *optionalRegionParserCode = R"(
715715 {
716716 auto parseResult = parser.parseOptionalRegion(*{0}Region);
717717 if (parseResult.has_value() && failed(*parseResult))
@@ -722,29 +722,29 @@ const char *optionalRegionParserCode = R"(
722722// / The code snippet used to generate a parser call for a region.
723723// /
724724// / {0}: The name of the region.
725- const char *regionParserCode = R"(
725+ static const char *regionParserCode = R"(
726726 if (parser.parseRegion(*{0}Region))
727727 return ::mlir::failure();
728728)" ;
729729
730730// / The code snippet used to ensure a region has a terminator.
731731// /
732732// / {0}: The name of the region.
733- const char *regionEnsureTerminatorParserCode = R"(
733+ static const char *regionEnsureTerminatorParserCode = R"(
734734 ensureTerminator(*{0}Region, parser.getBuilder(), result.location);
735735)" ;
736736
737737// / The code snippet used to ensure a region has a block.
738738// /
739739// / {0}: The name of the region.
740- const char *regionEnsureSingleBlockParserCode = R"(
740+ static const char *regionEnsureSingleBlockParserCode = R"(
741741 if ({0}Region->empty()) {0}Region->emplaceBlock();
742742)" ;
743743
744744// / The code snippet used to generate a parser call for a successor list.
745745// /
746746// / {0}: The name for the successor list.
747- const char *successorListParserCode = R"(
747+ static const char *successorListParserCode = R"(
748748 {
749749 ::mlir::Block *succ;
750750 auto firstSucc = parser.parseOptionalSuccessor(succ);
@@ -766,15 +766,15 @@ const char *successorListParserCode = R"(
766766// / The code snippet used to generate a parser call for a successor.
767767// /
768768// / {0}: The name of the successor.
769- const char *successorParserCode = R"(
769+ static const char *successorParserCode = R"(
770770 if (parser.parseSuccessor({0}Successor))
771771 return ::mlir::failure();
772772)" ;
773773
774774// / The code snippet used to generate a parser for OIList
775775// /
776776// / {0}: literal keyword corresponding to a case for oilist
777- const char *oilistParserCode = R"(
777+ static const char *oilistParserCode = R"(
778778 if ({0}Clause) {
779779 return parser.emitError(parser.getNameLoc())
780780 << "`{0}` clause can appear at most once in the expansion of the "
@@ -1976,7 +1976,7 @@ void OperationFormat::genParserVariadicSegmentResolution(Operator &op,
19761976// operation that has the SingleBlockImplicitTerminator trait.
19771977// /
19781978// / {0}: The name of the region.
1979- const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
1979+ static const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
19801980 {
19811981 bool printTerminator = true;
19821982 if (auto *term = {0}.empty() ? nullptr : {0}.begin()->getTerminator()) {{
@@ -1994,7 +1994,7 @@ const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
19941994// /
19951995// / {0}: The name of the enum attribute.
19961996// / {1}: The name of the enum attributes symbolToString function.
1997- const char *enumAttrBeginPrinterCode = R"(
1997+ static const char *enumAttrBeginPrinterCode = R"(
19981998 {
19991999 auto caseValue = {0}();
20002000 auto caseValueStr = {1}(caseValue);
@@ -2386,8 +2386,8 @@ static void genOptionalGroupPrinterAnchor(FormatElement *anchor,
23862386 });
23872387}
23882388
2389- void collect (FormatElement *element,
2390- SmallVectorImpl<VariableElement *> &variables) {
2389+ static void collect (FormatElement *element,
2390+ SmallVectorImpl<VariableElement *> &variables) {
23912391 TypeSwitch<FormatElement *>(element)
23922392 .Case ([&](VariableElement *var) { variables.emplace_back (var); })
23932393 .Case ([&](CustomDirective *ele) {
0 commit comments