@@ -17,15 +17,15 @@ namespace {
17
17
18
18
class Attributes {
19
19
public:
20
- Attributes (RecordKeeper &R) : Records(R) {}
20
+ Attributes (const RecordKeeper &R) : Records(R) {}
21
21
void run (raw_ostream &OS);
22
22
23
23
private:
24
24
void emitTargetIndependentNames (raw_ostream &OS);
25
25
void emitFnAttrCompatCheck (raw_ostream &OS, bool IsStringAttr);
26
26
void emitAttributeProperties (raw_ostream &OF);
27
27
28
- RecordKeeper &Records;
28
+ const RecordKeeper &Records;
29
29
};
30
30
31
31
} // End anonymous namespace.
@@ -85,10 +85,7 @@ void Attributes::emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr) {
85
85
<< " const Function &Callee) {\n " ;
86
86
OS << " bool Ret = true;\n\n " ;
87
87
88
- std::vector<Record *> CompatRules =
89
- Records.getAllDerivedDefinitions (" CompatRule" );
90
-
91
- for (auto *Rule : CompatRules) {
88
+ for (const Record *Rule : Records.getAllDerivedDefinitions (" CompatRule" )) {
92
89
StringRef FuncName = Rule->getValueAsString (" CompatFunc" );
93
90
OS << " Ret &= " << FuncName << " (Caller, Callee" ;
94
91
StringRef AttrName = Rule->getValueAsString (" AttrName" );
@@ -101,12 +98,10 @@ void Attributes::emitFnAttrCompatCheck(raw_ostream &OS, bool IsStringAttr) {
101
98
OS << " return Ret;\n " ;
102
99
OS << " }\n\n " ;
103
100
104
- std::vector<Record *> MergeRules =
105
- Records.getAllDerivedDefinitions (" MergeRule" );
106
101
OS << " static inline void mergeFnAttrs(Function &Caller,\n "
107
102
<< " const Function &Callee) {\n " ;
108
103
109
- for (auto *Rule : MergeRules ) {
104
+ for (const Record *Rule : Records. getAllDerivedDefinitions ( " MergeRule " ) ) {
110
105
StringRef FuncName = Rule->getValueAsString (" MergeFunc" );
111
106
OS << " " << FuncName << " (Caller, Callee);\n " ;
112
107
}
0 commit comments