@@ -237,7 +237,8 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
237
237
isCommutable = R->getValueAsBit (" isCommutable" );
238
238
isTerminator = R->getValueAsBit (" isTerminator" );
239
239
hasDelaySlot = R->getValueAsBit (" hasDelaySlot" );
240
-
240
+ hasVariableNumberOfOperands = false ;
241
+
241
242
try {
242
243
DagInit *DI = R->getValueAsDag (" OperandList" );
243
244
@@ -248,18 +249,20 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
248
249
MVT::ValueType Ty;
249
250
std::string PrintMethod = " printOperand" ;
250
251
unsigned NumOps = 1 ;
251
- if (Rec->isSubClassOf (" RegisterClass" ))
252
+ if (Rec->isSubClassOf (" RegisterClass" )) {
252
253
Ty = getValueType (Rec->getValueAsDef (" RegType" ));
253
- else if (Rec->isSubClassOf (" Operand" )) {
254
+ } else if (Rec->isSubClassOf (" Operand" )) {
254
255
Ty = getValueType (Rec->getValueAsDef (" Type" ));
255
256
PrintMethod = Rec->getValueAsString (" PrintMethod" );
256
257
NumOps = Rec->getValueAsInt (" NumMIOperands" );
258
+ } else if (Rec->getName () == " variable_ops" ) {
259
+ hasVariableNumberOfOperands = true ;
257
260
} else
258
261
throw " Unknown operand class '" + Rec->getName () +
259
262
" ' in instruction '" + R->getName () + " ' instruction!" ;
260
263
261
264
OperandList.push_back (OperandInfo (Rec, Ty, DI->getArgName (i),
262
- PrintMethod, MIOperandNo));
265
+ PrintMethod, MIOperandNo, NumOps ));
263
266
MIOperandNo += NumOps;
264
267
} else {
265
268
throw " Illegal operand for the '" + R->getName () + " ' instruction!" ;
0 commit comments