Teach tblgen about instruction operands that have multiple MachineInstr
[oota-llvm.git] / utils / TableGen / CodeGenTarget.cpp
index e85170d5a6e11ece7d58beb7937fe5de9f629a79..f0786e5f39e55d1299ebf55d9b3ffd1f4a3d9e00 100644 (file)
@@ -267,12 +267,14 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
     MVT::ValueType Ty;
     std::string PrintMethod = "printOperand";
     unsigned NumOps = 1;
+    DagInit *MIOpInfo;
     if (Rec->isSubClassOf("RegisterClass")) {
       Ty = getValueType(Rec->getValueAsDef("RegType"));
     } else if (Rec->isSubClassOf("Operand")) {
       Ty = getValueType(Rec->getValueAsDef("Type"));
       PrintMethod = Rec->getValueAsString("PrintMethod");
       NumOps = Rec->getValueAsInt("NumMIOperands");
+      MIOpInfo = Rec->getValueAsDag("MIOperandInfo");
     } else if (Rec->getName() == "variable_ops") {
       hasVariableNumberOfOperands = true;
       continue;
@@ -289,7 +291,8 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
         " has the same name as a previous operand!";
     
     OperandList.push_back(OperandInfo(Rec, Ty, DI->getArgName(i),
-                                      PrintMethod, MIOperandNo, NumOps));
+                                      PrintMethod, MIOperandNo, NumOps,
+                                      MIOpInfo));
     MIOperandNo += NumOps;
   }
 }