LLVM 23.0.0git
MCTargetAsmParser.h
Go to the documentation of this file.
1//===- llvm/MC/MCTargetAsmParser.h - Target Assembly Parser -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_MC_MCPARSER_MCTARGETASMPARSER_H
10#define LLVM_MC_MCPARSER_MCTARGETASMPARSER_H
11
12#include "llvm/ADT/StringRef.h"
13#include "llvm/MC/MCExpr.h"
16#include "llvm/MC/MCRegister.h"
19#include "llvm/Support/SMLoc.h"
21#include <cstdint>
22#include <memory>
23
24namespace llvm {
25
26class MCContext;
27class MCInst;
28class MCInstrInfo;
29class MCStreamer;
30class MCSubtargetInfo;
31class MCSymbol;
32template <typename T> class SmallVectorImpl;
33
35
37 AOK_Align, // Rewrite align as .align.
38 AOK_EVEN, // Rewrite even as .even.
39 AOK_Emit, // Rewrite _emit as .byte.
40 AOK_CallInput, // Rewrite in terms of ${N:P}.
41 AOK_Input, // Rewrite in terms of $N.
42 AOK_Output, // Rewrite in terms of $N.
43 AOK_SizeDirective, // Add a sizing directive (e.g., dword ptr).
44 AOK_Label, // Rewrite local labels.
45 AOK_EndOfStatement, // Add EndOfStatement (e.g., "\n\t").
46 AOK_Skip, // Skip emission (e.g., offset/type operators).
47 AOK_IntelExpr // SizeDirective SymDisp [BaseReg + IndexReg * Scale + ImmDisp]
48};
49
50const char AsmRewritePrecedence [] = {
51 2, // AOK_Align
52 2, // AOK_EVEN
53 2, // AOK_Emit
54 3, // AOK_Input
55 3, // AOK_CallInput
56 3, // AOK_Output
57 5, // AOK_SizeDirective
58 1, // AOK_Label
59 5, // AOK_EndOfStatement
60 2, // AOK_Skip
61 2 // AOK_IntelExpr
62};
63
64// Represent the various parts which make up an intel expression,
65// used for emitting compound intel expressions
66struct IntelExpr {
67 bool NeedBracs = false;
68 int64_t Imm = 0;
72 unsigned Scale = 1;
73
74 IntelExpr() = default;
75 // [BaseReg + IndexReg * ScaleExpression + OFFSET name + ImmediateExpression]
76 IntelExpr(StringRef baseReg, StringRef indexReg, unsigned scale,
77 StringRef offsetName, int64_t imm, bool needBracs)
78 : NeedBracs(needBracs), Imm(imm), BaseReg(baseReg), IndexReg(indexReg),
79 OffsetName(offsetName), Scale(1) {
80 if (scale)
81 Scale = scale;
82 }
83 bool hasBaseReg() const { return !BaseReg.empty(); }
84 bool hasIndexReg() const { return !IndexReg.empty(); }
85 bool hasRegs() const { return hasBaseReg() || hasIndexReg(); }
86 bool hasOffset() const { return !OffsetName.empty(); }
87 // Normally we won't emit immediates unconditionally,
88 // unless we've got no other components
89 bool emitImm() const { return !(hasRegs() || hasOffset()); }
90 bool isValid() const {
91 return (Scale == 1) ||
92 (hasIndexReg() && (Scale == 2 || Scale == 4 || Scale == 8));
93 }
94};
95
96struct AsmRewrite {
99 unsigned Len;
100 bool Done;
101 int64_t Val;
105
106public:
107 AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len = 0, int64_t val = 0,
108 bool Restricted = false)
109 : Kind(kind), Loc(loc), Len(len), Done(false), Val(val) {
110 IntelExpRestricted = Restricted;
111 }
112 AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len, StringRef label)
113 : AsmRewrite(kind, loc, len) { Label = label; }
114 AsmRewrite(SMLoc loc, unsigned len, IntelExpr exp)
115 : AsmRewrite(AOK_IntelExpr, loc, len) { IntelExp = exp; }
116};
117
125
126/// Ternary parse status returned by various parse* methods.
128 enum class StatusTy {
129 Success, // Parsing Succeeded
130 Failure, // Parsing Failed after consuming some tokens
131 NoMatch, // Parsing Failed without consuming any tokens
132 } Status;
133
134public:
135#if __cplusplus >= 202002L
136 using enum StatusTy;
137#else
138 static constexpr StatusTy Success = StatusTy::Success;
139 static constexpr StatusTy Failure = StatusTy::Failure;
140 static constexpr StatusTy NoMatch = StatusTy::NoMatch;
141#endif
142
143 constexpr ParseStatus() : Status(NoMatch) {}
144
145 constexpr ParseStatus(StatusTy Status) : Status(Status) {}
146
147 constexpr ParseStatus(bool Error) : Status(Error ? Failure : Success) {}
148
149 template <typename T> constexpr ParseStatus(T) = delete;
150
151 constexpr bool isSuccess() const { return Status == StatusTy::Success; }
152 constexpr bool isFailure() const { return Status == StatusTy::Failure; }
153 constexpr bool isNoMatch() const { return Status == StatusTy::NoMatch; }
154};
155
156// When an operand is parsed, the assembler will try to iterate through a set of
157// possible operand classes that the operand might match and call the
158// corresponding PredicateMethod to determine that.
159//
160// If there are two AsmOperands that would give a specific diagnostic if there
161// is no match, there is currently no mechanism to distinguish which operand is
162// a closer match. The DiagnosticPredicate distinguishes between 'completely
163// no match' and 'near match', so the assembler can decide whether to give a
164// specific diagnostic, or use 'InvalidOperand' and continue to find a
165// 'better matching' diagnostic.
166//
167// For example:
168// opcode opnd0, onpd1, opnd2
169//
170// where:
171// opnd2 could be an 'immediate of range [-8, 7]'
172// opnd2 could be a 'register + shift/extend'.
173//
174// If opnd2 is a valid register, but with a wrong shift/extend suffix, it makes
175// little sense to give a diagnostic that the operand should be an immediate
176// in range [-8, 7].
177//
178// This is a light-weight alternative to the 'NearMissInfo' approach
179// below which collects *all* possible diagnostics. This alternative
180// is optional and fully backward compatible with existing
181// PredicateMethods that return a 'bool' (match or near match).
184 Match, // Matches
185 NearMatch, // Close Match: use Specific Diagnostic
186 NoMatch, // No Match: use `InvalidOperand`
188
190
191 explicit constexpr DiagnosticPredicate(bool Matches)
192 : Predicate(Matches ? Match : NearMatch) {}
193
194 explicit operator bool() const { return Predicate == Match; }
195
196 constexpr bool isMatch() const { return Predicate == Match; }
197 constexpr bool isNearMatch() const { return Predicate == NearMatch; }
198 constexpr bool isNoMatch() const { return Predicate == NoMatch; }
199};
200
201// When matching of an assembly instruction fails, there may be multiple
202// encodings that are close to being a match. It's often ambiguous which one
203// the programmer intended to use, so we want to report an error which mentions
204// each of these "near-miss" encodings. This struct contains information about
205// one such encoding, and why it did not match the parsed instruction.
206class NearMissInfo {
207public:
215
216 // The encoding is valid for the parsed assembly string. This is only used
217 // internally to the table-generated assembly matcher.
218 static NearMissInfo getSuccess() { return NearMissInfo(); }
219
220 // The instruction encoding is not valid because it requires some target
221 // features that are not currently enabled. MissingFeatures has a bit set for
222 // each feature that the encoding needs but which is not enabled.
223 static NearMissInfo getMissedFeature(const FeatureBitset &MissingFeatures) {
224 NearMissInfo Result;
225 Result.Kind = NearMissFeature;
226 Result.Features = MissingFeatures;
227 return Result;
228 }
229
230 // The instruction encoding is not valid because the target-specific
231 // predicate function returned an error code. FailureCode is the
232 // target-specific error code returned by the predicate.
233 static NearMissInfo getMissedPredicate(unsigned FailureCode) {
234 NearMissInfo Result;
235 Result.Kind = NearMissPredicate;
236 Result.PredicateError = FailureCode;
237 return Result;
238 }
239
240 // The instruction encoding is not valid because one (and only one) parsed
241 // operand is not of the correct type. OperandError is the error code
242 // relating to the operand class expected by the encoding. OperandClass is
243 // the type of the expected operand. Opcode is the opcode of the encoding.
244 // OperandIndex is the index into the parsed operand list.
245 static NearMissInfo getMissedOperand(unsigned OperandError,
246 unsigned OperandClass, unsigned Opcode,
247 unsigned OperandIndex) {
248 NearMissInfo Result;
249 Result.Kind = NearMissOperand;
250 Result.MissedOperand.Error = OperandError;
251 Result.MissedOperand.Class = OperandClass;
252 Result.MissedOperand.Opcode = Opcode;
253 Result.MissedOperand.Index = OperandIndex;
254 return Result;
255 }
256
257 // The instruction encoding is not valid because it expects more operands
258 // than were parsed. OperandClass is the class of the expected operand that
259 // was not provided. Opcode is the instruction encoding.
260 static NearMissInfo getTooFewOperands(unsigned OperandClass,
261 unsigned Opcode) {
262 NearMissInfo Result;
263 Result.Kind = NearMissTooFewOperands;
264 Result.TooFewOperands.Class = OperandClass;
265 Result.TooFewOperands.Opcode = Opcode;
266 return Result;
267 }
268
269 operator bool() const { return Kind != NoNearMiss; }
270
271 NearMissKind getKind() const { return Kind; }
272
273 // Feature flags required by the instruction, that the current target does
274 // not have.
275 const FeatureBitset& getFeatures() const {
276 assert(Kind == NearMissFeature);
277 return Features;
278 }
279 // Error code returned by the target predicate when validating this
280 // instruction encoding.
281 unsigned getPredicateError() const {
282 assert(Kind == NearMissPredicate);
283 return PredicateError;
284 }
285 // MatchClassKind of the operand that we expected to see.
286 unsigned getOperandClass() const {
288 return MissedOperand.Class;
289 }
290 // Opcode of the encoding we were trying to match.
291 unsigned getOpcode() const {
293 return MissedOperand.Opcode;
294 }
295 // Error code returned when validating the operand.
296 unsigned getOperandError() const {
297 assert(Kind == NearMissOperand);
298 return MissedOperand.Error;
299 }
300 // Index of the actual operand we were trying to match in the list of parsed
301 // operands.
302 unsigned getOperandIndex() const {
303 assert(Kind == NearMissOperand);
304 return MissedOperand.Index;
305 }
306
307private:
308 NearMissKind Kind;
309
310 // These two structs share a common prefix, so we can safely rely on the fact
311 // that they overlap in the union.
312 struct MissedOpInfo {
313 unsigned Class;
314 unsigned Opcode;
315 unsigned Error;
316 unsigned Index;
317 };
318
319 struct TooFewOperandsInfo {
320 unsigned Class;
321 unsigned Opcode;
322 };
323
324 union {
327 MissedOpInfo MissedOperand;
328 TooFewOperandsInfo TooFewOperands;
329 };
330
331 NearMissInfo() : Kind(NoNearMiss) {}
332};
333
334/// MCTargetAsmParser - Generic interface to target specific assembly parsers.
336public:
346
347protected: // Can only create subclasses.
348 MCTargetAsmParser(const MCSubtargetInfo &STI, const MCInstrInfo &MII);
349
350 /// Create a copy of STI and return a non-const reference to it.
351 MCSubtargetInfo &copySTI();
352
353 /// AvailableFeatures - The current set of available features.
355
356 /// ParsingMSInlineAsm - Are we parsing ms-style inline assembly?
357 bool ParsingMSInlineAsm = false;
358
359 /// SemaCallback - The Sema callback implementation. Must be set when parsing
360 /// ms-style inline assembly.
362
363 /// Current STI.
365
367
368public:
371
373
374 const MCSubtargetInfo &getSTI() const;
375
377 return AvailableFeatures;
378 }
382
385
387 return const_cast<MCTargetAsmParser *>(this)
388 ->getParser()
389 .getContext()
390 .getTargetOptions();
391 }
392
394 SemaCallback = Callback;
395 }
396
397 // Target-specific parsing of expression.
398 virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
399 return getParser().parsePrimaryExpr(Res, EndLoc, nullptr);
400 }
401 // Parse an expression in a data directive, possibly with a relocation
402 // specifier.
403 virtual bool parseDataExpr(const MCExpr *&Res) {
404 SMLoc EndLoc;
405 return getParser().parseExpression(Res, EndLoc);
406 }
407
408 virtual bool parseRegister(MCRegister &Reg, SMLoc &StartLoc,
409 SMLoc &EndLoc) = 0;
410
411 /// tryParseRegister - parse one register if possible
412 ///
413 /// Check whether a register specification can be parsed at the current
414 /// location, without failing the entire parse if it can't. Must not consume
415 /// tokens if the parse fails.
417 SMLoc &EndLoc) = 0;
418
419 /// Parse one assembly instruction.
420 ///
421 /// The parser is positioned following the instruction name. The target
422 /// specific instruction parser should parse the entire instruction and
423 /// construct the appropriate MCInst, or emit an error. On success, the entire
424 /// line should be parsed up to and including the end-of-statement token. On
425 /// failure, the parser is not required to read to the end of the line.
426 //
427 /// \param Name - The instruction name.
428 /// \param NameLoc - The source location of the name.
429 /// \param Operands [out] - The list of parsed operands, this returns
430 /// ownership of them to the caller.
431 /// \return True on failure.
433 SMLoc NameLoc, OperandVector &Operands) = 0;
435 AsmToken Token, OperandVector &Operands) {
436 return parseInstruction(Info, Name, Token.getLoc(), Operands);
437 }
438
439 /// ParseDirective - Parse a target specific assembler directive
440 /// This method is deprecated, use 'parseDirective' instead.
441 ///
442 /// The parser is positioned following the directive name. The target
443 /// specific directive parser should parse the entire directive doing or
444 /// recording any target specific work, or return true and do nothing if the
445 /// directive is not target specific. If the directive is specific for
446 /// the target, the entire line is parsed up to and including the
447 /// end-of-statement token and false is returned.
448 ///
449 /// \param DirectiveID - the identifier token of the directive.
450 virtual bool ParseDirective(AsmToken DirectiveID) { return true; }
451
452 /// Parses a target-specific assembler directive.
453 ///
454 /// The parser is positioned following the directive name. The target-specific
455 /// directive parser should parse the entire directive doing or recording any
456 /// target-specific work, or emit an error. On success, the entire line should
457 /// be parsed up to and including the end-of-statement token. On failure, the
458 /// parser is not required to read to the end of the line. If the directive is
459 /// not target-specific, no tokens should be consumed and NoMatch is returned.
460 ///
461 /// \param DirectiveID - The token identifying the directive.
462 virtual ParseStatus parseDirective(AsmToken DirectiveID);
463
464 /// Recognize a series of operands of a parsed
465 /// instruction as an actual MCInst and emit it to the specified MCStreamer.
466 /// This returns false on success and returns true on failure to match.
467 ///
468 /// On failure, the target parser is responsible for emitting a diagnostic
469 /// explaining the match failure.
470 virtual bool matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
471 OperandVector &Operands, MCStreamer &Out,
473 bool MatchingInlineAsm) = 0;
474
475 /// Allows targets to let registers opt out of clobber lists.
476 virtual bool omitRegisterFromClobberLists(MCRegister Reg) { return false; }
477
478 /// Allow a target to add special case operand matching for things that
479 /// tblgen doesn't/can't handle effectively. For example, literal
480 /// immediates on ARM. TableGen expects a token operand, but the parser
481 /// will recognize them as immediates.
483 unsigned Kind) {
485 }
486
487 /// Validate the instruction match against any complex target predicates
488 /// before rendering any operands to it.
489 virtual unsigned
491 return Match_Success;
492 }
493
494 /// checkTargetMatchPredicate - Validate the instruction match against
495 /// any complex target predicates not expressible via match classes.
496 virtual unsigned checkTargetMatchPredicate(MCInst &Inst) {
497 return Match_Success;
498 }
499
500 virtual void convertToMapAndConstraints(unsigned Kind,
501 const OperandVector &Operands) = 0;
502
503 /// Returns whether two operands are registers and are equal. This is used
504 /// by the tied-operands checks in the AsmMatcher. This method can be
505 /// overridden to allow e.g. a sub- or super-register as the tied operand.
506 virtual bool areEqualRegs(const MCParsedAsmOperand &Op1,
507 const MCParsedAsmOperand &Op2) const;
508
509 // Return whether this parser uses assignment statements with equals tokens
510 virtual bool equalIsAsmAssignment() { return true; };
511 // Return whether this start of statement identifier is a label
512 virtual bool isLabel(AsmToken &Token) { return true; };
513 // Return whether this parser accepts the given token as start of statement.
515 return false;
516 }
517
518 virtual const MCExpr *applySpecifier(const MCExpr *E, uint32_t,
519 MCContext &Ctx) {
520 return nullptr;
521 }
522
523 // For actions that have to be performed before a label is emitted
524 virtual void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc) {}
525
526 virtual void onLabelParsed(MCSymbol *Symbol) {}
527
528 /// Ensure that all previously parsed instructions have been emitted to the
529 /// output streamer, if the target does not emit them immediately.
531
532 // For any initialization at the beginning of parsing.
533 virtual void onBeginOfFile() {}
534
535 // For any checks or cleanups at the end of parsing.
536 virtual void onEndOfFile() {}
537};
538
539} // end namespace llvm
540
541#endif // LLVM_MC_MCPARSER_MCTARGETASMPARSER_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static uint64_t scale(uint64_t Num, uint32_t N, uint32_t D)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:213
Register Reg
#define T
Target independent representation for an assembler token.
Definition MCAsmMacro.h:22
LLVM_ABI SMLoc getLoc() const
Definition AsmLexer.cpp:31
Base class for user error types.
Definition Error.h:354
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Container class for subtarget features.
Generic Sema callback for assembly parser.
Context object for machine code objects.
Definition MCContext.h:83
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Interface to description of machine instruction set.
Definition MCInstrInfo.h:27
MCParsedAsmOperand - This abstract class represents a source-level assembly instruction operand.
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
Streaming machine code generation interface.
Definition MCStreamer.h:222
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
MCTargetAsmParser - Generic interface to target specific assembly parsers.
virtual bool tokenIsStartOfStatement(AsmToken::TokenKind Token)
virtual void onLabelParsed(MCSymbol *Symbol)
virtual bool parseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands)=0
Parse one assembly instruction.
const FeatureBitset & getAvailableFeatures() const
virtual void convertToMapAndConstraints(unsigned Kind, const OperandVector &Operands)=0
virtual const MCExpr * applySpecifier(const MCExpr *E, uint32_t, MCContext &Ctx)
bool ParsingMSInlineAsm
ParsingMSInlineAsm - Are we parsing ms-style inline assembly?
virtual bool equalIsAsmAssignment()
virtual bool parseRegister(MCRegister &Reg, SMLoc &StartLoc, SMLoc &EndLoc)=0
const MCTargetOptions & getTargetOptions() const
virtual bool ParseDirective(AsmToken DirectiveID)
ParseDirective - Parse a target specific assembler directive This method is deprecated,...
MCAsmParserSemaCallback * SemaCallback
SemaCallback - The Sema callback implementation.
void setParsingMSInlineAsm(bool Value)
virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc)
virtual bool omitRegisterFromClobberLists(MCRegister Reg)
Allows targets to let registers opt out of clobber lists.
virtual unsigned checkEarlyTargetMatchPredicate(MCInst &Inst, const OperandVector &Operands)
Validate the instruction match against any complex target predicates before rendering any operands to...
virtual bool parseDataExpr(const MCExpr *&Res)
virtual ParseStatus tryParseRegister(MCRegister &Reg, SMLoc &StartLoc, SMLoc &EndLoc)=0
tryParseRegister - parse one register if possible
virtual bool areEqualRegs(const MCParsedAsmOperand &Op1, const MCParsedAsmOperand &Op2) const
Returns whether two operands are registers and are equal.
virtual bool matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, OperandVector &Operands, MCStreamer &Out, uint64_t &ErrorInfo, bool MatchingInlineAsm)=0
Recognize a series of operands of a parsed instruction as an actual MCInst and emit it to the specifi...
const MCInstrInfo & MII
virtual void flushPendingInstructions(MCStreamer &Out)
Ensure that all previously parsed instructions have been emitted to the output streamer,...
MCTargetAsmParser(const MCSubtargetInfo &STI, const MCInstrInfo &MII)
virtual bool isLabel(AsmToken &Token)
void setAvailableFeatures(const FeatureBitset &Value)
virtual bool parseInstruction(ParseInstructionInfo &Info, StringRef Name, AsmToken Token, OperandVector &Operands)
const MCSubtargetInfo & getSTI() const
virtual void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc)
FeatureBitset AvailableFeatures
AvailableFeatures - The current set of available features.
void setSemaCallback(MCAsmParserSemaCallback *Callback)
MCTargetAsmParser(const MCTargetAsmParser &)=delete
virtual unsigned validateTargetOperandClass(MCParsedAsmOperand &Op, unsigned Kind)
Allow a target to add special case operand matching for things that tblgen doesn't/can't handle effec...
~MCTargetAsmParser() override
MCTargetAsmParser & operator=(const MCTargetAsmParser &)=delete
virtual unsigned checkTargetMatchPredicate(MCInst &Inst)
checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not ...
const MCSubtargetInfo * STI
Current STI.
static NearMissInfo getMissedPredicate(unsigned FailureCode)
unsigned getOperandClass() const
static NearMissInfo getTooFewOperands(unsigned OperandClass, unsigned Opcode)
static NearMissInfo getMissedOperand(unsigned OperandError, unsigned OperandClass, unsigned Opcode, unsigned OperandIndex)
unsigned getOperandIndex() const
const FeatureBitset & getFeatures() const
NearMissKind getKind() const
static NearMissInfo getMissedFeature(const FeatureBitset &MissingFeatures)
TooFewOperandsInfo TooFewOperands
unsigned getOperandError() const
static NearMissInfo getSuccess()
unsigned getOpcode() const
unsigned getPredicateError() const
Ternary parse status returned by various parse* methods.
constexpr bool isFailure() const
static constexpr StatusTy Failure
constexpr ParseStatus(bool Error)
constexpr ParseStatus(StatusTy Status)
constexpr bool isSuccess() const
static constexpr StatusTy Success
static constexpr StatusTy NoMatch
constexpr bool isNoMatch() const
constexpr ParseStatus(T)=delete
Represents a location in source code.
Definition SMLoc.h:22
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.
@ AOK_EndOfStatement
@ AOK_SizeDirective
SmallVectorImpl< std::unique_ptr< MCParsedAsmOperand > > OperandVector
const char AsmRewritePrecedence[]
DWARFExpression::Operation Op
AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len=0, int64_t val=0, bool Restricted=false)
AsmRewriteKind Kind
AsmRewrite(SMLoc loc, unsigned len, IntelExpr exp)
AsmRewrite(AsmRewriteKind kind, SMLoc loc, unsigned len, StringRef label)
constexpr DiagnosticPredicate(bool Matches)
enum llvm::DiagnosticPredicate::PredicateTy Predicate
constexpr bool isMatch() const
constexpr DiagnosticPredicate(PredicateTy T)
constexpr bool isNoMatch() const
constexpr bool isNearMatch() const
IntelExpr()=default
bool hasIndexReg() const
bool hasRegs() const
bool hasOffset() const
IntelExpr(StringRef baseReg, StringRef indexReg, unsigned scale, StringRef offsetName, int64_t imm, bool needBracs)
bool hasBaseReg() const
bool emitImm() const
bool isValid() const
ParseInstructionInfo(SmallVectorImpl< AsmRewrite > *rewrites)
SmallVectorImpl< AsmRewrite > * AsmRewrites