28 #define DEBUG_TYPE "mccodeemitter"
30 STATISTIC(MCNumEmitted,
"Number of MC instructions emitted");
34 RISCVMCCodeEmitter(
const RISCVMCCodeEmitter &) =
delete;
35 void operator=(
const RISCVMCCodeEmitter &) =
delete;
39 RISCVMCCodeEmitter(
MCContext &ctx) : Ctx(ctx) {}
41 ~RISCVMCCodeEmitter()
override {}
49 uint64_t getBinaryCodeForInstr(
const MCInst &
MI,
64 return new RISCVMCCodeEmitter(Ctx);
82 return Ctx.getRegisterInfo()->getEncodingValue(MO.
getReg());
85 return static_cast<unsigned>(MO.
getImm());
91 #include "RISCVGenMCCodeEmitter.inc"
STATISTIC(NumFunctions,"Total number of functions")
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
MCCodeEmitter * createRISCVMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
Context object for machine code objects.
unsigned getReg() const
Returns the register number.
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
unsigned const MachineRegisterInfo * MRI
MCCodeEmitter - Generic instruction encoding interface.
Interface to description of machine instruction set.
static void write(bool isBE, void *P, T V)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MCSubtargetInfo - Generic base class for all target subtargets.
This class implements an extremely fast bulk output stream that can only output to a stream...
Instances of this class represent operands of the MCInst class.