@@ -672,7 +672,7 @@ const char *const inferReturnTypesParserCode = R"(
672
672
// / The code snippet used to generate a parser call for a region list.
673
673
// /
674
674
// / {0}: The name for the region list.
675
- const char *regionListParserCode = R"(
675
+ static const char *regionListParserCode = R"(
676
676
{
677
677
std::unique_ptr<::mlir::Region> region;
678
678
auto firstRegionResult = parser.parseOptionalRegion(region);
@@ -695,23 +695,23 @@ const char *regionListParserCode = R"(
695
695
// / The code snippet used to ensure a list of regions have terminators.
696
696
// /
697
697
// / {0}: The name of the region list.
698
- const char *regionListEnsureTerminatorParserCode = R"(
698
+ static const char *regionListEnsureTerminatorParserCode = R"(
699
699
for (auto ®ion : {0}Regions)
700
700
ensureTerminator(*region, parser.getBuilder(), result.location);
701
701
)" ;
702
702
703
703
// / The code snippet used to ensure a list of regions have a block.
704
704
// /
705
705
// / {0}: The name of the region list.
706
- const char *regionListEnsureSingleBlockParserCode = R"(
706
+ static const char *regionListEnsureSingleBlockParserCode = R"(
707
707
for (auto ®ion : {0}Regions)
708
708
if (region->empty()) region->emplaceBlock();
709
709
)" ;
710
710
711
711
// / The code snippet used to generate a parser call for an optional region.
712
712
// /
713
713
// / {0}: The name of the region.
714
- const char *optionalRegionParserCode = R"(
714
+ static const char *optionalRegionParserCode = R"(
715
715
{
716
716
auto parseResult = parser.parseOptionalRegion(*{0}Region);
717
717
if (parseResult.has_value() && failed(*parseResult))
@@ -722,29 +722,29 @@ const char *optionalRegionParserCode = R"(
722
722
// / The code snippet used to generate a parser call for a region.
723
723
// /
724
724
// / {0}: The name of the region.
725
- const char *regionParserCode = R"(
725
+ static const char *regionParserCode = R"(
726
726
if (parser.parseRegion(*{0}Region))
727
727
return ::mlir::failure();
728
728
)" ;
729
729
730
730
// / The code snippet used to ensure a region has a terminator.
731
731
// /
732
732
// / {0}: The name of the region.
733
- const char *regionEnsureTerminatorParserCode = R"(
733
+ static const char *regionEnsureTerminatorParserCode = R"(
734
734
ensureTerminator(*{0}Region, parser.getBuilder(), result.location);
735
735
)" ;
736
736
737
737
// / The code snippet used to ensure a region has a block.
738
738
// /
739
739
// / {0}: The name of the region.
740
- const char *regionEnsureSingleBlockParserCode = R"(
740
+ static const char *regionEnsureSingleBlockParserCode = R"(
741
741
if ({0}Region->empty()) {0}Region->emplaceBlock();
742
742
)" ;
743
743
744
744
// / The code snippet used to generate a parser call for a successor list.
745
745
// /
746
746
// / {0}: The name for the successor list.
747
- const char *successorListParserCode = R"(
747
+ static const char *successorListParserCode = R"(
748
748
{
749
749
::mlir::Block *succ;
750
750
auto firstSucc = parser.parseOptionalSuccessor(succ);
@@ -766,15 +766,15 @@ const char *successorListParserCode = R"(
766
766
// / The code snippet used to generate a parser call for a successor.
767
767
// /
768
768
// / {0}: The name of the successor.
769
- const char *successorParserCode = R"(
769
+ static const char *successorParserCode = R"(
770
770
if (parser.parseSuccessor({0}Successor))
771
771
return ::mlir::failure();
772
772
)" ;
773
773
774
774
// / The code snippet used to generate a parser for OIList
775
775
// /
776
776
// / {0}: literal keyword corresponding to a case for oilist
777
- const char *oilistParserCode = R"(
777
+ static const char *oilistParserCode = R"(
778
778
if ({0}Clause) {
779
779
return parser.emitError(parser.getNameLoc())
780
780
<< "`{0}` clause can appear at most once in the expansion of the "
@@ -1976,7 +1976,7 @@ void OperationFormat::genParserVariadicSegmentResolution(Operator &op,
1976
1976
// operation that has the SingleBlockImplicitTerminator trait.
1977
1977
// /
1978
1978
// / {0}: The name of the region.
1979
- const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
1979
+ static const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
1980
1980
{
1981
1981
bool printTerminator = true;
1982
1982
if (auto *term = {0}.empty() ? nullptr : {0}.begin()->getTerminator()) {{
@@ -1994,7 +1994,7 @@ const char *regionSingleBlockImplicitTerminatorPrinterCode = R"(
1994
1994
// /
1995
1995
// / {0}: The name of the enum attribute.
1996
1996
// / {1}: The name of the enum attributes symbolToString function.
1997
- const char *enumAttrBeginPrinterCode = R"(
1997
+ static const char *enumAttrBeginPrinterCode = R"(
1998
1998
{
1999
1999
auto caseValue = {0}();
2000
2000
auto caseValueStr = {1}(caseValue);
@@ -2386,8 +2386,8 @@ static void genOptionalGroupPrinterAnchor(FormatElement *anchor,
2386
2386
});
2387
2387
}
2388
2388
2389
- void collect (FormatElement *element,
2390
- SmallVectorImpl<VariableElement *> &variables) {
2389
+ static void collect (FormatElement *element,
2390
+ SmallVectorImpl<VariableElement *> &variables) {
2391
2391
TypeSwitch<FormatElement *>(element)
2392
2392
.Case ([&](VariableElement *var) { variables.emplace_back (var); })
2393
2393
.Case ([&](CustomDirective *ele) {
0 commit comments