|
LLVM
10.0.0
|
This is an instance of a target assembly language printer that converts an MCInst to valid target assembly syntax. More...
#include "llvm/MC/MCInstPrinter.h"
Public Member Functions | |
| MCInstPrinter (const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri) | |
| virtual | ~MCInstPrinter () |
| virtual bool | applyTargetSpecificCLOption (StringRef Opt) |
| Customize the printer according to a command line option. More... | |
| void | setCommentStream (raw_ostream &OS) |
| Specify a stream to emit comments to. More... | |
| virtual void | printInst (const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS)=0 |
| Print the specified MCInst to the specified raw_ostream. More... | |
| StringRef | getOpcodeName (unsigned Opcode) const |
| Return the name of the specified opcode enum (e.g. More... | |
| virtual void | printRegName (raw_ostream &OS, unsigned RegNo) const |
| Print the assembler register name. More... | |
| bool | getUseMarkup () const |
| void | setUseMarkup (bool Value) |
| StringRef | markup (StringRef s) const |
| Utility functions to make adding mark ups simpler. More... | |
| bool | getPrintImmHex () const |
| void | setPrintImmHex (bool Value) |
| void | setPrintHexStyle (HexStyle::Style Value) |
| format_object< int64_t > | formatImm (int64_t Value) const |
| Utility function to print immediates in decimal or hex. More... | |
| format_object< int64_t > | formatDec (int64_t Value) const |
| Utility functions to print decimal/hexadecimal values. More... | |
| format_object< int64_t > | formatHex (int64_t Value) const |
| format_object< uint64_t > | formatHex (uint64_t Value) const |
Protected Member Functions | |
| void | printAnnotation (raw_ostream &OS, StringRef Annot) |
| Utility function for printing annotations. More... | |
| const char * | matchAliasPatterns (const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M) |
| Helper for matching MCInsts to alias patterns when printing instructions. More... | |
Protected Attributes | |
| raw_ostream * | CommentStream = nullptr |
| A stream that comments can be emitted to if desired. More... | |
| const MCAsmInfo & | MAI |
| const MCInstrInfo & | MII |
| const MCRegisterInfo & | MRI |
| bool | UseMarkup = false |
| True if we are printing marked up assembly. More... | |
| bool | PrintImmHex = false |
| True if we are printing immediates as hex. More... | |
| HexStyle::Style | PrintHexStyle = HexStyle::C |
| Which style to use for printing hexadecimal values. More... | |
This is an instance of a target assembly language printer that converts an MCInst to valid target assembly syntax.
Definition at line 42 of file MCInstPrinter.h.
|
inline |
Definition at line 69 of file MCInstPrinter.h.
|
virtualdefault |
Referenced by llvm::dumpBytes().
Customize the printer according to a command line option.
Reimplemented in llvm::RISCVInstPrinter, and llvm::ARMInstPrinter.
Definition at line 76 of file MCInstPrinter.h.
| format_object< int64_t > MCInstPrinter::formatDec | ( | int64_t | Value | ) | const |
Utility functions to print decimal/hexadecimal values.
Definition at line 171 of file MCInstPrinter.cpp.
References llvm::format().
Referenced by llvm::AArch64InstPrinter::printImmSVE().
| format_object< int64_t > MCInstPrinter::formatHex | ( | int64_t | Value | ) | const |
Definition at line 175 of file MCInstPrinter.cpp.
References llvm::HexStyle::Asm, llvm::HexStyle::C, llvm::format(), llvm_unreachable, needsLeadingZero(), and PrintHexStyle.
Referenced by llvm::LanaiInstPrinter::printHi16AndImmOperand(), llvm::LanaiInstPrinter::printHi16ImmOperand(), llvm::AArch64InstPrinter::printImmSVE(), llvm::LanaiInstPrinter::printLo16AndImmOperand(), llvm::LanaiInstPrinter::printMemImmOperand(), llvm::LanaiInstPrinter::printOperand(), llvm::X86InstPrinterCommon::printPCRelImm(), and llvm::AArch64InstPrinter::printSVELogicalImm().
| format_object< uint64_t > MCInstPrinter::formatHex | ( | uint64_t | Value | ) | const |
Definition at line 199 of file MCInstPrinter.cpp.
References llvm::HexStyle::Asm, llvm::HexStyle::C, llvm::format(), llvm_unreachable, needsLeadingZero(), and PrintHexStyle.
|
inline |
Utility function to print immediates in decimal or hex.
Definition at line 104 of file MCInstPrinter.h.
Referenced by llvm::ARMInstPrinter::printAddrModeImm12Operand(), llvm::AArch64InstPrinter::printAddSubImm(), llvm::AArch64InstPrinter::printAdrpLabel(), llvm::AArch64InstPrinter::printAlignedLabel(), llvm::AArch64InstPrinter::printAMIndexedWB(), llvm::BPFInstPrinter::printBrTargetOperand(), llvm::AArch64InstPrinter::printBTIHintOp(), llvm::AArch64InstPrinter::printImm(), llvm::BPFInstPrinter::printImm64Operand(), llvm::AArch64InstPrinter::printImm8OptLsl(), llvm::ARMInstPrinter::printImmPlusOneOperand(), llvm::AArch64InstPrinter::printImmScale(), llvm::AArch64InstPrinter::printInst(), llvm::MipsInstPrinter::printInst(), llvm::X86ATTInstPrinter::printMemOffset(), llvm::X86IntelInstPrinter::printMemOffset(), llvm::BPFInstPrinter::printMemOperand(), llvm::X86ATTInstPrinter::printMemReference(), llvm::X86IntelInstPrinter::printMemReference(), llvm::BPFInstPrinter::printOperand(), llvm::NVPTXInstPrinter::printOperand(), llvm::HexagonInstPrinter::printOperand(), llvm::X86ATTInstPrinter::printOperand(), llvm::X86IntelInstPrinter::printOperand(), llvm::ARMInstPrinter::printOperand(), llvm::X86InstPrinterCommon::printPCRelImm(), llvm::AArch64InstPrinter::printPrefetchOp(), llvm::AArch64InstPrinter::printPSBHintOp(), llvm::AArch64InstPrinter::printSVEPattern(), llvm::AArch64InstPrinter::printSystemPStateField(), llvm::ARMInstPrinter::printT2AddrModeImm0_1020s4Operand(), llvm::ARMInstPrinter::printThumbAddrModeImm5SOperand(), llvm::ARMInstPrinter::printThumbLdrLabelOperand(), llvm::ARMInstPrinter::printThumbS4ImmOperand(), llvm::ARMInstPrinter::printThumbSRImm(), llvm::X86ATTInstPrinter::printU8Imm(), llvm::X86IntelInstPrinter::printU8Imm(), and llvm::AArch64InstPrinter::printUImm12Offset().
Return the name of the specified opcode enum (e.g.
getOpcodeName - Return the name of the specified opcode enum (e.g.
"MOV32ri") or empty if we can't resolve it.
Definition at line 41 of file MCInstPrinter.cpp.
References llvm::MCInstrInfo::getName(), and MII.
Referenced by llvm::MCInst::dump_pretty().
|
inline |
Definition at line 98 of file MCInstPrinter.h.
Referenced by llvm::AArch64InstPrinter::printImmSVE().
|
inline |
Definition at line 92 of file MCInstPrinter.h.
Referenced by markup().
Utility functions to make adding mark ups simpler.
Definition at line 151 of file MCInstPrinter.cpp.
References getUseMarkup().
Referenced by llvm::ARMInstPrinter::printAddrMode2OffsetOperand(), llvm::ARMInstPrinter::printAddrMode3OffsetOperand(), llvm::ARMInstPrinter::printAddrMode5FP16Operand(), 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::printAM3PreOrOffsetIndexOp(), llvm::ARMInstPrinter::printBitfieldInvMaskImmOperand(), llvm::X86ATTInstPrinter::printDstIdx(), llvm::ARMInstPrinter::printExpandedImmOperand(), llvm::ARMInstPrinter::printFBits16(), llvm::ARMInstPrinter::printFBits32(), llvm::ARMInstPrinter::printFPImmOperand(), llvm::ARMInstPrinter::printImmPlusOneOperand(), llvm::ARMInstPrinter::printInst(), llvm::X86ATTInstPrinter::printMemOffset(), llvm::X86ATTInstPrinter::printMemReference(), llvm::ARMInstPrinter::printModImmOperand(), llvm::ARMInstPrinter::printMveAddrModeQOperand(), llvm::ARMInstPrinter::printMveAddrModeRQOperand(), llvm::NVPTXInstPrinter::printOperand(), llvm::X86ATTInstPrinter::printOperand(), llvm::ARMInstPrinter::printOperand(), llvm::ARMInstPrinter::printPKHASRShiftImm(), llvm::ARMInstPrinter::printPKHLSLShiftImm(), llvm::ARMInstPrinter::printPostIdxImm8Operand(), llvm::ARMInstPrinter::printPostIdxImm8s4Operand(), llvm::X86ATTInstPrinter::printRegName(), llvm::ARMInstPrinter::printRegName(), llvm::ARMInstPrinter::printRotImmOperand(), llvm::ARMInstPrinter::printShiftImmOperand(), llvm::X86ATTInstPrinter::printSrcIdx(), llvm::X86ATTInstPrinter::printSTiRegOperand(), 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(), llvm::ARMInstPrinter::printThumbSRImm(), llvm::X86ATTInstPrinter::printU8Imm(), and llvm::ARMInstPrinter::printVMOVModImmOperand().
|
protected |
Helper for matching MCInsts to alias patterns when printing instructions.
Definition at line 103 of file MCInstPrinter.cpp.
References llvm::all_of(), llvm::AliasMatchingData::AsmStrings, assert(), C, llvm::StringRef::data(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), llvm::lower_bound(), matchAliasCondition(), MRI, llvm::PatternsForOpcode::Opcode, llvm::AliasMatchingData::OpToPatterns, P, llvm::AliasMatchingData::PatternConds, llvm::AliasMatchingData::Patterns, and llvm::StringRef::size().
|
protected |
Utility function for printing annotations.
Definition at line 49 of file MCInstPrinter.cpp.
References CommentStream, llvm::StringRef::empty(), llvm::MCAsmInfo::getCommentString(), and MAI.
Referenced by llvm::BPFInstPrinter::printInst(), llvm::MSP430InstPrinter::printInst(), llvm::LanaiInstPrinter::printInst(), llvm::X86ATTInstPrinter::printInst(), llvm::ARMInstPrinter::printInst(), llvm::X86IntelInstPrinter::printInst(), llvm::NVPTXInstPrinter::printInst(), llvm::AArch64InstPrinter::printInst(), llvm::RISCVInstPrinter::printInst(), llvm::AVRInstPrinter::printInst(), llvm::ARCInstPrinter::printInst(), llvm::XCoreInstPrinter::printInst(), llvm::PPCInstPrinter::printInst(), llvm::WebAssemblyInstPrinter::printInst(), llvm::SystemZInstPrinter::printInst(), llvm::MipsInstPrinter::printInst(), and llvm::AArch64AppleInstPrinter::printInst().
|
pure virtual |
Print the specified MCInst to the specified raw_ostream.
Implemented in llvm::R600InstPrinter, llvm::AArch64AppleInstPrinter, llvm::MipsInstPrinter, llvm::SystemZInstPrinter, llvm::WebAssemblyInstPrinter, llvm::PPCInstPrinter, llvm::XCoreInstPrinter, llvm::ARCInstPrinter, llvm::AVRInstPrinter, llvm::HexagonInstPrinter, llvm::AMDGPUInstPrinter, llvm::RISCVInstPrinter, llvm::AArch64InstPrinter, llvm::ARMInstPrinter, llvm::NVPTXInstPrinter, llvm::X86IntelInstPrinter, llvm::LanaiInstPrinter, llvm::SparcInstPrinter, llvm::VEInstPrinter, llvm::X86ATTInstPrinter, llvm::BPFInstPrinter, and llvm::MSP430InstPrinter.
Referenced by llvm::HexagonGetLastSlot(), LLVMDisasmInstruction(), and llvm::MCTargetStreamer::prettyPrintAsm().
|
virtual |
Print the assembler register name.
Reimplemented in llvm::MipsInstPrinter, llvm::LanaiInstPrinter, llvm::SystemZInstPrinter, llvm::WebAssemblyInstPrinter, llvm::PPCInstPrinter, llvm::HexagonInstPrinter, llvm::XCoreInstPrinter, llvm::ARCInstPrinter, llvm::RISCVInstPrinter, llvm::AArch64InstPrinter, llvm::ARMInstPrinter, llvm::NVPTXInstPrinter, llvm::X86IntelInstPrinter, llvm::SparcInstPrinter, llvm::VEInstPrinter, and llvm::X86ATTInstPrinter.
Definition at line 45 of file MCInstPrinter.cpp.
References llvm_unreachable.
Referenced by GetAEABIUnwindPersonalityName(), and llvm::X86InstPrinterCommon::printVKPair().
|
inline |
Specify a stream to emit comments to.
Definition at line 79 of file MCInstPrinter.h.
References llvm::Address, and MI.
Referenced by LLVMSetDisasmOptions().
|
inline |
Definition at line 101 of file MCInstPrinter.h.
|
inline |
Definition at line 99 of file MCInstPrinter.h.
Referenced by LLVMSetDisasmOptions().
|
inline |
Definition at line 93 of file MCInstPrinter.h.
Referenced by LLVMSetDisasmOptions().
|
protected |
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 disabled.
Definition at line 47 of file MCInstPrinter.h.
Referenced by llvm::AArch64InstPrinter::printAddSubImm(), printAnnotation(), llvm::AArch64InstPrinter::printImmSVE(), llvm::X86ATTInstPrinter::printInst(), llvm::X86IntelInstPrinter::printInst(), llvm::WebAssemblyInstPrinter::printInst(), and llvm::X86ATTInstPrinter::printOperand().
Definition at line 48 of file MCInstPrinter.h.
Referenced by llvm::HexagonInstPrinter::getMAI(), llvm::AArch64InstPrinter::printAddSubImm(), llvm::ARMInstPrinter::printAdrLabelOperand(), llvm::AArch64InstPrinter::printAdrpLabel(), llvm::AArch64InstPrinter::printAlignedLabel(), llvm::AArch64InstPrinter::printAMIndexedWB(), printAnnotation(), printExpr(), llvm::LanaiInstPrinter::printHi16AndImmOperand(), llvm::LanaiInstPrinter::printHi16ImmOperand(), llvm::MSP430InstPrinter::printInst(), llvm::AArch64InstPrinter::printInst(), llvm::MipsInstPrinter::printInst(), llvm::LanaiInstPrinter::printLo16AndImmOperand(), llvm::LanaiInstPrinter::printMemImmOperand(), llvm::X86ATTInstPrinter::printMemOffset(), llvm::X86IntelInstPrinter::printMemOffset(), llvm::X86ATTInstPrinter::printMemReference(), llvm::X86IntelInstPrinter::printMemReference(), llvm::LanaiInstPrinter::printMemRiOperand(), llvm::LanaiInstPrinter::printMemSplsOperand(), llvm::LanaiInstPrinter::printOperand(), llvm::RISCVInstPrinter::printOperand(), llvm::NVPTXInstPrinter::printOperand(), llvm::X86ATTInstPrinter::printOperand(), llvm::X86IntelInstPrinter::printOperand(), llvm::ARMInstPrinter::printOperand(), llvm::WebAssemblyInstPrinter::printOperand(), llvm::PPCInstPrinter::printOperand(), llvm::AArch64InstPrinter::printOperand(), llvm::X86InstPrinterCommon::printPCRelImm(), printSImmOperand(), llvm::ARMInstPrinter::printThumbLdrLabelOperand(), llvm::X86IntelInstPrinter::printU8Imm(), llvm::AArch64InstPrinter::printUImm12Offset(), and llvm::SystemZInstPrinter::SystemZInstPrinter().
|
protected |
Definition at line 49 of file MCInstPrinter.h.
Referenced by getOpcodeName(), llvm::AVRInstPrinter::getPrettyRegisterName(), llvm::X86ATTInstPrinter::printInst(), llvm::X86IntelInstPrinter::printInst(), llvm::WebAssemblyInstPrinter::printInst(), llvm::X86InstPrinterCommon::printInstFlags(), llvm::WebAssemblyInstPrinter::printOperand(), llvm::PPCInstPrinter::printOperand(), llvm::X86ATTInstPrinter::printVecCompareInstr(), and llvm::X86IntelInstPrinter::printVecCompareInstr().
|
protected |
Definition at line 50 of file MCInstPrinter.h.
Referenced by llvm::AMDGPUInstPrinter::AMDGPUInstPrinter(), llvm::AVRInstPrinter::AVRInstPrinter(), llvm::AVRInstPrinter::getPrettyRegisterName(), matchAliasPatterns(), llvm::ARMInstPrinter::printGPRPairOperand(), llvm::AArch64InstPrinter::printGPRSeqPairsClassOperand(), llvm::ARMInstPrinter::printInst(), llvm::RISCVInstPrinter::printInst(), llvm::ARMInstPrinter::printMVEVectorList(), llvm::PPCInstPrinter::printOperand(), llvm::ARMInstPrinter::printRegisterList(), llvm::AArch64InstPrinter::printVectorList(), llvm::ARMInstPrinter::printVectorListTwo(), llvm::ARMInstPrinter::printVectorListTwoAllLanes(), llvm::ARMInstPrinter::printVectorListTwoSpaced(), and llvm::ARMInstPrinter::printVectorListTwoSpacedAllLanes().
|
protected |
Which style to use for printing hexadecimal values.
Definition at line 59 of file MCInstPrinter.h.
Referenced by formatHex().
True if we are printing immediates as hex.
Definition at line 56 of file MCInstPrinter.h.
True if we are printing marked up assembly.
Definition at line 53 of file MCInstPrinter.h.
Referenced by llvm::ARMInstPrinter::printAddrMode2OffsetOperand(), llvm::ARMInstPrinter::printAM2PreOrOffsetIndexOp(), llvm::ARMInstPrinter::printMveAddrModeRQOperand(), llvm::ARMInstPrinter::printSORegImmOperand(), and llvm::ARMInstPrinter::printT2SOOperand().
1.8.13