38 #define DEBUG_TYPE "asm-printer" 46 std::unique_ptr<MCStreamer> Streamer)
49 StringRef getPassName()
const override {
return "Lanai Assembly Printer"; }
52 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
55 bool isBlockOnlyReachableByFallthrough(
96 O << MAI->getPrivateGlobalPrefix() <<
"JTI" << getFunctionNumber() <<
'_' 101 O << MAI->getPrivateGlobalPrefix() <<
"CPI" << getFunctionNumber() <<
'_' 111 bool LanaiAsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
114 if (ExtraCode && ExtraCode[0]) {
118 switch (ExtraCode[0]) {
124 if (!FlagsOP.
isImm())
126 unsigned Flags = FlagsOP.
getImm();
130 unsigned RegOp = OpNo + 1;
149 void LanaiAsmPrinter::emitCallInstruction(
const MachineInstr *MI) {
151 "Unsupported call function");
176 MCInstLowering.
Lower(MI, TmpInst);
178 OutStreamer->EmitInstruction(TmpInst, STI);
189 void LanaiAsmPrinter::customEmitInstruction(
const MachineInstr *MI) {
193 MCInstLowering.
Lower(MI, TmpInst);
194 OutStreamer->EmitInstruction(TmpInst, STI);
197 void LanaiAsmPrinter::EmitInstruction(
const MachineInstr *MI) {
203 emitCallInstruction(&*I);
207 customEmitInstruction(&*I);
208 }
while ((++I != E) && I->isInsideBundle());
215 bool LanaiAsmPrinter::isBlockOnlyReachableByFallthrough(
223 if (isa<SwitchInst>(
B->getTerminator()))
233 while (I != Pred->
begin() && !(--
I)->isTerminator()) {
236 return !I->isBarrier();
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
instr_iterator instr_end()
MachineBasicBlock * getMBB() const
This class represents lattice values for constants.
Target & getTheLanaiTarget()
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Address of indexed Jump Table for switch.
MachineBasicBlock reference.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLanaiAsmPrinter()
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
unsigned getNumOperands() const
Retuns the total number of operands.
Name of external global symbol.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const char * getSymbolName() const
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
Instances of this class represent a single low-level machine instruction.
Address of a global value.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
LLVM Basic Block Representation.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const GlobalValue * getGlobal() const
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const
Return true if the basic block has exactly one predecessor and the control transfer mechanism between...
This class is intended to be used as a driving class for all asm writers.
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
Address of a basic block.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
self_iterator getIterator()
pred_iterator pred_begin()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Iterator for intrusive lists based on ilist_node.
void setOpcode(unsigned Op)
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
static const char * getRegisterName(unsigned RegNo)
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...
#define LLVM_EXTERNAL_VISIBILITY
static unsigned makePreOp(unsigned AluOp)
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
const BlockAddress * getBlockAddress() const
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Generic base class for all target subtargets.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
StringRef getName() const
getName - Get the symbol name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
Address of indexed Constant in Constant Pool.
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Wrapper class representing virtual and physical registers.
void Lower(const MachineInstr *MI, MCInst &OutMI) const