mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-21 02:29:22 +00: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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2c699706c
commit
83c0eefa3b
@ -495,7 +495,8 @@ def ptr_rc : PointerLikeRegClass<0>;
|
|||||||
|
|
||||||
/// unknown definition - Mark this operand as being of unknown type, causing
|
/// unknown definition - Mark this operand as being of unknown type, causing
|
||||||
/// it to be resolved by inference in the context it is used.
|
/// 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
|
/// AsmOperandClass - Representation for the kinds of operands which the target
|
||||||
/// specific parser can create and the assembly matcher may need to distinguish.
|
/// 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 =
|
const CodeGenRegisterClass &RC =
|
||||||
CDP.getTargetInfo().getRegisterClass(RegClass);
|
CDP.getTargetInfo().getRegisterClass(RegClass);
|
||||||
MadeChange |= UpdateNodeType(ResNo, RC.getValueTypes(), TP);
|
MadeChange |= UpdateNodeType(ResNo, RC.getValueTypes(), TP);
|
||||||
} else if (ResultNode->getName() == "unknown") {
|
} else if (ResultNode->isSubClassOf("unknown_class")) {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
} else {
|
} else {
|
||||||
assert(ResultNode->isSubClassOf("RegisterClass") &&
|
assert(ResultNode->isSubClassOf("RegisterClass") &&
|
||||||
@ -1602,7 +1602,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
|
|||||||
MadeChange |= Child->UpdateNodeType(ChildResNo, VT, TP);
|
MadeChange |= Child->UpdateNodeType(ChildResNo, VT, TP);
|
||||||
} else if (OperandNode->isSubClassOf("PointerLikeRegClass")) {
|
} else if (OperandNode->isSubClassOf("PointerLikeRegClass")) {
|
||||||
MadeChange |= Child->UpdateNodeType(ChildResNo, MVT::iPTR, TP);
|
MadeChange |= Child->UpdateNodeType(ChildResNo, MVT::iPTR, TP);
|
||||||
} else if (OperandNode->getName() == "unknown") {
|
} else if (OperandNode->isSubClassOf("unknown_class")) {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
} else
|
} else
|
||||||
llvm_unreachable("Unknown operand type!");
|
llvm_unreachable("Unknown operand type!");
|
||||||
|
@ -101,7 +101,7 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) {
|
|||||||
} else if (Rec->isSubClassOf("RegisterClass")) {
|
} else if (Rec->isSubClassOf("RegisterClass")) {
|
||||||
OperandType = "OPERAND_REGISTER";
|
OperandType = "OPERAND_REGISTER";
|
||||||
} else if (!Rec->isSubClassOf("PointerLikeRegClass") &&
|
} else if (!Rec->isSubClassOf("PointerLikeRegClass") &&
|
||||||
Rec->getName() != "unknown")
|
!Rec->isSubClassOf("unknown_class"))
|
||||||
throw "Unknown operand class '" + Rec->getName() +
|
throw "Unknown operand class '" + Rec->getName() +
|
||||||
"' in '" + R->getName() + "' instruction!";
|
"' in '" + R->getName() + "' instruction!";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user