37 #define DEBUG_TYPE "asm-printer" 45 std::unique_ptr<MCStreamer> Streamer)
48 StringRef getPassName()
const override {
return "Lanai Assembly Printer"; }
51 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
52 unsigned AsmVariant,
const char *ExtraCode,
55 bool isBlockOnlyReachableByFallthrough(
96 O << MAI->getPrivateGlobalPrefix() <<
"JTI" << getFunctionNumber() <<
'_' 101 O << MAI->getPrivateGlobalPrefix() <<
"CPI" << getFunctionNumber() <<
'_' 111 bool LanaiAsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
115 if (ExtraCode && ExtraCode[0]) {
119 switch (ExtraCode[0]) {
125 if (!FlagsOP.
isImm())
127 unsigned Flags = FlagsOP.
getImm();
131 unsigned RegOp = OpNo + 1;
150 void LanaiAsmPrinter::emitCallInstruction(
const MachineInstr *MI) {
152 "Unsupported call function");
177 MCInstLowering.
Lower(MI, TmpInst);
179 OutStreamer->EmitInstruction(TmpInst, STI);
190 void LanaiAsmPrinter::customEmitInstruction(
const MachineInstr *MI) {
194 MCInstLowering.
Lower(MI, TmpInst);
195 OutStreamer->EmitInstruction(TmpInst, STI);
198 void LanaiAsmPrinter::EmitInstruction(
const MachineInstr *MI) {
204 emitCallInstruction(&*I);
208 customEmitInstruction(&*I);
209 }
while ((++I != E) && I->isInsideBundle());
216 bool LanaiAsmPrinter::isBlockOnlyReachableByFallthrough(
224 if (isa<SwitchInst>(
B->getTerminator()))
234 while (I != Pred->
begin() && !(--
I)->isTerminator()) {
237 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 ...
void LLVMInitializeLanaiAsmPrinter()
unsigned getReg() const
getReg - Returns the register number.
Address of indexed Jump Table for switch.
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 ...
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.
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.
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)
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.
const MachineOperand & getOperand(unsigned i) const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
void Lower(const MachineInstr *MI, MCInst &OutMI) const