27 static const char HexRep[] =
"0123456789abcdef";
29 for (
char Byte : Bytes)
30 OS << LS << HexRep[(Byte & 0xF0) >> 4] << HexRep[Byte & 0xF];
38 return MII.getName(Opcode);
48 (*CommentStream) << Annot;
51 if (Annot.back() !=
'\n')
52 (*CommentStream) <<
'\n';
54 OS <<
" " <<
MAI.getCommentString() <<
" " << Annot;
63 bool &OrPredicateResult) {
81 bool Res = OrPredicateResult;
82 OrPredicateResult =
false;
94 return Opnd.
isImm() && Opnd.
getImm() == int32_t(
C.Value);
100 return Opnd.
isReg() && Opnd.
getReg() ==
MI.getOperand(
C.Value).getReg();
112 return M.ValidateMCOperand(Opnd, *STI,
C.Value);
133 return L.Opcode < Opcode;
135 if (It == M.OpToPatterns.end() || It->Opcode !=
MI->getOpcode())
141 M.Patterns.
slice(It->PatternStart, It->NumPatterns);
144 if (
MI->getNumOperands() !=
P.NumOperands)
149 M.PatternConds.
slice(
P.AliasCondStart,
P.NumConds);
151 bool OrPredicateResult =
false;
157 AsmStrOffset =
P.AsmStrOffset;
163 if (AsmStrOffset == ~0U)
169 assert(AsmStrOffset < M.AsmStrings.size() &&
170 (AsmStrOffset == 0 || M.AsmStrings[AsmStrOffset - 1] ==
'\0') &&
171 "bad asm string offset");
172 return M.AsmStrings.data() + AsmStrOffset;
182 return (digit >= 0xa);
196 if (
Value == std::numeric_limits<int64_t>::min())
203 if (
Value == std::numeric_limits<int64_t>::min())
234 Markup M,
bool EnableMarkup,
236 : IP(IP), OS(OS), EnableMarkup(EnableMarkup), EnableColor(EnableColor) {
253 IP.ColorStack.push_back(Color);
254 OS.changeColor(Color);
280 IP.ColorStack.pop_back();
281 OS << IP.ColorStack.back();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool needsLeadingZero(uint64_t Value)
static bool matchAliasCondition(const MCInst &MI, const MCSubtargetInfo *STI, const MCInstrInfo &MII, const MCRegisterInfo &MRI, unsigned &OpIdx, const AliasMatchingData &M, const AliasPatternCond &C, bool &OrPredicateResult)
MachineInstr unsigned OpIdx
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
constexpr bool test(unsigned I) const
A helper class to return the specified delimiter string after the first invocation of operator String...
LLVM_CTOR_NODISCARD LLVM_ABI WithMarkup(MCInstPrinter &IP, raw_ostream &OS, Markup M, bool EnableMarkup, bool EnableColor)
WithMarkup markup(raw_ostream &OS, Markup M)
format_object< int64_t > formatHex(int64_t Value) const
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
StringRef getOpcodeName(unsigned Opcode) const
Return the name of the specified opcode enum (e.g.
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.
bool getUseMarkup() const
virtual void printRegName(raw_ostream &OS, MCRegister Reg)
Print the assembler register name.
const char * matchAliasPatterns(const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M)
Helper for matching MCInsts to alias patterns when printing instructions.
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri)
HexStyle::Style PrintHexStyle
Which style to use for printing hexadecimal values.
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
const int16_t * getRegClassByHwModeTable(unsigned ModeId) const
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
const MCRegisterClass & getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
virtual unsigned getHwMode(enum HwModeType type=HwMode_Default) const
HwMode ID corresponding to the 'type' parameter is retrieved from the HwMode bit set of the current s...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
static constexpr Colors GREEN
static constexpr Colors RED
static constexpr Colors YELLOW
static constexpr Colors CYAN
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI void dumpBytes(ArrayRef< uint8_t > Bytes, raw_ostream &OS)
Convert ‘Bytes’ to a hex string and output to ‘OS’.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Tablegenerated data structures needed to match alias patterns.
Data for each alias pattern.
Map from opcode to pattern list by binary search.