34 #define DEBUG_TYPE "asm-printer" 40 std::unique_ptr<MCStreamer> Streamer)
43 StringRef getPassName()
const override {
return "BPF Assembly Printer"; }
44 bool doInitialization(
Module &M)
override;
46 bool PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
47 unsigned AsmVariant,
const char *ExtraCode,
49 bool PrintAsmMemoryOperand(
const MachineInstr *MI,
unsigned OpNum,
50 unsigned AsmVariant,
const char *ExtraCode,
57 bool BPFAsmPrinter::doInitialization(
Module &M) {
60 if (MAI->doesSupportDebugInformation()) {
61 Handlers.push_back(HandlerInfo(
new BTFDebug(
this),
"emit",
62 "Debug Info Emission",
"BTF",
107 bool BPFAsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
110 if (ExtraCode && ExtraCode[0])
117 bool BPFAsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *MI,
118 unsigned OpNum,
unsigned AsmVariant,
119 const char *ExtraCode,
124 assert(BaseMO.isReg() &&
"Unexpected base pointer for inline asm memory operand.");
125 assert(OffsetMO.
isImm() &&
"Unexpected offset for inline asm memory operand.");
139 void BPFAsmPrinter::EmitInstruction(
const MachineInstr *MI) {
144 MCInstLowering.
Lower(MI, TmpInst);
145 EmitToStreamer(*OutStreamer, TmpInst);
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
MachineBasicBlock * getMBB() const
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
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.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
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.
const char * getSymbolName() const
zlib-gnu style compression
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.
const GlobalValue * getGlobal() const
Collect and emit BTF information.
MCSymbol * getSymbol(const GlobalValue *GV) const
This class is intended to be used as a driving class for all asm writers.
Address of a basic block.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void Lower(const MachineInstr *MI, MCInst &OutMI) const
MachineOperand class - Representation of each machine instruction operand.
This file contains support for writing BTF debug info.
static const char * getRegisterName(unsigned RegNo)
Representation of each machine instruction.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
const BlockAddress * getBlockAddress() const
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
StringRef getName() const
getName - Get the symbol name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Target & getTheBPFleTarget()
This class implements an extremely fast bulk output stream that can only output to a stream...
void LLVMInitializeBPFAsmPrinter()
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.
Target & getTheBPFbeTarget()
const MachineOperand & getOperand(unsigned i) const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Target & getTheBPFTarget()