37 #define DEBUG_TYPE "asm-printer" 42 MSP430AsmPrinter(
TargetMachine &
TM, std::unique_ptr<MCStreamer> Streamer)
45 StringRef getPassName()
const override {
return "MSP430 Assembly Printer"; }
49 void printSrcMemOperand(
const MachineInstr *MI,
int OpNum,
51 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
52 unsigned AsmVariant,
const char *ExtraCode,
55 unsigned OpNo,
unsigned AsmVariant,
71 if (!Modifier || strcmp(Modifier,
"nohash"))
79 bool isMemOp = Modifier && !strcmp(Modifier,
"mem");
88 if (!Modifier || strcmp(Modifier,
"nohash"))
89 O << (isMemOp ?
'&' :
'#');
91 O <<
'(' << Offset <<
'+';
103 void MSP430AsmPrinter::printSrcMemOperand(
const MachineInstr *MI,
int OpNum,
125 bool MSP430AsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
129 if (ExtraCode && ExtraCode[0])
136 bool MSP430AsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *MI,
137 unsigned OpNo,
unsigned AsmVariant,
138 const char *ExtraCode,
140 if (ExtraCode && ExtraCode[0]) {
143 printSrcMemOperand(MI, OpNo, O);
148 void MSP430AsmPrinter::EmitInstruction(
const MachineInstr *MI) {
152 MCInstLowering.
Lower(MI, TmpInst);
153 EmitToStreamer(*OutStreamer, TmpInst);
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Target & getTheMSP430Target()
MachineBasicBlock * getMBB() const
Compute iterated dominance frontiers using a linear time algorithm.
static const char * getRegisterName(unsigned RegNo)
unsigned getReg() const
getReg - Returns the register number.
MachineBasicBlock reference.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
MSP430MCInstLower - This class is used to lower an MachineInstr into an MCInst.
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
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 GlobalValue * getGlobal() const
This class is intended to be used as a driving class for all asm writers.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
void LLVMInitializeMSP430AsmPrinter()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
void Lower(const MachineInstr *MI, MCInst &OutMI) const
Representation of each machine instruction.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
int64_t getOffset() const
Return the offset from the symbol in this operand.
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
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.
StringRef - Represent a constant reference to a string, i.e.
const MachineOperand & getOperand(unsigned i) const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.