@@ -139,7 +139,7 @@ void PredicateExpander::expandCheckOpcode(raw_ostream &OS, const Record *Inst) {
139139}
140140
141141void PredicateExpander::expandCheckOpcode (raw_ostream &OS,
142- const RecVec & Opcodes) {
142+ ArrayRef< const Record *> Opcodes) {
143143 assert (!Opcodes.empty () && " Expected at least one opcode to check!" );
144144 bool First = true ;
145145
@@ -169,16 +169,15 @@ void PredicateExpander::expandCheckOpcode(raw_ostream &OS,
169169}
170170
171171void PredicateExpander::expandCheckPseudo (raw_ostream &OS,
172- const RecVec & Opcodes) {
172+ ArrayRef< const Record *> Opcodes) {
173173 if (shouldExpandForMC ())
174174 expandFalse (OS);
175175 else
176176 expandCheckOpcode (OS, Opcodes);
177177}
178178
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) {
182181 assert (!Sequence.empty () && " Found an invalid empty predicate set!" );
183182 if (Sequence.size () == 1 )
184183 return expandPredicate (OS, Sequence[0 ]);
@@ -267,8 +266,7 @@ void PredicateExpander::expandReturnStatement(raw_ostream &OS,
267266
268267void PredicateExpander::expandOpcodeSwitchCase (raw_ostream &OS,
269268 const Record *Rec) {
270- const RecVec &Opcodes = Rec->getValueAsListOfDefs (" Opcodes" );
271- for (const Record *Opcode : Opcodes) {
269+ for (const Record *Opcode : Rec->getValueAsListOfDefs (" Opcodes" )) {
272270 OS.indent (getIndentLevel () * 2 );
273271 OS << " case " << Opcode->getValueAsString (" Namespace" )
274272 << " ::" << Opcode->getName () << " :\n " ;
@@ -280,9 +278,8 @@ void PredicateExpander::expandOpcodeSwitchCase(raw_ostream &OS,
280278 decreaseIndentLevel ();
281279}
282280
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) {
286283 std::string Buffer;
287284 raw_string_ostream SS (Buffer);
288285
@@ -310,7 +307,7 @@ void PredicateExpander::expandOpcodeSwitchStatement(raw_ostream &OS,
310307void PredicateExpander::expandStatement (raw_ostream &OS, const Record *Rec) {
311308 // Assume that padding has been added by the caller.
312309 if (Rec->isSubClassOf (" MCOpcodeSwitchStatement" )) {
313- expandOpcodeSwitchStatement (OS, Rec->getValueAsListOfDefs (" Cases" ),
310+ expandOpcodeSwitchStatement (OS, Rec->getValueAsListOfConstDefs (" Cases" ),
314311 Rec->getValueAsDef (" DefaultCase" ));
315312 return ;
316313 }
@@ -461,13 +458,13 @@ void STIPredicateExpander::expandHeader(raw_ostream &OS,
461458
462459void STIPredicateExpander::expandPrologue (raw_ostream &OS,
463460 const STIPredicateFunction &Fn) {
464- RecVec Delegates = Fn.getDeclaration ()->getValueAsListOfDefs (" Delegates" );
465461 bool UpdatesOpcodeMask =
466462 Fn.getDeclaration ()->getValueAsBit (" UpdatesOpcodeMask" );
467463
468464 increaseIndentLevel ();
469465 unsigned IndentLevel = getIndentLevel ();
470- for (const Record *Delegate : Delegates) {
466+ for (const Record *Delegate :
467+ Fn.getDeclaration ()->getValueAsListOfDefs (" Delegates" )) {
471468 OS.indent (IndentLevel * 2 );
472469 OS << " if (" << Delegate->getValueAsString (" Name" ) << " (MI" ;
473470 if (UpdatesOpcodeMask)
0 commit comments