37 #define DEBUG_TYPE "asm-printer"
42 MSP430AsmPrinter(
TargetMachine &
TM, std::unique_ptr<MCStreamer> Streamer)
45 const char *getPassName()
const override {
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,
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 <<
'+';
105 void MSP430AsmPrinter::printSrcMemOperand(
const MachineInstr *MI,
int OpNum,
127 bool MSP430AsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
131 if (ExtraCode && ExtraCode[0])
138 bool MSP430AsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *MI,
139 unsigned OpNo,
unsigned AsmVariant,
140 const char *ExtraCode,
142 if (ExtraCode && ExtraCode[0]) {
145 printSrcMemOperand(MI, OpNo, O);
150 void MSP430AsmPrinter::EmitInstruction(
const MachineInstr *MI) {
154 MCInstLowering.Lower(MI, TmpInst);
155 EmitToStreamer(*OutStreamer, TmpInst);
const GlobalValue * getGlobal() const
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
MachineBasicBlock * getMBB() const
static const char * getRegisterName(unsigned RegNo)
MachineBasicBlock reference.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static void printOperand(raw_ostream &OS, uint8_t Opcode, unsigned OperandIdx, uint64_t Operand, uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor)
Print Opcode's operand number OperandIdx which has value Operand.
MSP430MCInstLower - This class is used to lower an MachineInstr into an MCInst.
Instances of this class represent a single low-level machine instruction.
Address of a global value.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const MachineOperand & getOperand(unsigned i) const
This class is intended to be used as a driving class for all asm writers.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
int64_t getOffset() const
Return the offset from the symbol in this operand.
void LLVMInitializeMSP430AsmPrinter()
MCSymbol * getSymbol() const
getSymbol - Return the MCSymbol for this basic block.
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
Representation of each machine instruction.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
unsigned getReg() const
getReg - Returns the register number.
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.