LLVM: lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
20using namespace llvm;
21
22#define DEBUG_TYPE "loongarch-asm-printer"
23
24
25#define PRINT_ALIAS_INSTR
26#include "LoongArchGenAsmWriter.inc"
27
30 cl::desc("Disable the emission of assembler pseudo instructions"),
32
35 cl::desc("Print numeric register names rather than the ABI "
36 "names (such as r0insteadofr0 instead of r0insteadofzero)"),
38
39
40
41
42
43
45 if (Opt == "no-aliases") {
47 return true;
48 }
49
50 if (Opt == "numeric") {
52 return true;
53 }
54
55 return false;
56}
57
66
70
71void LoongArchInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
74 const MCOperand &MO = MI->getOperand(OpNo);
75
78 return;
79 }
80
83 return;
84 }
85
86 assert(MO.isExpr() && "Unknown operand kind in printOperand");
88}
89
93 const MCOperand &MO = MI->getOperand(OpNo);
94 assert(MO.isReg() && "printAtomicMemOp can only print register operands");
96}
97
99
101 : LoongArch::RegAliasName);
102}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static cl::opt< bool > NoAliases("csky-no-aliases", cl::desc("Disable the emission of assembler pseudo instructions"), cl::init(false), cl::Hidden)
static cl::opt< bool > NumericReg("loongarch-numeric-reg", cl::desc("Print numeric register names rather than the ABI " "names (such as r0insteadofr0 instead of r0insteadofzero)"), cl::init(false), cl::Hidden)
static cl::opt< bool > NoAliases("loongarch-no-aliases", cl::desc("Disable the emission of assembler pseudo instructions"), cl::init(false), cl::Hidden)
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, 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.
Definition LoongArchInstPrinter.cpp:58
bool applyTargetSpecificCLOption(StringRef Opt) override
Customize the printer according to a command line option.
Definition LoongArchInstPrinter.cpp:44
bool printAliasInstr(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
void printRegName(raw_ostream &O, MCRegister Reg) override
Print the assembler register name.
Definition LoongArchInstPrinter.cpp:67
static const char * getRegisterName(MCRegister Reg)
Definition LoongArchInstPrinter.cpp:98
void printAtomicMemOp(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
Definition LoongArchInstPrinter.cpp:90
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
bool PrintAliases
True if we prefer aliases (e.g. nop) to raw mnemonics.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.