mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Start parsing more information from the Operand information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -132,19 +132,26 @@ CodeGenInstruction::CodeGenInstruction(Record *R) : TheDef(R) {
|
||||
try {
|
||||
DagInit *DI = R->getValueAsDag("OperandList");
|
||||
|
||||
unsigned MIOperandNo = 0;
|
||||
for (unsigned i = 0, e = DI->getNumArgs(); i != e; ++i)
|
||||
if (DefInit *Arg = dynamic_cast<DefInit*>(DI->getArg(i))) {
|
||||
Record *Rec = Arg->getDef();
|
||||
MVT::ValueType Ty;
|
||||
std::string PrintMethod = "printOperand";
|
||||
unsigned NumOps = 1;
|
||||
if (Rec->isSubClassOf("RegisterClass"))
|
||||
Ty = getValueType(Rec->getValueAsDef("RegType"));
|
||||
else if (Rec->isSubClassOf("Operand"))
|
||||
else if (Rec->isSubClassOf("Operand")) {
|
||||
Ty = getValueType(Rec->getValueAsDef("Type"));
|
||||
else
|
||||
PrintMethod = Rec->getValueAsString("PrintMethod");
|
||||
NumOps = Rec->getValueAsInt("NumMIOperands");
|
||||
} else
|
||||
throw "Unknown operand class '" + Rec->getName() +
|
||||
"' in instruction '" + R->getName() + "' instruction!";
|
||||
|
||||
OperandList.push_back(OperandInfo(Rec, Ty, DI->getArgName(i)));
|
||||
OperandList.push_back(OperandInfo(Rec, Ty, DI->getArgName(i),
|
||||
PrintMethod, MIOperandNo));
|
||||
MIOperandNo += NumOps;
|
||||
} else {
|
||||
throw "Illegal operand for the '" + R->getName() + "' instruction!";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user