15 #define DEBUG_TYPE "asm-printer"
45 virtual const char *getPassName()
const {
46 return "MSP430 Assembly Printer";
51 void printSrcMemOperand(
const MachineInstr *MI,
int OpNum,
53 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
54 unsigned AsmVariant,
const char *ExtraCode,
57 unsigned OpNo,
unsigned AsmVariant,
64 void MSP430AsmPrinter::printOperand(
const MachineInstr *
MI,
int OpNum,
73 if (!Modifier ||
strcmp(Modifier,
"nohash"))
81 bool isMemOp = Modifier && !
strcmp(Modifier,
"mem");
90 if (!Modifier ||
strcmp(Modifier,
"nohash"))
91 O << (isMemOp ?
'&' :
'#');
93 O <<
'(' << Offset <<
'+';
103 bool isMemOp = Modifier && !
strcmp(Modifier,
"mem");
104 O << (isMemOp ?
'&' :
'#');
111 void MSP430AsmPrinter::printSrcMemOperand(
const MachineInstr *MI,
int OpNum,
121 printOperand(MI, OpNum+1, O,
"nohash");
126 printOperand(MI, OpNum, O);
133 bool MSP430AsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
137 if (ExtraCode && ExtraCode[0])
140 printOperand(MI, OpNo, O);
144 bool MSP430AsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *MI,
145 unsigned OpNo,
unsigned AsmVariant,
146 const char *ExtraCode,
148 if (ExtraCode && ExtraCode[0]) {
151 printSrcMemOperand(MI, OpNo, O);
156 void MSP430AsmPrinter::EmitInstruction(
const MachineInstr *MI) {
160 MCInstLowering.Lower(MI, TmpInst);
161 OutStreamer.EmitInstruction(TmpInst);
int strcmp(const char *s1, const char *s2);
const GlobalValue * getGlobal() const
MachineBasicBlock * getMBB() const
static const char * getRegisterName(unsigned RegNo)
const char * getSymbolName() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define llvm_unreachable(msg)
const MachineOperand & getOperand(unsigned i) const
int64_t getOffset() const
void LLVMInitializeMSP430AsmPrinter()
MCSymbol * getSymbol() const
MachineOperandType getType() const
unsigned getReg() const
getReg - Returns the register number.
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
MachineBasicBlock reference.
Address of a global value.
Name of external global symbol.