33 #define DEBUG_TYPE "asm-printer" 36 "Number of RISC-V Compressed instructions emitted");
42 std::unique_ptr<MCStreamer> Streamer)
45 StringRef getPassName()
const override {
return "RISCV Assembly Printer"; }
55 bool emitPseudoExpansionLowering(
MCStreamer &OutStreamer,
65 #define GEN_COMPRESS_INSTR 66 #include "RISCVGenCompressInstEmitter.inc" 69 bool Res = compressInst(CInst, Inst, *
TM.getMCSubtargetInfo(),
70 OutStreamer->getContext());
72 ++RISCVNumInstrsCompressed;
78 #include "RISCVGenMCPseudoLowering.inc" 82 if (emitPseudoExpansionLowering(*OutStreamer, MI))
87 EmitToStreamer(*OutStreamer, TmpInst);
90 bool RISCVAsmPrinter::PrintAsmOperand(
const MachineInstr *MI,
unsigned OpNo,
97 if (ExtraCode && ExtraCode[0]) {
98 if (ExtraCode[1] != 0)
101 switch (ExtraCode[0]) {
125 PrintSymbolOperand(MO, OS);
139 bool RISCVAsmPrinter::PrintAsmMemoryOperand(
const MachineInstr *MI,
141 const char *ExtraCode,
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVAsmPrinter()
STATISTIC(NumFunctions, "Total number of functions")
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
static const char * getRegisterName(unsigned RegNo)
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 ...
Target & getTheRISCV32Target()
void LowerRISCVMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, const AsmPrinter &AP)
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.
Streaming machine code generation interface.
Target & getTheRISCV64Target()
This class is intended to be used as a driving class for all asm writers.
Address of a basic block.
MachineOperand class - Representation of each machine instruction operand.
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
#define LLVM_EXTERNAL_VISIBILITY
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
Representation of each machine instruction.
const BlockAddress * getBlockAddress() const
bool LowerRISCVMachineOperandToMCOperand(const MachineOperand &MO, MCOperand &MCOp, const AsmPrinter &AP)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.