summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVladimir Medic <Vladimir.Medic@imgtec.com>2013-06-19 10:14:36 +0000
committerVladimir Medic <Vladimir.Medic@imgtec.com>2013-06-19 10:14:36 +0000
commitdd5fe2ffc6f564192876065d2617ecbc18d03f23 (patch)
treeb577f55bf0929cef0580a93d5aece1aa786b6cc8 /lib
parentf9326c248ad49a0bba3253d0473051b7094455c7 (diff)
downloadllvm-dd5fe2ffc6f564192876065d2617ecbc18d03f23.tar.gz
llvm-dd5fe2ffc6f564192876065d2617ecbc18d03f23.tar.bz2
llvm-dd5fe2ffc6f564192876065d2617ecbc18d03f23.tar.xz
The RenderMethod field in RegisterOperand class sets the name of the method on the target specific operand to call to add the target specific operand to an MCInst. This patch defines RenderMethod for mips RegisterOperand classes and removes redundant code from MipsAsmParser.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Mips/AsmParser/MipsAsmParser.cpp15
-rw-r--r--lib/Target/Mips/MipsRegisterInfo.td14
2 files changed, 10 insertions, 19 deletions
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index ab23d9fba6..e810480b89 100644
--- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -357,36 +357,23 @@ public:
bool isCPURegsAsm() const {
return Kind == k_Register && Reg.Kind == Kind_CPURegs;
}
- void addCPURegsAsmOperands(MCInst &Inst, unsigned N) const {
+ void addRegAsmOperands(MCInst &Inst, unsigned N) const {
Inst.addOperand(MCOperand::CreateReg(Reg.RegNum));
}
bool isCPU64RegsAsm() const {
return Kind == k_Register && Reg.Kind == Kind_CPU64Regs;
}
- void addCPU64RegsAsmOperands(MCInst &Inst, unsigned N) const {
- Inst.addOperand(MCOperand::CreateReg(Reg.RegNum));
- }
bool isHWRegsAsm() const {
assert((Kind == k_Register) && "Invalid access!");
return Reg.Kind == Kind_HWRegs;
}
- void addHWRegsAsmOperands(MCInst &Inst, unsigned N) const {
- Inst.addOperand(MCOperand::CreateReg(Reg.RegNum));
- }
bool isHW64RegsAsm() const {
assert((Kind == k_Register) && "Invalid access!");
return Reg.Kind == Kind_HW64Regs;
}
- void addHW64RegsAsmOperands(MCInst &Inst, unsigned N) const {
- Inst.addOperand(MCOperand::CreateReg(Reg.RegNum));
- }
-
- void addCCRAsmOperands(MCInst &Inst, unsigned N) const {
- Inst.addOperand(MCOperand::CreateReg(Reg.RegNum));
- }
bool isCCRAsm() const {
assert((Kind == k_Register) && "Invalid access!");
diff --git a/lib/Target/Mips/MipsRegisterInfo.td b/lib/Target/Mips/MipsRegisterInfo.td
index ad6912c557..d98cb2179b 100644
--- a/lib/Target/Mips/MipsRegisterInfo.td
+++ b/lib/Target/Mips/MipsRegisterInfo.td
@@ -388,17 +388,21 @@ def ACRegsDSP : RegisterClass<"Mips", [untyped], 64, (sequence "AC%u", 0, 3)> {
def DSPCC : RegisterClass<"Mips", [v4i8, v2i16], 32, (add DSPCCond)>;
// Register Operands.
-def CPURegsAsmOperand : AsmOperandClass {
+
+class MipsAsmRegOperand : AsmOperandClass {
+ let RenderMethod = "addRegAsmOperands";
+}
+def CPURegsAsmOperand : MipsAsmRegOperand {
let Name = "CPURegsAsm";
let ParserMethod = "parseCPURegs";
}
-def CPU64RegsAsmOperand : AsmOperandClass {
+def CPU64RegsAsmOperand : MipsAsmRegOperand {
let Name = "CPU64RegsAsm";
let ParserMethod = "parseCPU64Regs";
}
-def CCRAsmOperand : AsmOperandClass {
+def CCRAsmOperand : MipsAsmRegOperand {
let Name = "CCRAsm";
let ParserMethod = "parseCCRRegs";
}
@@ -415,12 +419,12 @@ def CCROpnd : RegisterOperand<CCR, "printCPURegs"> {
let ParserMatchClass = CCRAsmOperand;
}
-def HWRegsAsmOperand : AsmOperandClass {
+def HWRegsAsmOperand : MipsAsmRegOperand {
let Name = "HWRegsAsm";
let ParserMethod = "parseHWRegs";
}
-def HW64RegsAsmOperand : AsmOperandClass {
+def HW64RegsAsmOperand : MipsAsmRegOperand {
let Name = "HW64RegsAsm";
let ParserMethod = "parseHW64Regs";
}