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())
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();
const GlobalValue * getGlobal() const
instr_iterator instr_end()
Target & getTheLanaiTarget()
MachineBasicBlock * getMBB() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void LLVMInitializeLanaiAsmPrinter()
Address of indexed Jump Table for switch.
MachineBasicBlock reference.
const char * getSymbolName() const
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
struct fuzzer::@269 Flags
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Name of external global symbol.
Reg
All possible values of the reg field in the ModR/M byte.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
Instances of this class represent a single low-level machine instruction.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
const MachineBasicBlock * getParent() const
Address of a global value.
LLVM Basic Block Representation.
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 unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
Address of a basic block.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const
Return true if the basic block has exactly one predecessor and the control transfer mechanism between...
self_iterator getIterator()
pred_iterator pred_begin()
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
#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)
Representation of each machine instruction.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
StringRef getName() const
getName - Get the symbol name.
MCSubtargetInfo - Generic base class for all target subtargets.
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
StringRef - Represent a constant reference to a string, i.e.
const BlockAddress * getBlockAddress() const
Address of indexed Constant in Constant Pool.