@@ -41,11 +41,12 @@ using llvm::formatv;
41
41
// stable and useful way, where abstract Node subclasses correspond to ranges.
42
42
class Hierarchy {
43
43
public:
44
- Hierarchy (llvm::RecordKeeper &Records) {
45
- for (llvm::Record *T : Records.getAllDerivedDefinitions (" NodeType" ))
44
+ Hierarchy (const llvm::RecordKeeper &Records) {
45
+ for (const llvm::Record *T : Records.getAllDerivedDefinitions (" NodeType" ))
46
46
add (T);
47
- for (llvm::Record *Derived : Records.getAllDerivedDefinitions (" NodeType" ))
48
- if (llvm::Record *Base = Derived->getValueAsOptionalDef (" base" ))
47
+ for (const llvm::Record *Derived :
48
+ Records.getAllDerivedDefinitions (" NodeType" ))
49
+ if (const llvm::Record *Base = Derived->getValueAsOptionalDef (" base" ))
49
50
link (Derived, Base);
50
51
for (NodeType &N : AllTypes) {
51
52
llvm::sort (N.Derived , [](const NodeType *L, const NodeType *R) {
@@ -127,7 +128,7 @@ struct SyntaxConstraint {
127
128
128
129
} // namespace
129
130
130
- void clang::EmitClangSyntaxNodeList (llvm::RecordKeeper &Records,
131
+ void clang::EmitClangSyntaxNodeList (const llvm::RecordKeeper &Records,
131
132
llvm::raw_ostream &OS) {
132
133
llvm::emitSourceFileHeader (" Syntax tree node list" , OS, Records);
133
134
Hierarchy H (Records);
@@ -186,7 +187,7 @@ static void printDoc(llvm::StringRef Doc, llvm::raw_ostream &OS) {
186
187
}
187
188
}
188
189
189
- void clang::EmitClangSyntaxNodeClasses (llvm::RecordKeeper &Records,
190
+ void clang::EmitClangSyntaxNodeClasses (const llvm::RecordKeeper &Records,
190
191
llvm::raw_ostream &OS) {
191
192
llvm::emitSourceFileHeader (" Syntax tree node list" , OS, Records);
192
193
Hierarchy H (Records);
0 commit comments