summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2018-11-08 16:21:29 +0000
committerDavide Italiano <davide@freebsd.org>2018-11-08 16:21:29 +0000
commitac8279ab8bbfd0e1af2c4815391aaf90cf548a33 (patch)
treebf4562a310e73952c15fc13d783c5e7c29aa7cc8 /llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
parent692b34790f34521f34bb8697f5c8465d8914a862 (diff)
downloadbcm5719-llvm-ac8279ab8bbfd0e1af2c4815391aaf90cf548a33.tar.gz
bcm5719-llvm-ac8279ab8bbfd0e1af2c4815391aaf90cf548a33.zip
Revert "[MSP430] Add MC layer"
This commit broke the module buildbots. Error: lib/Target/MSP430/MSP430GenAsmMatcher.inc:1027:1: error: redundant namespace 'llvm' [-Wmodules-import-nested-redundant] ^ llvm-svn: 346410
Diffstat (limited to 'llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp')
-rw-r--r--llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp36
1 files changed, 7 insertions, 29 deletions
diff --git a/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp b/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
index 4d62547bc65..be6d1a84a37 100644
--- a/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
+++ b/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
@@ -16,34 +16,28 @@
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
-#include "llvm/MC/MCInstrInfo.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
using namespace llvm;
#define DEBUG_TYPE "asm-printer"
+
// Include the auto-generated portion of the assembly writer.
-#define PRINT_ALIAS_INSTR
#include "MSP430GenAsmWriter.inc"
void MSP430InstPrinter::printInst(const MCInst *MI, raw_ostream &O,
StringRef Annot, const MCSubtargetInfo &STI) {
- if (!printAliasInstr(MI, O))
- printInstruction(MI, O);
+ printInstruction(MI, O);
printAnnotation(O, Annot);
}
void MSP430InstPrinter::printPCRelImmOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O) {
const MCOperand &Op = MI->getOperand(OpNo);
- if (Op.isImm()) {
- int64_t Imm = Op.getImm() * 2 + 2;
- O << "$";
- if (Imm >= 0)
- O << '+';
- O << Imm;
- } else {
+ if (Op.isImm())
+ O << Op.getImm();
+ else {
assert(Op.isExpr() && "unknown pcrel immediate operand");
Op.getExpr()->print(O, &MAI);
}
@@ -78,7 +72,7 @@ void MSP430InstPrinter::printSrcMemOperand(const MCInst *MI, unsigned OpNo,
// vs
// mov.w glb(r1), r2
// Otherwise (!) msp430-as will silently miscompile the output :(
- if (Base.getReg() == MSP430::SR)
+ if (!Base.getReg())
O << '&';
if (Disp.isExpr())
@@ -89,23 +83,10 @@ void MSP430InstPrinter::printSrcMemOperand(const MCInst *MI, unsigned OpNo,
}
// Print register base field
- if ((Base.getReg() != MSP430::SR) &&
- (Base.getReg() != MSP430::PC))
+ if (Base.getReg())
O << '(' << getRegisterName(Base.getReg()) << ')';
}
-void MSP430InstPrinter::printIndRegOperand(const MCInst *MI, unsigned OpNo,
- raw_ostream &O) {
- const MCOperand &Base = MI->getOperand(OpNo);
- O << "@" << getRegisterName(Base.getReg());
-}
-
-void MSP430InstPrinter::printPostIndRegOperand(const MCInst *MI, unsigned OpNo,
- raw_ostream &O) {
- const MCOperand &Base = MI->getOperand(OpNo);
- O << "@" << getRegisterName(Base.getReg()) << "+";
-}
-
void MSP430InstPrinter::printCCOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O) {
unsigned CC = MI->getOperand(OpNo).getImm();
@@ -131,8 +112,5 @@ void MSP430InstPrinter::printCCOperand(const MCInst *MI, unsigned OpNo,
case MSP430CC::COND_L:
O << 'l';
break;
- case MSP430CC::COND_N:
- O << 'n';
- break;
}
}
OpenPOWER on IntegriCloud