LLVM API Documentation

Public Member Functions | Protected Member Functions | Protected Attributes
llvm::MCInstPrinter Class Reference

#include <MCInstPrinter.h>

Inheritance diagram for llvm::MCInstPrinter:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCInstPrinter:
Collaboration graph
[legend]

List of all members.

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.
unsigned getAvailableFeatures () const
void setAvailableFeatures (unsigned 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)
format_object1< int64_t > formatImm (const int64_t Value) const
 Utility function to print immediates in decimal or hex.

Protected Member Functions

void printAnnotation (raw_ostream &OS, StringRef Annot)
 Utility function for printing annotations.

Protected Attributes

raw_ostreamCommentStream
const MCAsmInfoMAI
const MCInstrInfoMII
const MCRegisterInfoMRI
unsigned 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.

Detailed Description

MCInstPrinter - This is an instance of a target assembly language printer that converts an MCInst to valid target assembly syntax.

Definition at line 26 of file MCInstPrinter.h.


Constructor & Destructor Documentation

llvm::MCInstPrinter::MCInstPrinter ( const MCAsmInfo mai,
const MCInstrInfo mii,
const MCRegisterInfo mri 
) [inline]

Definition at line 48 of file MCInstPrinter.h.

MCInstPrinter::~MCInstPrinter ( ) [virtual]

Definition at line 19 of file MCInstPrinter.cpp.


Member Function Documentation

format_object1< int64_t > MCInstPrinter::formatImm ( const int64_t  Value) const
unsigned llvm::MCInstPrinter::getAvailableFeatures ( ) const [inline]

Definition at line 70 of file MCInstPrinter.h.

References AvailableFeatures.

Referenced by llvm::ARMInstPrinter::printMSRMaskOperand().

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().

bool llvm::MCInstPrinter::getPrintImmHex ( ) const [inline]

Definition at line 80 of file MCInstPrinter.h.

References PrintImmHex.

Referenced by formatImm().

bool llvm::MCInstPrinter::getUseMarkup ( ) const [inline]

Definition at line 73 of file MCInstPrinter.h.

References UseMarkup.

Referenced by markup().

StringRef MCInstPrinter::markup ( StringRef  s) const

Utility functions to make adding mark ups simpler.

Definition at line 42 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::X86ATTInstPrinter::printMemReference(), llvm::ARMInstPrinter::printNEONModImmOperand(), llvm::ARMInstPrinter::printOperand(), llvm::X86ATTInstPrinter::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::ARMInstPrinter::printT2AddrModeImm0_1020s4Operand(), llvm::ARMInstPrinter::printT2AddrModeImm8OffsetOperand(), llvm::ARMInstPrinter::printT2AddrModeImm8Operand(), 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 48 of file MCInstPrinter.cpp.

References getUseMarkup().

void MCInstPrinter::printAnnotation ( raw_ostream OS,
StringRef  Annot 
) [protected]
virtual void llvm::MCInstPrinter::printInst ( const MCInst MI,
raw_ostream OS,
StringRef  Annot 
) [pure virtual]
void MCInstPrinter::printRegName ( raw_ostream OS,
unsigned  RegNo 
) const [virtual]
void llvm::MCInstPrinter::setAvailableFeatures ( unsigned  Value) [inline]
void llvm::MCInstPrinter::setCommentStream ( raw_ostream OS) [inline]

setCommentStream - Specify a stream to emit comments to.

Definition at line 56 of file MCInstPrinter.h.

References CommentStream.

void llvm::MCInstPrinter::setPrintImmHex ( bool  Value) [inline]

Definition at line 81 of file MCInstPrinter.h.

References PrintImmHex.

Referenced by LLVMSetDisasmOptions().

void llvm::MCInstPrinter::setUseMarkup ( bool  Value) [inline]

Definition at line 74 of file MCInstPrinter.h.

References UseMarkup.

Referenced by LLVMSetDisasmOptions().


Member Data Documentation

The current set of available features.

Definition at line 37 of file MCInstPrinter.h.

Referenced by getAvailableFeatures(), and setAvailableFeatures().

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 31 of file MCInstPrinter.h.

Referenced by printAnnotation(), llvm::X86ATTInstPrinter::printInst(), llvm::X86IntelInstPrinter::printInst(), llvm::X86ATTInstPrinter::printOperand(), and setCommentStream().

const MCAsmInfo& llvm::MCInstPrinter::MAI [protected]

Definition at line 32 of file MCInstPrinter.h.

Referenced by printAnnotation().

True if we are printing immediates as hex.

Definition at line 43 of file MCInstPrinter.h.

Referenced by getPrintImmHex(), and setPrintImmHex().


The documentation for this class was generated from the following files: