23 #define DEBUG_TYPE "asm-printer" 26 #include "BPFGenAsmWriter.inc" 38 if (
const MCBinaryExpr *BE = dyn_cast<MCBinaryExpr>(Expr))
42 assert(SRE &&
"Unexpected MCExpr type.");
53 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
57 }
else if (Op.
isImm()) {
66 const char *Modifier) {
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);
This class represents lattice values for constants.
void printInstruction(const MCInst *MI, raw_ostream &O)
void printImm64Operand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Base class for the full range of assembler expressions which are needed for parsing.
Represent a reference to a symbol from inside an expression.
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
unsigned getReg() const
Returns the register number.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr)
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
Binary assembler expressions.
const MCOperand & getOperand(unsigned i) const
static void printExpr(const MCExpr *Expr, raw_ostream &O)
static const char * getRegisterName(unsigned RegNo)
Generic base class for all target subtargets.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void printBrTargetOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Instances of this class represent operands of the MCInst class.