@@ -1821,9 +1821,9 @@ CreateSemanticSpellings(const std::vector<FlattenedSpelling> &Spellings,
1821
1821
return Ret;
1822
1822
}
1823
1823
1824
- void WriteSemanticSpellingSwitch (StringRef VarName,
1825
- const SemanticSpellingMap &Map,
1826
- raw_ostream &OS) {
1824
+ static void WriteSemanticSpellingSwitch (StringRef VarName,
1825
+ const SemanticSpellingMap &Map,
1826
+ raw_ostream &OS) {
1827
1827
OS << " switch (" << VarName << " ) {\n default: "
1828
1828
<< " llvm_unreachable(\" Unknown spelling list index\" );\n " ;
1829
1829
for (const auto &I : Map)
@@ -2367,12 +2367,12 @@ template <typename Fn> static void forEachSpelling(const Record &Attr, Fn &&F) {
2367
2367
}
2368
2368
}
2369
2369
2370
- std::map<StringRef, std::vector<const Record *>> NameToAttrsMap;
2370
+ static std::map<StringRef, std::vector<const Record *>> NameToAttrsMap;
2371
2371
2372
2372
// / Build a map from the attribute name to the Attrs that use that name. If more
2373
2373
// / than one Attr use a name, the arguments could be different so a more complex
2374
2374
// / check is needed in the generated switch.
2375
- void generateNameToAttrsMap (const RecordKeeper &Records) {
2375
+ static void generateNameToAttrsMap (const RecordKeeper &Records) {
2376
2376
for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
2377
2377
for (const FlattenedSpelling &S : GetFlattenedSpellings (*A)) {
2378
2378
auto [It, Inserted] = NameToAttrsMap.try_emplace (S.name ());
@@ -3965,9 +3965,9 @@ void EmitClangAttrASTVisitor(const RecordKeeper &Records, raw_ostream &OS) {
3965
3965
OS << " #endif // ATTR_VISITOR_DECLS_ONLY\n " ;
3966
3966
}
3967
3967
3968
- void EmitClangAttrTemplateInstantiateHelper (ArrayRef< const Record *> Attrs,
3969
- raw_ostream &OS ,
3970
- bool AppliesToDecl) {
3968
+ static void
3969
+ EmitClangAttrTemplateInstantiateHelper (ArrayRef< const Record *> Attrs ,
3970
+ raw_ostream &OS, bool AppliesToDecl) {
3971
3971
3972
3972
OS << " switch (At->getKind()) {\n " ;
3973
3973
for (const auto *Attr : Attrs) {
@@ -4622,7 +4622,7 @@ static bool isParamExpr(const Record *Arg) {
4622
4622
.Default (false );
4623
4623
}
4624
4624
4625
- void GenerateIsParamExpr (const Record &Attr, raw_ostream &OS) {
4625
+ static void GenerateIsParamExpr (const Record &Attr, raw_ostream &OS) {
4626
4626
OS << " bool isParamExpr(size_t N) const override {\n " ;
4627
4627
OS << " return " ;
4628
4628
auto Args = Attr.getValueAsListOfDefs (" Args" );
@@ -4633,8 +4633,8 @@ void GenerateIsParamExpr(const Record &Attr, raw_ostream &OS) {
4633
4633
OS << " }\n\n " ;
4634
4634
}
4635
4635
4636
- void GenerateHandleAttrWithDelayedArgs (const RecordKeeper &Records,
4637
- raw_ostream &OS) {
4636
+ static void GenerateHandleAttrWithDelayedArgs (const RecordKeeper &Records,
4637
+ raw_ostream &OS) {
4638
4638
OS << " static void handleAttrWithDelayedArgs(Sema &S, Decl *D, " ;
4639
4639
OS << " const ParsedAttr &Attr) {\n " ;
4640
4640
OS << " SmallVector<Expr *, 4> ArgExprs;\n " ;
0 commit comments