TableGen: PointerLikeRegClass can be accepted to operand.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 26 Jan 2011 02:03:48 +0000 (02:03 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 26 Jan 2011 02:03:48 +0000 (02:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124271 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/EDEmitter.cpp

index e6e081f2d6b87b02f0e4ab0c7d708b66c74ded1b..d69a44bc29302ff5f8578172c8cc454dabd6121e 100644 (file)
@@ -94,7 +94,8 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) {
       isVariadic = true;
       continue;
     } else if (!Rec->isSubClassOf("RegisterClass") &&
-               Rec->getName() != "ptr_rc" && Rec->getName() != "unknown")
+               !Rec->isSubClassOf("PointerLikeRegClass") &&
+               Rec->getName() != "unknown")
       throw "Unknown operand class '" + Rec->getName() +
       "' in '" + R->getName() + "' instruction!";
 
index 353dbd6340cbfabbb971603e9d5f5268ca50f7e6..7051f2e0bc4d08da18ccba6e6ea855c7dd6740ac 100644 (file)
@@ -354,7 +354,8 @@ static void X86PopulateOperands(
     const CGIOperandList::OperandInfo &operandInfo = inst.Operands[index];
     Record &rec = *operandInfo.Rec;
 
-    if (X86TypeFromOpName(operandTypes[index], rec.getName())) {
+    if (X86TypeFromOpName(operandTypes[index], rec.getName()) &&
+        !rec.isSubClassOf("PointerLikeRegClass")) {
       errs() << "Operand type: " << rec.getName().c_str() << "\n";
       errs() << "Operand name: " << operandInfo.Name.c_str() << "\n";
       errs() << "Instruction name: " << inst.TheDef->getName().c_str() << "\n";