diff options
| author | Anton Korobeynikov <anton@korobeynikov.info> | 2019-01-25 09:14:05 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <anton@korobeynikov.info> | 2019-01-25 09:14:05 +0000 |
| commit | 509d5c4a7dcc22320fe9b277cd53585cc7d02a36 (patch) | |
| tree | 4e099569f1734242b8c13eca36a1643b586fb412 /llvm/lib/Target/MSP430 | |
| parent | 58f6bc509b365aa8516acc03c85b5d0712cf4af6 (diff) | |
| download | bcm5719-llvm-509d5c4a7dcc22320fe9b277cd53585cc7d02a36.tar.gz bcm5719-llvm-509d5c4a7dcc22320fe9b277cd53585cc7d02a36.zip | |
[MSP430] Fix absolute addressing mode printing in AsmPrinter
Align checks for absolute addressing mode with its current
implementation (SR is used as a base register).
This fixes https://bugs.llvm.org/show_bug.cgi?id=39993
Patch by Kristina Bessonova!
Differential Revision: https://reviews.llvm.org/D56785
llvm-svn: 352178
Diffstat (limited to 'llvm/lib/Target/MSP430')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp b/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp index fda42106ba2..4a3f58d6735 100644 --- a/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -113,12 +113,12 @@ void MSP430AsmPrinter::printSrcMemOperand(const MachineInstr *MI, int OpNum, // Print displacement first // Imm here is in fact global address - print extra modifier. - if (Disp.isImm() && !Base.getReg()) + if (Disp.isImm() && Base.getReg() == MSP430::SR) O << '&'; printOperand(MI, OpNum+1, O, "nohash"); // Print register base field - if (Base.getReg()) { + if (Base.getReg() != MSP430::SR && Base.getReg() != MSP430::PC) { O << '('; printOperand(MI, OpNum, O); O << ')'; |

