@@ -61,9 +61,9 @@ static std::string escapeForRST(StringRef Str) {
61
61
return Result;
62
62
}
63
63
64
- static void EmitInstrDocs (RecordKeeper &RK, raw_ostream &OS) {
65
- CodeGenDAGPatterns CDP (RK);
66
- CodeGenTarget &Target = CDP.getTargetInfo ();
64
+ static void EmitInstrDocs (const RecordKeeper &RK, raw_ostream &OS) {
65
+ const CodeGenDAGPatterns CDP (RK);
66
+ const CodeGenTarget &Target = CDP.getTargetInfo ();
67
67
unsigned VariantCount = Target.getAsmParserVariantCount ();
68
68
69
69
// Page title.
@@ -86,7 +86,7 @@ static void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
86
86
// Assembly string(s).
87
87
if (!II->AsmString .empty ()) {
88
88
for (unsigned VarNum = 0 ; VarNum < VariantCount; ++VarNum) {
89
- Record *AsmVariant = Target.getAsmParserVariant (VarNum);
89
+ const Record *AsmVariant = Target.getAsmParserVariant (VarNum);
90
90
OS << " Assembly string" ;
91
91
if (VariantCount != 1 )
92
92
OS << " (" << AsmVariant->getValueAsString (" Name" ) << " )" ;
@@ -167,7 +167,7 @@ static void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
167
167
// names of both the compound operand and the basic operands it
168
168
// contains.
169
169
for (unsigned SubOpIdx = 0 ; SubOpIdx < Op.MINumOperands ; ++SubOpIdx) {
170
- Record *SubRec =
170
+ const Record *SubRec =
171
171
cast<DefInit>(Op.MIOperandInfo ->getArg (SubOpIdx))->getDef ();
172
172
StringRef SubOpName = Op.MIOperandInfo ->getArgNameStr (SubOpIdx);
173
173
StringRef SubOpTypeName = SubRec->getName ();
@@ -198,7 +198,7 @@ static void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
198
198
if (!II->ImplicitDefs .empty ()) {
199
199
OS << " Implicit defs: " ;
200
200
ListSeparator LS;
201
- for (Record *Def : II->ImplicitDefs )
201
+ for (const Record *Def : II->ImplicitDefs )
202
202
OS << LS << " ``" << Def->getName () << " ``" ;
203
203
OS << " \n\n " ;
204
204
}
@@ -207,18 +207,18 @@ static void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
207
207
if (!II->ImplicitUses .empty ()) {
208
208
OS << " Implicit uses: " ;
209
209
ListSeparator LS;
210
- for (Record *Use : II->ImplicitUses )
210
+ for (const Record *Use : II->ImplicitUses )
211
211
OS << LS << " ``" << Use->getName () << " ``" ;
212
212
OS << " \n\n " ;
213
213
}
214
214
215
215
// Predicates.
216
- std::vector<Record *> Predicates =
217
- II->TheDef ->getValueAsListOfDefs (" Predicates" );
216
+ std::vector<const Record *> Predicates =
217
+ II->TheDef ->getValueAsListOfConstDefs (" Predicates" );
218
218
if (!Predicates.empty ()) {
219
219
OS << " Predicates: " ;
220
220
ListSeparator LS;
221
- for (Record *P : Predicates)
221
+ for (const Record *P : Predicates)
222
222
OS << LS << " ``" << P->getName () << " ``" ;
223
223
OS << " \n\n " ;
224
224
}
0 commit comments