[M68k][NFC] Coalesce render methods in different asm register op class

And assign RegClass (i.e. operand class for all GPR) as the super class
of ARegClass and DRegClass. Note that this is a NFC change because
actually we already had XRDReg to model either address or data register
operands (as well as test coverage for it). The new super class syntax
added here is just making the relations between three RegClass-es more
explicit.
This commit is contained in:
Min-Yih Hsu 2021-08-08 15:41:03 -07:00
parent 1a18bb9270
commit cf277f0b31
2 changed files with 4 additions and 8 deletions

View File

@ -153,12 +153,6 @@ public:
bool isDReg() const;
unsigned getReg() const override;
void addRegOperands(MCInst &Inst, unsigned N) const;
void addARegOperands(MCInst &Inst, unsigned N) const {
addRegOperands(Inst, N);
}
void addDRegOperands(MCInst &Inst, unsigned N) const {
addRegOperands(Inst, N);
}
static std::unique_ptr<M68kOperand> createMemOp(M68kMemOp MemOp, SMLoc Start,
SMLoc End);

View File

@ -176,8 +176,10 @@ def MxRegClass : MxOpClass<"Reg">;
// both ADD32dd and ADD32dr has {MCK_RegClass, MCK_RegClass} for
// their operands, which makes AsmParser unable to pick the correct
// one in a deterministic way.
def MxARegClass : MxOpClass<"AReg">;
def MxDRegClass : MxOpClass<"DReg">;
let RenderMethod = "addRegOperands", SuperClasses = [MxRegClass] in {
def MxARegClass : MxOpClass<"AReg">;
def MxDRegClass : MxOpClass<"DReg">;
}
class MxOperand<ValueType vt, MxSize size, string letter, RegisterClass rc, dag pat = (null_frag)> {
ValueType VT = vt;