@@ -50,20 +50,20 @@ class Hierarchy {
50
50
link (Derived, Base);
51
51
for (NodeType &N : AllTypes) {
52
52
sort (N.Derived , [](const NodeType *L, const NodeType *R) {
53
- return L->Record ->getName () < R->Record ->getName ();
53
+ return L->Rec ->getName () < R->Rec ->getName ();
54
54
});
55
55
// Alternatives nodes must have subclasses, External nodes may do.
56
- assert (N.Record ->isSubClassOf (" Alternatives" ) ||
57
- N.Record ->isSubClassOf (" External" ) || N.Derived .empty ());
58
- assert (!N.Record ->isSubClassOf (" Alternatives" ) || !N.Derived .empty ());
56
+ assert (N.Rec ->isSubClassOf (" Alternatives" ) ||
57
+ N.Rec ->isSubClassOf (" External" ) || N.Derived .empty ());
58
+ assert (!N.Rec ->isSubClassOf (" Alternatives" ) || !N.Derived .empty ());
59
59
}
60
60
}
61
61
62
62
struct NodeType {
63
- const Record *Record = nullptr ;
63
+ const Record *Rec = nullptr ;
64
64
const NodeType *Base = nullptr ;
65
65
std::vector<const NodeType *> Derived;
66
- StringRef name () const { return Record ->getName (); }
66
+ StringRef name () const { return Rec ->getName (); }
67
67
};
68
68
69
69
NodeType &get (StringRef Name = " Node" ) {
@@ -85,7 +85,7 @@ class Hierarchy {
85
85
private:
86
86
void add (const Record *R) {
87
87
AllTypes.emplace_back ();
88
- AllTypes.back ().Record = R;
88
+ AllTypes.back ().Rec = R;
89
89
bool Inserted = ByName.try_emplace (R->getName (), &AllTypes.back ()).second ;
90
90
assert (Inserted && " Duplicate node name" );
91
91
(void )Inserted;
@@ -200,9 +200,9 @@ void clang::EmitClangSyntaxNodeClasses(const RecordKeeper &Records,
200
200
201
201
OS << " \n // Node definitions\n\n " ;
202
202
H.visit ([&](const Hierarchy::NodeType &N) {
203
- if (N.Record ->isSubClassOf (" External" ))
203
+ if (N.Rec ->isSubClassOf (" External" ))
204
204
return ;
205
- printDoc (N.Record ->getValueAsString (" documentation" ), OS);
205
+ printDoc (N.Rec ->getValueAsString (" documentation" ), OS);
206
206
OS << formatv (" class {0}{1} : public {2} {{\n " , N.name (),
207
207
N.Derived .empty () ? " final" : " " , N.Base ->name ());
208
208
@@ -214,9 +214,9 @@ void clang::EmitClangSyntaxNodeClasses(const RecordKeeper &Records,
214
214
OS << formatv (" protected:\n {0}(NodeKind K) : {1}(K) {{}\n public:\n " ,
215
215
N.name (), N.Base ->name ());
216
216
217
- if (N.Record ->isSubClassOf (" Sequence" )) {
217
+ if (N.Rec ->isSubClassOf (" Sequence" )) {
218
218
// Getters for sequence elements.
219
- for (const auto &C : N.Record ->getValueAsListOfDefs (" children" )) {
219
+ for (const auto &C : N.Rec ->getValueAsListOfDefs (" children" )) {
220
220
assert (C->isSubClassOf (" Role" ));
221
221
StringRef Role = C->getValueAsString (" role" );
222
222
SyntaxConstraint Constraint (*C->getValueAsDef (" syntax" ));
0 commit comments