28#define DEBUG_TYPE "m68k-asm-printer"
37void M68kAsmPrinter::printOperand(
const MachineInstr *
MI,
int OpNum,
70 if (!ExtraCode || !ExtraCode[0]) {
71 printOperand(
MI, OpNo,
OS);
79void M68kAsmPrinter::printDisp(
const MachineInstr *
MI,
unsigned opNum,
89 printOperand(
MI, opNum, O);
92void M68kAsmPrinter::printAbsMem(
const MachineInstr *
MI,
unsigned OpNum,
102 unsigned OpNo,
const char *ExtraCode,
109 using namespace M68k;
113 switch (
static_cast<MemAddrModeKind
>(MO.
getImm())) {
114 case MemAddrModeKind::j:
117 case MemAddrModeKind::o:
120 case MemAddrModeKind::e:
123 case MemAddrModeKind::p:
126 case MemAddrModeKind::f:
127 case MemAddrModeKind::F:
130 case MemAddrModeKind::k:
133 case MemAddrModeKind::q:
136 case MemAddrModeKind::b:
137 printAbsMem(
MI, OpNo,
OS);
164 M68k_MC::verifyInstructionPredicates(
MI->getOpcode(),
167 switch (
MI->getOpcode()) {
169 if (
MI->isPseudo()) {
171 <<
") found in EmitInstruction()\n");
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_EXTERNAL_VISIBILITY
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kAsmPrinter()
This file contains M68k assembler printer declarations.
This file contains declarations for an M68k MCInst printer.
This file declares the M68k specific subclass of MachineFunctionInfo.
This file contains the entry points for global functions defined in the M68k target library,...
virtual void PrintSymbolOperand(const MachineOperand &MO, raw_ostream &OS)
Print the MachineOperand as a symbol.
const MCAsmInfo * MAI
Target Asm Printer information.
MachineFunction * MF
The current machine function.
unsigned getFunctionNumber() const
Return a unique ID for the current function.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
const DataLayout & getDataLayout() const
Return information about data layout.
const MCSubtargetInfo & getSubtargetInfo() const
Return information about subtarget.
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
This class represents an Operation in the Expression.
A parsed version of the target data layout string in and methods for querying it.
void emitFunctionBodyStart() override
Targets can override this to emit stuff before the first basic block in the function.
virtual bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
void emitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
void emitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
void emitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
std::unique_ptr< M68kMCInstLower > MCInstLowering
void emitFunctionBodyEnd() override
Targets can override this to emit stuff after the last basic block in the function.
const M68kMachineFunctionInfo * MMFI
static const char * getRegisterName(MCRegister Reg)
void printARIDMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &O)
void printPCDMem(const MachineInstr *MI, uint64_t Address, unsigned OpNum, raw_ostream &O)
void printPCIMem(const MachineInstr *MI, uint64_t Address, unsigned OpNum, raw_ostream &O)
void printARIPDMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &O)
void printARIPIMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &O)
void printARIIMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &O)
void printARIMem(const MachineInstr *MI, unsigned OpNum, raw_ostream &O)
Instances of this class represent a single low-level machine instruction.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineBasicBlock * getMBB() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
const BlockAddress * getBlockAddress() const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Register getReg() const
getReg - Returns the register number.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_BlockAddress
Address of a basic block.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
A Module instance is used to store all the information related to an LLVM module.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static bool isAddressRegister(unsigned RegNo)
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Target & getTheM68kTarget()
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...