LLVM: include/llvm/MC/MCInstPrinter.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_MC_MCINSTPRINTER_H
10#define LLVM_MC_MCINSTPRINTER_H
11
16#include
17
18namespace llvm {
19
20class MCAsmInfo;
21class MCInst;
22class MCInstrAnalysis;
23class MCInstrInfo;
24class MCOperand;
25class MCRegister;
26class MCRegisterInfo;
27class MCSubtargetInfo;
28class StringRef;
29
30
31void dumpBytes(ArrayRef<uint8_t> Bytes, raw_ostream &OS);
32
33namespace HexStyle {
34
37 Asm
39
40}
41
42struct AliasMatchingData;
43
44
45
47protected:
48
49
50
56
57
59
60
62
63
65
66
68
69
71
72
73
74
76
77
79
81
82
84
85
88
89public:
92
94
100 };
101
103 public:
105 bool EnableMarkup, bool EnableColor);
107
109 OS << O;
110 return *this;
111 }
112
114 OS << O;
115 return *this;
116 }
117
118 private:
121 bool EnableMarkup;
122 bool EnableColor;
123 };
124
125
126
128
129
131
132
133
134 virtual std::pair<const char *, uint64_t>
136
137
138
139
140
141
142
143
146
147
148
150
151
153
156
159
161
164
166
169 }
170
173
174
177 }
178
179
183};
184
185
190};
191
192
193
199};
200
214 };
215
218};
219
220
227 unsigned PredicateIndex);
228};
229
230}
231
232#endif
#define LLVM_CTOR_NODISCARD
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class is intended to be used as a base class for asm properties and features specific to the tar...
WithMarkup & operator<<(const T &O)
WithMarkup & operator<<(T &O)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
WithMarkup markup(raw_ostream &OS, Markup M)
void setPrintBranchImmAsAddress(bool Value)
bool UseMarkup
True if we are printing marked up assembly.
void setMCInstrAnalysis(const MCInstrAnalysis *Value)
format_object< int64_t > formatHex(int64_t Value) const
bool PrintImmHex
True if we are printing immediates as hex.
void setCommentStream(raw_ostream &OS)
Specify a stream to emit comments to.
virtual bool applyTargetSpecificCLOption(StringRef Opt)
Customize the printer according to a command line option.
void setUseColor(bool Value)
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
bool getPrintImmHex() const
void setSymbolizeOperands(bool Value)
bool SymbolizeOperands
If true, symbolize branch target and memory reference operands.
void setPrintImmHex(bool Value)
StringRef getOpcodeName(unsigned Opcode) const
Return the name of the specified opcode enum (e.g.
SmallVector< raw_ostream::Colors, 4 > ColorStack
void setUseMarkup(bool Value)
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
const MCRegisterInfo & MRI
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
bool UseColor
True if we are printing colored assembly.
bool getUseMarkup() const
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.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
virtual void printRegName(raw_ostream &OS, MCRegister Reg)
Print the assembler register name.
virtual std::pair< const char *, uint64_t > getMnemonic(const MCInst &MI) const =0
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by p...
void setPrintHexStyle(HexStyle::Style Value)
const char * matchAliasPatterns(const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M)
Helper for matching MCInsts to alias patterns when printing instructions.
const MCInstrAnalysis * MIA
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri)
HexStyle::Style PrintHexStyle
Which style to use for printing hexadecimal values.
bool PrintAliases
True if we prefer aliases (e.g. nop) to raw mnemonics.
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
Instances of this class represent operands of the MCInst class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
void dumpBytes(ArrayRef< uint8_t > Bytes, raw_ostream &OS)
Convert ‘Bytes’ to a hex string and output to ‘OS’.
Tablegenerated data structures needed to match alias patterns.
ArrayRef< AliasPatternCond > PatternConds
bool(* ValidateMCOperand)(const MCOperand &MCOp, const MCSubtargetInfo &STI, unsigned PredicateIndex)
ArrayRef< PatternsForOpcode > OpToPatterns
ArrayRef< AliasPattern > Patterns
Data for each alias pattern.
Map from opcode to pattern list by binary search.