mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Improve tblgen code cleanliness: create an unknown_class, from which the unknown def inherits. Make tblgen check for that class, rather than checking for the def itself.
llvm-svn: 163664
This commit is contained in:
parent
8aa2a6cbb7
commit
e42d2ba20d
@ -495,7 +495,8 @@ def ptr_rc : PointerLikeRegClass<0>;
|
||||
|
||||
/// unknown definition - Mark this operand as being of unknown type, causing
|
||||
/// it to be resolved by inference in the context it is used.
|
||||
def unknown;
|
||||
class unknown_class;
|
||||
def unknown : unknown_class;
|
||||
|
||||
/// AsmOperandClass - Representation for the kinds of operands which the target
|
||||
/// specific parser can create and the assembly matcher may need to distinguish.
|
||||
|
@ -1535,7 +1535,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
|
||||
const CodeGenRegisterClass &RC =
|
||||
CDP.getTargetInfo().getRegisterClass(RegClass);
|
||||
MadeChange |= UpdateNodeType(ResNo, RC.getValueTypes(), TP);
|
||||
} else if (ResultNode->getName() == "unknown") {
|
||||
} else if (ResultNode->isSubClassOf("unknown_class")) {
|
||||
// Nothing to do.
|
||||
} else {
|
||||
assert(ResultNode->isSubClassOf("RegisterClass") &&
|
||||
@ -1602,7 +1602,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
|
||||
MadeChange |= Child->UpdateNodeType(ChildResNo, VT, TP);
|
||||
} else if (OperandNode->isSubClassOf("PointerLikeRegClass")) {
|
||||
MadeChange |= Child->UpdateNodeType(ChildResNo, MVT::iPTR, TP);
|
||||
} else if (OperandNode->getName() == "unknown") {
|
||||
} else if (OperandNode->isSubClassOf("unknown_class")) {
|
||||
// Nothing to do.
|
||||
} else
|
||||
llvm_unreachable("Unknown operand type!");
|
||||
|
@ -101,7 +101,7 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) {
|
||||
} else if (Rec->isSubClassOf("RegisterClass")) {
|
||||
OperandType = "OPERAND_REGISTER";
|
||||
} else if (!Rec->isSubClassOf("PointerLikeRegClass") &&
|
||||
Rec->getName() != "unknown")
|
||||
!Rec->isSubClassOf("unknown_class"))
|
||||
throw "Unknown operand class '" + Rec->getName() +
|
||||
"' in '" + R->getName() + "' instruction!";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user