LLVM API Documentation
#include <MCInstPrinter.h>
Public Member Functions | |
MCInstPrinter (const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri) | |
virtual | ~MCInstPrinter () |
void | setCommentStream (raw_ostream &OS) |
setCommentStream - Specify a stream to emit comments to. | |
virtual void | printInst (const MCInst *MI, raw_ostream &OS, StringRef Annot)=0 |
StringRef | getOpcodeName (unsigned Opcode) const |
virtual void | printRegName (raw_ostream &OS, unsigned RegNo) const |
printRegName - Print the assembler register name. | |
uint64_t | getAvailableFeatures () const |
void | setAvailableFeatures (uint64_t Value) |
bool | getUseMarkup () const |
void | setUseMarkup (bool Value) |
StringRef | markup (StringRef s) const |
Utility functions to make adding mark ups simpler. | |
StringRef | markup (StringRef a, StringRef b) const |
bool | getPrintImmHex () const |
void | setPrintImmHex (bool Value) |
HexStyle::Style | getPrintHexStyleHex () const |
void | setPrintImmHex (HexStyle::Style Value) |
format_object1< int64_t > | formatImm (const int64_t Value) const |
Utility function to print immediates in decimal or hex. | |
format_object1< int64_t > | formatDec (const int64_t Value) const |
Utility functions to print decimal/hexadecimal values. | |
format_object1< int64_t > | formatHex (const int64_t Value) const |
format_object1< uint64_t > | formatHex (const uint64_t Value) const |
Protected Member Functions | |
void | printAnnotation (raw_ostream &OS, StringRef Annot) |
Utility function for printing annotations. | |
Protected Attributes | |
raw_ostream * | CommentStream |
const MCAsmInfo & | MAI |
const MCInstrInfo & | MII |
const MCRegisterInfo & | MRI |
uint64_t | AvailableFeatures |
The current set of available features. | |
bool | UseMarkup |
True if we are printing marked up assembly. | |
bool | PrintImmHex |
True if we are printing immediates as hex. | |
HexStyle::Style | PrintHexStyle |
Which style to use for printing hexadecimal values. |
MCInstPrinter - This is an instance of a target assembly language printer that converts an MCInst to valid target assembly syntax.
Definition at line 33 of file MCInstPrinter.h.
llvm::MCInstPrinter::MCInstPrinter | ( | const MCAsmInfo & | mai, |
const MCInstrInfo & | mii, | ||
const MCRegisterInfo & | mri | ||
) | [inline] |
Definition at line 58 of file MCInstPrinter.h.
MCInstPrinter::~MCInstPrinter | ( | ) | [virtual] |
Definition at line 19 of file MCInstPrinter.cpp.
format_object1< int64_t > MCInstPrinter::formatDec | ( | const int64_t | Value | ) | const |
Utility functions to print decimal/hexadecimal values.
Definition at line 72 of file MCInstPrinter.cpp.
References llvm::format().
Referenced by formatImm().
format_object1< int64_t > MCInstPrinter::formatHex | ( | const int64_t | Value | ) | const |
Definition at line 76 of file MCInstPrinter.cpp.
References llvm::HexStyle::Asm, llvm::HexStyle::C, llvm::format(), llvm_unreachable, needsLeadingZero(), and PrintHexStyle.
Referenced by formatImm().
format_object1< uint64_t > MCInstPrinter::formatHex | ( | const uint64_t | Value | ) | const |
Definition at line 99 of file MCInstPrinter.cpp.
References llvm::HexStyle::Asm, llvm::HexStyle::C, llvm::format(), llvm_unreachable, needsLeadingZero(), and PrintHexStyle.
format_object1<int64_t> llvm::MCInstPrinter::formatImm | ( | const int64_t | Value | ) | const [inline] |
Utility function to print immediates in decimal or hex.
Definition at line 98 of file MCInstPrinter.h.
References formatDec(), formatHex(), and PrintImmHex.
Referenced by llvm::ARMInstPrinter::printAddrModeImm12Operand(), llvm::ARMInstPrinter::printImmPlusOneOperand(), llvm::ARMInstPrinter::printOperand(), llvm::NVPTXInstPrinter::printOperand(), llvm::ARMInstPrinter::printT2AddrModeImm0_1020s4Operand(), llvm::ARMInstPrinter::printThumbAddrModeImm5SOperand(), llvm::ARMInstPrinter::printThumbLdrLabelOperand(), llvm::ARMInstPrinter::printThumbS4ImmOperand(), and llvm::ARMInstPrinter::printThumbSRImm().
uint64_t llvm::MCInstPrinter::getAvailableFeatures | ( | ) | const [inline] |
Definition at line 81 of file MCInstPrinter.h.
References AvailableFeatures.
Referenced by llvm::ARMInstPrinter::printInst(), llvm::ARMInstPrinter::printMemBOption(), llvm::AArch64InstPrinter::printMRSSystemRegister(), llvm::ARMInstPrinter::printMSRMaskOperand(), and llvm::AArch64InstPrinter::printMSRSystemRegister().
StringRef MCInstPrinter::getOpcodeName | ( | unsigned | Opcode | ) | const |
getOpcodeName - Return the name of the specified opcode enum (e.g. "MOV32ri") or empty if we can't resolve it.
Reimplemented in llvm::HexagonInstPrinter.
Definition at line 24 of file MCInstPrinter.cpp.
References llvm::MCInstrInfo::getName(), and MII.
Referenced by llvm::MCInst::dump_pretty().
HexStyle::Style llvm::MCInstPrinter::getPrintHexStyleHex | ( | ) | const [inline] |
Definition at line 94 of file MCInstPrinter.h.
References PrintHexStyle.
bool llvm::MCInstPrinter::getPrintImmHex | ( | ) | const [inline] |
Definition at line 91 of file MCInstPrinter.h.
References PrintImmHex.
bool llvm::MCInstPrinter::getUseMarkup | ( | ) | const [inline] |
StringRef MCInstPrinter::markup | ( | StringRef | s | ) | const |
Utility functions to make adding mark ups simpler.
Definition at line 46 of file MCInstPrinter.cpp.
References getUseMarkup().
Referenced by llvm::ARMInstPrinter::printAddrMode2OffsetOperand(), llvm::ARMInstPrinter::printAddrMode3OffsetOperand(), llvm::ARMInstPrinter::printAddrMode5Operand(), llvm::ARMInstPrinter::printAddrMode6Operand(), llvm::ARMInstPrinter::printAddrMode7Operand(), llvm::ARMInstPrinter::printAddrModeImm12Operand(), llvm::ARMInstPrinter::printAddrModeTBB(), llvm::ARMInstPrinter::printAddrModeTBH(), llvm::ARMInstPrinter::printAdrLabelOperand(), llvm::ARMInstPrinter::printAM2PreOrOffsetIndexOp(), llvm::ARMInstPrinter::printAM3PostIndexOp(), llvm::ARMInstPrinter::printAM3PreOrOffsetIndexOp(), llvm::ARMInstPrinter::printBitfieldInvMaskImmOperand(), llvm::ARMInstPrinter::printFBits16(), llvm::ARMInstPrinter::printFBits32(), llvm::ARMInstPrinter::printFPImmOperand(), llvm::ARMInstPrinter::printImmPlusOneOperand(), llvm::ARMInstPrinter::printInst(), llvm::ARMInstPrinter::printNEONModImmOperand(), llvm::ARMInstPrinter::printOperand(), llvm::NVPTXInstPrinter::printOperand(), llvm::ARMInstPrinter::printPKHASRShiftImm(), llvm::ARMInstPrinter::printPKHLSLShiftImm(), llvm::ARMInstPrinter::printPostIdxImm8Operand(), llvm::ARMInstPrinter::printPostIdxImm8s4Operand(), llvm::ARMInstPrinter::printRegName(), llvm::ARMInstPrinter::printRotImmOperand(), llvm::ARMInstPrinter::printShiftImmOperand(), llvm::ARMInstPrinter::printT2AddrModeImm0_1020s4Operand(), llvm::ARMInstPrinter::printT2AddrModeImm8OffsetOperand(), llvm::ARMInstPrinter::printT2AddrModeImm8Operand(), llvm::ARMInstPrinter::printT2AddrModeImm8s4OffsetOperand(), llvm::ARMInstPrinter::printT2AddrModeImm8s4Operand(), llvm::ARMInstPrinter::printT2AddrModeSoRegOperand(), llvm::ARMInstPrinter::printThumbAddrModeImm5SOperand(), llvm::ARMInstPrinter::printThumbAddrModeRROperand(), llvm::ARMInstPrinter::printThumbLdrLabelOperand(), llvm::ARMInstPrinter::printThumbS4ImmOperand(), and llvm::ARMInstPrinter::printThumbSRImm().
StringRef MCInstPrinter::markup | ( | StringRef | a, |
StringRef | b | ||
) | const |
Definition at line 52 of file MCInstPrinter.cpp.
References getUseMarkup().
void MCInstPrinter::printAnnotation | ( | raw_ostream & | OS, |
StringRef | Annot | ||
) | [protected] |
Utility function for printing annotations.
Definition at line 32 of file MCInstPrinter.cpp.
References CommentStream, llvm::StringRef::empty(), llvm::MCAsmInfo::getCommentString(), and MAI.
Referenced by llvm::MSP430InstPrinter::printInst(), llvm::ARMInstPrinter::printInst(), llvm::AArch64InstPrinter::printInst(), llvm::HexagonInstPrinter::printInst(), llvm::NVPTXInstPrinter::printInst(), llvm::AMDGPUInstPrinter::printInst(), llvm::PPCInstPrinter::printInst(), llvm::XCoreInstPrinter::printInst(), llvm::SystemZInstPrinter::printInst(), llvm::MipsInstPrinter::printInst(), and llvm::AArch64AppleInstPrinter::printInst().
virtual void llvm::MCInstPrinter::printInst | ( | const MCInst * | MI, |
raw_ostream & | OS, | ||
StringRef | Annot | ||
) | [pure virtual] |
printInst - Print the specified MCInst to the specified raw_ostream.
Implemented in llvm::AArch64AppleInstPrinter, llvm::MipsInstPrinter, llvm::SystemZInstPrinter, llvm::PPCInstPrinter, llvm::XCoreInstPrinter, llvm::SparcInstPrinter, llvm::final< T >, llvm::AMDGPUInstPrinter, llvm::AArch64InstPrinter, llvm::NVPTXInstPrinter, llvm::final< T >, llvm::HexagonInstPrinter, llvm::ARMInstPrinter, and llvm::MSP430InstPrinter.
Referenced by LLVMDisasmInstruction().
void MCInstPrinter::printRegName | ( | raw_ostream & | OS, |
unsigned | RegNo | ||
) | const [virtual] |
printRegName - Print the assembler register name.
Reimplemented in llvm::MipsInstPrinter, llvm::SystemZInstPrinter, llvm::PPCInstPrinter, llvm::XCoreInstPrinter, llvm::SparcInstPrinter, llvm::final< T >, llvm::AArch64InstPrinter, llvm::ARMInstPrinter, llvm::NVPTXInstPrinter, and llvm::final< T >.
Definition at line 28 of file MCInstPrinter.cpp.
References llvm_unreachable.
void llvm::MCInstPrinter::setAvailableFeatures | ( | uint64_t | Value | ) | [inline] |
Definition at line 82 of file MCInstPrinter.h.
References AvailableFeatures.
Referenced by llvm::AArch64InstPrinter::AArch64InstPrinter(), llvm::ARMInstPrinter::ARMInstPrinter(), and llvm::NVPTXInstPrinter::NVPTXInstPrinter().
void llvm::MCInstPrinter::setCommentStream | ( | raw_ostream & | OS | ) | [inline] |
setCommentStream - Specify a stream to emit comments to.
Definition at line 67 of file MCInstPrinter.h.
References CommentStream.
Referenced by LLVMSetDisasmOptions().
void llvm::MCInstPrinter::setPrintImmHex | ( | bool | Value | ) | [inline] |
Definition at line 92 of file MCInstPrinter.h.
References PrintImmHex.
Referenced by LLVMSetDisasmOptions().
void llvm::MCInstPrinter::setPrintImmHex | ( | HexStyle::Style | Value | ) | [inline] |
Definition at line 95 of file MCInstPrinter.h.
References PrintHexStyle.
void llvm::MCInstPrinter::setUseMarkup | ( | bool | Value | ) | [inline] |
Definition at line 85 of file MCInstPrinter.h.
References UseMarkup.
Referenced by LLVMSetDisasmOptions().
uint64_t llvm::MCInstPrinter::AvailableFeatures [protected] |
The current set of available features.
Definition at line 44 of file MCInstPrinter.h.
Referenced by getAvailableFeatures(), and setAvailableFeatures().
raw_ostream* llvm::MCInstPrinter::CommentStream [protected] |
CommentStream - a stream that comments can be emitted to if desired. Each comment must end with a newline. This will be null if verbose assembly emission is disable.
Definition at line 38 of file MCInstPrinter.h.
Referenced by llvm::AArch64InstPrinter::printAddSubImm(), printAnnotation(), and setCommentStream().
const MCAsmInfo& llvm::MCInstPrinter::MAI [protected] |
Definition at line 39 of file MCInstPrinter.h.
Referenced by printAnnotation().
const MCInstrInfo& llvm::MCInstPrinter::MII [protected] |
Definition at line 40 of file MCInstPrinter.h.
Referenced by getOpcodeName().
const MCRegisterInfo& llvm::MCInstPrinter::MRI [protected] |
Definition at line 41 of file MCInstPrinter.h.
Referenced by llvm::ARMInstPrinter::printGPRPairOperand(), llvm::ARMInstPrinter::printInst(), llvm::AArch64InstPrinter::printVectorList(), llvm::ARMInstPrinter::printVectorListTwo(), llvm::ARMInstPrinter::printVectorListTwoAllLanes(), llvm::ARMInstPrinter::printVectorListTwoSpaced(), and llvm::ARMInstPrinter::printVectorListTwoSpacedAllLanes().
HexStyle::Style llvm::MCInstPrinter::PrintHexStyle [protected] |
Which style to use for printing hexadecimal values.
Definition at line 53 of file MCInstPrinter.h.
Referenced by formatHex(), getPrintHexStyleHex(), and setPrintImmHex().
bool llvm::MCInstPrinter::PrintImmHex [protected] |
True if we are printing immediates as hex.
Definition at line 50 of file MCInstPrinter.h.
Referenced by formatImm(), getPrintImmHex(), and setPrintImmHex().
bool llvm::MCInstPrinter::UseMarkup [protected] |
True if we are printing marked up assembly.
Definition at line 47 of file MCInstPrinter.h.
Referenced by getUseMarkup(), llvm::ARMInstPrinter::printAddrMode2OffsetOperand(), llvm::ARMInstPrinter::printAM2PreOrOffsetIndexOp(), llvm::ARMInstPrinter::printSORegImmOperand(), llvm::ARMInstPrinter::printT2SOOperand(), and setUseMarkup().