Go to the documentation of this file.
22 #define DEBUG_TYPE "asm-printer"
25 #include "BPFGenAsmWriter.inc"
38 if (
const MCBinaryExpr *BE = dyn_cast<MCBinaryExpr>(Expr))
39 SRE = dyn_cast<MCSymbolRefExpr>(BE->getLHS());
41 SRE = dyn_cast<MCSymbolRefExpr>(Expr);
42 assert(SRE &&
"Unexpected MCExpr type.");
53 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
57 }
else if (
Op.isImm()) {
60 assert(
Op.isExpr() &&
"Expected an expression");
66 const char *Modifier) {
68 const MCOperand &OffsetOp =
MI->getOperand(OpNo + 1);
71 assert(RegOp.
isReg() &&
"Register operand not a register");
75 if (OffsetOp.
isImm()) {
76 auto Imm = OffsetOp.
getImm();
82 assert(0 &&
"Expected an immediate");
101 int16_t Imm =
Op.getImm();
102 O << ((Imm >= 0) ?
"+" :
"") <<
formatImm(Imm);
103 }
else if (
Op.isExpr()) {
VariantKind getKind() const
This class represents lattice values for constants.
Instances of this class represent a single low-level machine instruction.
Binary assembler expressions.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
static const char * getRegisterName(unsigned RegNo)
This class implements an extremely fast bulk output stream that can only output to a stream.
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
static void printExpr(const MCExpr *Expr, raw_ostream &O)
void printBrTargetOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr)
Represent a reference to a symbol from inside an expression.
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
StringRef - Represent a constant reference to a string, i.e.
void printImm64Operand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
Instances of this class represent operands of the MCInst class.
Generic base class for all target subtargets.
Base class for the full range of assembler expressions which are needed for parsing.
unsigned getReg() const
Returns the register number.