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