Go to the documentation of this file.
9 #ifndef LLVM_MC_MCINSTPRINTER_H
10 #define LLVM_MC_MCINSTPRINTER_H
21 class MCInstrAnalysis;
23 class MCSubtargetInfo;
28 void dumpBytes(ArrayRef<uint8_t> Bytes, raw_ostream &OS);
39 struct AliasMatchingData;
186 unsigned PredicateIndex);
191 #endif // LLVM_MC_MCINSTPRINTER_H
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
This is an optimization pass for GlobalISel generic memory operations.
bool PrintAliases
True if we prefer aliases (e.g. nop) to raw mnemonics.
bool(* ValidateMCOperand)(const MCOperand &MCOp, const MCSubtargetInfo &STI, unsigned PredicateIndex)
void setSymbolizeOperands(bool Value)
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool getUseMarkup() const
virtual bool applyTargetSpecificCLOption(StringRef Opt)
Customize the printer according to a command line option.
Instances of this class represent a single low-level machine instruction.
const MCInstrAnalysis * MIA
Tablegenerated data structures needed to match alias patterns.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
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.
const MCRegisterInfo & MRI
bool SymbolizeOperands
If true, symbolize branch target and memory reference operands.
ArrayRef< AliasPatternCond > PatternConds
Map from opcode to pattern list by binary search.
const char * matchAliasPatterns(const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M)
Helper for matching MCInsts to alias patterns when printing instructions.
This class implements an extremely fast bulk output stream that can only output to a stream.
bool UseMarkup
True if we are printing marked up assembly.
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
bool PrintImmHex
True if we are printing immediates as hex.
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const
Print the assembler register name.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
ArrayRef< AliasPattern > Patterns
void dumpBytes(ArrayRef< uint8_t > Bytes, raw_ostream &OS)
Convert ‘Bytes’ to a hex string and output to ‘OS’.
multiplies can be turned into SHL s
bool getPrintImmHex() const
format_object< int64_t > formatHex(int64_t Value) const
HexStyle::Style PrintHexStyle
Which style to use for printing hexadecimal values.
virtual std::pair< const char *, uint64_t > getMnemonic(const MCInst *MI)=0
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by p...
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri)
void setMCInstrAnalysis(const MCInstrAnalysis *Value)
void setPrintImmHex(bool Value)
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
void setPrintBranchImmAsAddress(bool Value)
ArrayRef< PatternsForOpcode > OpToPatterns
void setUseMarkup(bool Value)
Interface to description of machine instruction set.
StringRef getOpcodeName(unsigned Opcode) const
Return the name of the specified opcode enum (e.g.
StringRef markup(StringRef s) const
Utility functions to make adding mark ups simpler.
Data for each alias pattern.
Instances of this class represent operands of the MCInst class.
void setPrintHexStyle(HexStyle::Style Value)
void setCommentStream(raw_ostream &OS)
Specify a stream to emit comments to.
Generic base class for all target subtargets.
LLVM Value Representation.