24 #define DEBUG_TYPE "asm-printer"
27 #include "BPFGenAsmWriter.inc"
39 if (
const MCBinaryExpr *BE = dyn_cast<MCBinaryExpr>(Expr))
43 assert(SRE &&
"Unexpected MCExpr type.");
54 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
58 }
else if (Op.
isImm()) {
61 assert(Op.
isExpr() &&
"Expected an expression");
67 const char *Modifier) {
74 assert(0 &&
"Expected an immediate");
77 assert(RegOp.
isReg() &&
"Register operand not a register");
85 O << (uint64_t)Op.
getImm();
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.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr)
unsigned getReg() const
Returns the register number.
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
Instances of this class represent a single low-level machine instruction.
const MCExpr * getExpr() const
void printMemOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
Binary assembler expressions.
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static void printExpr(const MCExpr *Expr, raw_ostream &O)
static const char * getRegisterName(unsigned RegNo)
MCSubtargetInfo - Generic base class for all target subtargets.
const ARM::ArchExtKind Kind
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.
const MCOperand & getOperand(unsigned i) const