@@ -139,7 +139,7 @@ void PredicateExpander::expandCheckOpcode(raw_ostream &OS, const Record *Inst) {
139
139
}
140
140
141
141
void PredicateExpander::expandCheckOpcode (raw_ostream &OS,
142
- const RecVec & Opcodes) {
142
+ ArrayRef< const Record *> Opcodes) {
143
143
assert (!Opcodes.empty () && " Expected at least one opcode to check!" );
144
144
bool First = true ;
145
145
@@ -169,16 +169,15 @@ void PredicateExpander::expandCheckOpcode(raw_ostream &OS,
169
169
}
170
170
171
171
void PredicateExpander::expandCheckPseudo (raw_ostream &OS,
172
- const RecVec & Opcodes) {
172
+ ArrayRef< const Record *> Opcodes) {
173
173
if (shouldExpandForMC ())
174
174
expandFalse (OS);
175
175
else
176
176
expandCheckOpcode (OS, Opcodes);
177
177
}
178
178
179
- void PredicateExpander::expandPredicateSequence (raw_ostream &OS,
180
- const RecVec &Sequence,
181
- bool IsCheckAll) {
179
+ void PredicateExpander::expandPredicateSequence (
180
+ raw_ostream &OS, ArrayRef<const Record *> Sequence, bool IsCheckAll) {
182
181
assert (!Sequence.empty () && " Found an invalid empty predicate set!" );
183
182
if (Sequence.size () == 1 )
184
183
return expandPredicate (OS, Sequence[0 ]);
@@ -267,8 +266,7 @@ void PredicateExpander::expandReturnStatement(raw_ostream &OS,
267
266
268
267
void PredicateExpander::expandOpcodeSwitchCase (raw_ostream &OS,
269
268
const Record *Rec) {
270
- const RecVec &Opcodes = Rec->getValueAsListOfDefs (" Opcodes" );
271
- for (const Record *Opcode : Opcodes) {
269
+ for (const Record *Opcode : Rec->getValueAsListOfDefs (" Opcodes" )) {
272
270
OS.indent (getIndentLevel () * 2 );
273
271
OS << " case " << Opcode->getValueAsString (" Namespace" )
274
272
<< " ::" << Opcode->getName () << " :\n " ;
@@ -280,9 +278,8 @@ void PredicateExpander::expandOpcodeSwitchCase(raw_ostream &OS,
280
278
decreaseIndentLevel ();
281
279
}
282
280
283
- void PredicateExpander::expandOpcodeSwitchStatement (raw_ostream &OS,
284
- const RecVec &Cases,
285
- const Record *Default) {
281
+ void PredicateExpander::expandOpcodeSwitchStatement (
282
+ raw_ostream &OS, ArrayRef<const Record *> Cases, const Record *Default) {
286
283
std::string Buffer;
287
284
raw_string_ostream SS (Buffer);
288
285
@@ -310,7 +307,7 @@ void PredicateExpander::expandOpcodeSwitchStatement(raw_ostream &OS,
310
307
void PredicateExpander::expandStatement (raw_ostream &OS, const Record *Rec) {
311
308
// Assume that padding has been added by the caller.
312
309
if (Rec->isSubClassOf (" MCOpcodeSwitchStatement" )) {
313
- expandOpcodeSwitchStatement (OS, Rec->getValueAsListOfDefs (" Cases" ),
310
+ expandOpcodeSwitchStatement (OS, Rec->getValueAsListOfConstDefs (" Cases" ),
314
311
Rec->getValueAsDef (" DefaultCase" ));
315
312
return ;
316
313
}
@@ -461,13 +458,13 @@ void STIPredicateExpander::expandHeader(raw_ostream &OS,
461
458
462
459
void STIPredicateExpander::expandPrologue (raw_ostream &OS,
463
460
const STIPredicateFunction &Fn) {
464
- RecVec Delegates = Fn.getDeclaration ()->getValueAsListOfDefs (" Delegates" );
465
461
bool UpdatesOpcodeMask =
466
462
Fn.getDeclaration ()->getValueAsBit (" UpdatesOpcodeMask" );
467
463
468
464
increaseIndentLevel ();
469
465
unsigned IndentLevel = getIndentLevel ();
470
- for (const Record *Delegate : Delegates) {
466
+ for (const Record *Delegate :
467
+ Fn.getDeclaration ()->getValueAsListOfDefs (" Delegates" )) {
471
468
OS.indent (IndentLevel * 2 );
472
469
OS << " if (" << Delegate->getValueAsString (" Name" ) << " (MI" ;
473
470
if (UpdatesOpcodeMask)
0 commit comments