LLVM 20.0.0git
|
#include "Target/CSKY/MCTargetDesc/CSKYInstPrinter.h"
Static Public Member Functions | |
static const char * | getRegisterName (MCRegister Reg) |
static const char * | getRegisterName (MCRegister Reg, unsigned AltIdx) |
Additional Inherited Members | |
Public Types inherited from llvm::MCInstPrinter | |
enum class | Markup { Immediate , Register , Target , Memory } |
Protected Member Functions inherited from llvm::MCInstPrinter | |
void | printAnnotation (raw_ostream &OS, StringRef Annot) |
Utility function for printing annotations. | |
const char * | matchAliasPatterns (const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M) |
Helper for matching MCInsts to alias patterns when printing instructions. | |
Protected Attributes inherited from llvm::MCInstPrinter | |
raw_ostream * | CommentStream = nullptr |
A stream that comments can be emitted to if desired. | |
const MCAsmInfo & | MAI |
const MCInstrInfo & | MII |
const MCRegisterInfo & | MRI |
const MCInstrAnalysis * | MIA = nullptr |
bool | UseMarkup = false |
True if we are printing marked up assembly. | |
bool | UseColor = false |
True if we are printing colored assembly. | |
bool | PrintAliases = true |
True if we prefer aliases (e.g. nop) to raw mnemonics. | |
bool | PrintImmHex = false |
True if we are printing immediates as hex. | |
HexStyle::Style | PrintHexStyle = HexStyle::C |
Which style to use for printing hexadecimal values. | |
bool | PrintBranchImmAsAddress = false |
If true, a branch immediate (e.g. | |
bool | SymbolizeOperands = false |
If true, symbolize branch target and memory reference operands. | |
Definition at line 21 of file CSKYInstPrinter.h.
|
inline |
Definition at line 26 of file CSKYInstPrinter.h.
Customize the printer according to a command line option.
Reimplemented from llvm::MCInstPrinter.
Definition at line 54 of file CSKYInstPrinter.cpp.
References ArchRegNames, llvm::DebugFlag, and NoAliases.
|
overridevirtual |
Returns a pair containing the mnemonic for MI
and the number of bits left for further processing by printInstruction (generated by tablegen).
Implements llvm::MCInstPrinter.
|
static |
Definition at line 263 of file CSKYInstPrinter.cpp.
References ArchRegNames, and getRegisterName().
Referenced by getRegisterName(), llvm::CSKYAsmPrinter::PrintAsmMemoryOperand(), llvm::CSKYAsmPrinter::PrintAsmOperand(), printFPRRegName(), and printRegName().
|
static |
bool llvm::CSKYInstPrinter::printAliasInstr | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void CSKYInstPrinter::printConstpool | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 159 of file CSKYInstPrinter.cpp.
References llvm::Address, assert(), llvm::MCInstPrinter::formatHex(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::MAI, MI, llvm::MCExpr::print(), and llvm::MCInstPrinter::PrintBranchImmAsAddress.
void CSKYInstPrinter::printCSKYSymbolOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 182 of file CSKYInstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::MCOperand::getImm(), llvm::MCOperand::isImm(), MI, llvm::MCInstPrinter::PrintBranchImmAsAddress, and printOperand().
void llvm::CSKYInstPrinter::printCustomAliasOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpIdx, | ||
unsigned | PrintMethodIdx, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
void CSKYInstPrinter::printDataSymbol | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 146 of file CSKYInstPrinter.cpp.
References llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::MAI, MI, and llvm::MCExpr::print().
void CSKYInstPrinter::printFPR | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 268 of file CSKYInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, and printFPRRegName().
void CSKYInstPrinter::printFPRRegName | ( | raw_ostream & | O, |
unsigned | RegNo | ||
) | const |
Definition at line 93 of file CSKYInstPrinter.cpp.
References getRegisterName(), and llvm::MCInstPrinter::PrintBranchImmAsAddress.
Referenced by printFPR().
|
overridevirtual |
Print the specified MCInst to the specified raw_ostream.
Address
the address of current instruction on most targets, used to print a PC relative immediate as the target address. On targets where a PC relative immediate is relative to the next instruction and the length of a MCInst is difficult to measure (e.g. x86), this is the address of the next instruction. If Address is 0, the immediate will be printed.
Implements llvm::MCInstPrinter.
Definition at line 75 of file CSKYInstPrinter.cpp.
References llvm::Address, MI, NoAliases, printAliasInstr(), llvm::MCInstPrinter::printAnnotation(), and printInstruction().
void llvm::CSKYInstPrinter::printInstruction | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void CSKYInstPrinter::printOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O, | ||
const char * | Modifier = nullptr |
||
) |
Definition at line 100 of file CSKYInstPrinter.cpp.
References llvm::CSKYII::AddrModeMask, llvm::CSKYII::AddrModeNone, ArchRegNames, assert(), llvm::MCInstPrinter::formatHex(), llvm::MCInstrInfo::get(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCOperand::getReg(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), llvm::MCInstPrinter::MAI, MI, llvm::MCInstPrinter::MII, llvm::MCExpr::print(), llvm::MCInstPrinter::PrintBranchImmAsAddress, printRegName(), and llvm::MCInstrDesc::TSFlags.
Referenced by printCSKYSymbolOperand().
void CSKYInstPrinter::printPSRFlag | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 200 of file CSKYInstPrinter.cpp.
References MI.
void CSKYInstPrinter::printRegisterList | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 224 of file CSKYInstPrinter.cpp.
References MI, llvm::Offset, and printRegName().
void CSKYInstPrinter::printRegisterSeq | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 216 of file CSKYInstPrinter.cpp.
References MI, and printRegName().
|
overridevirtual |
Print the assembler register name.
Reimplemented from llvm::MCInstPrinter.
Definition at line 85 of file CSKYInstPrinter.cpp.
References getRegisterName(), and llvm::MCInstPrinter::PrintBranchImmAsAddress.
Referenced by printOperand(), printRegisterList(), and printRegisterSeq().
void llvm::CSKYInstPrinter::printSPAddr | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |