summaryrefslogtreecommitdiff
path: root/lib/Target/SystemZ/SystemZMCInstLower.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-12 09:08:12 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-12 09:08:12 +0000
commit5e009541973b7935386055066689902aa7134e2d (patch)
treeacfabe0cedf94afd85f196a8e6df8181829d1167 /lib/Target/SystemZ/SystemZMCInstLower.cpp
parent6cf3cfa0ab1da0c52730fec103bbc69eb0370081 (diff)
downloadllvm-5e009541973b7935386055066689902aa7134e2d.tar.gz
llvm-5e009541973b7935386055066689902aa7134e2d.tar.bz2
llvm-5e009541973b7935386055066689902aa7134e2d.tar.xz
[SystemZ] Fix parsing of inline asm registers
GPR and FPR constraints like "{r2}" and "{f2}" weren't handled correctly because the name-to-regno mapping depends on the value type and (because of that) the internal names in RegStrings are not the same as the AsmName. CC constraints like "{cc}" didn't work either because there was no associated register class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZMCInstLower.cpp')
-rw-r--r--lib/Target/SystemZ/SystemZMCInstLower.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Target/SystemZ/SystemZMCInstLower.cpp b/lib/Target/SystemZ/SystemZMCInstLower.cpp
index fd3f867015..432a0d30b6 100644
--- a/lib/Target/SystemZ/SystemZMCInstLower.cpp
+++ b/lib/Target/SystemZ/SystemZMCInstLower.cpp
@@ -57,9 +57,6 @@ MCOperand SystemZMCInstLower::lowerOperand(const MachineOperand &MO) const {
llvm_unreachable("unknown operand type");
case MachineOperand::MO_Register:
- // Ignore all implicit register operands.
- if (MO.isImplicit())
- return MCOperand();
return MCOperand::CreateReg(MO.getReg());
case MachineOperand::MO_Immediate:
@@ -104,8 +101,8 @@ void SystemZMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
OutMI.setOpcode(Opcode);
for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) {
const MachineOperand &MO = MI->getOperand(I);
- MCOperand MCOp = lowerOperand(MO);
- if (MCOp.isValid())
- OutMI.addOperand(MCOp);
+ // Ignore all implicit register operands.
+ if (!MO.isReg() || !MO.isImplicit())
+ OutMI.addOperand(lowerOperand(MO));
}
}