Reverse order of memory arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70734 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp
index fb64283..8fc5de6 100644
--- a/lib/Target/MSP430/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp
@@ -161,22 +161,22 @@
void MSP430AsmPrinter::printSrcMemOperand(const MachineInstr *MI, int OpNum,
const char* Modifier) {
- const MachineOperand &Disp = MI->getOperand(OpNum);
- const MachineOperand &Base = MI->getOperand(OpNum+1);
+ const MachineOperand &Base = MI->getOperand(OpNum);
+ const MachineOperand &Disp = MI->getOperand(OpNum+1);
- if (Disp.isGlobal())
+ if (Base.isGlobal())
printOperand(MI, OpNum, "mem");
else if (Disp.isImm() && !Base.getReg())
printOperand(MI, OpNum);
else if (Base.getReg()) {
if (Disp.getImm()) {
- printOperand(MI, OpNum, "nohash");
+ printOperand(MI, OpNum + 1, "nohash");
O << '(';
- printOperand(MI, OpNum + 1);
+ printOperand(MI, OpNum);
O << ')';
} else {
O << '@';
- printOperand(MI, OpNum + 1);
+ printOperand(MI, OpNum);
}
} else
assert(0 && "Unsupported memory operand");