LLVM  13.0.0git
MCAsmParser.h
Go to the documentation of this file.
1 //===- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ----*- 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_MCASMPARSER_H
10 #define LLVM_MC_MCPARSER_MCASMPARSER_H
11 
12 #include "llvm/ADT/None.h"
13 #include "llvm/ADT/STLExtras.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/Twine.h"
19 #include "llvm/Support/SMLoc.h"
20 #include <cstdint>
21 #include <string>
22 #include <utility>
23 
24 namespace llvm {
25 
26 class MCAsmInfo;
27 class MCAsmParserExtension;
28 class MCContext;
29 class MCExpr;
30 class MCInstPrinter;
31 class MCInstrInfo;
32 class MCStreamer;
33 class MCTargetAsmParser;
34 class SourceMgr;
35 
37  enum IdKind {
38  IK_Invalid, // Initial state. Unexpected after a successful parsing.
39  IK_Label, // Function/Label reference.
40  IK_EnumVal, // Value of enumeration type.
41  IK_Var // Variable.
42  };
43  // Represents an Enum value
44  struct EnumIdentifier {
45  int64_t EnumVal;
46  };
47  // Represents a label/function reference
48  struct LabelIdentifier {
49  void *Decl;
50  };
51  // Represents a variable
53  void *Decl;
54  bool IsGlobalLV;
55  unsigned Length;
56  unsigned Size;
57  unsigned Type;
58  };
59  // An InlineAsm identifier can only be one of those
60  union {
64  };
65  bool isKind(IdKind kind) const { return Kind == kind; }
66  // Initializers
67  void setEnum(int64_t enumVal) {
68  assert(isKind(IK_Invalid) && "should be initialized only once");
69  Kind = IK_EnumVal;
70  Enum.EnumVal = enumVal;
71  }
72  void setLabel(void *decl) {
73  assert(isKind(IK_Invalid) && "should be initialized only once");
74  Kind = IK_Label;
75  Label.Decl = decl;
76  }
77  void setVar(void *decl, bool isGlobalLV, unsigned size, unsigned type) {
78  assert(isKind(IK_Invalid) && "should be initialized only once");
79  Kind = IK_Var;
80  Var.Decl = decl;
81  Var.IsGlobalLV = isGlobalLV;
82  Var.Size = size;
83  Var.Type = type;
84  Var.Length = size / type;
85  }
87 
88 private:
89  // Discriminate using the current kind.
90  IdKind Kind;
91 };
92 
93 // Generic type information for an assembly object.
94 // All sizes measured in bytes.
95 struct AsmTypeInfo {
97  unsigned Size = 0;
98  unsigned ElementSize = 0;
99  unsigned Length = 0;
100 };
101 
102 struct AsmFieldInfo {
104  unsigned Offset = 0;
105 };
106 
107 /// Generic Sema callback for assembly parser.
109 public:
110  virtual ~MCAsmParserSemaCallback();
111 
112  virtual void LookupInlineAsmIdentifier(StringRef &LineBuf,
114  bool IsUnevaluatedContext) = 0;
115  virtual StringRef LookupInlineAsmLabel(StringRef Identifier, SourceMgr &SM,
116  SMLoc Location, bool Create) = 0;
117  virtual bool LookupInlineAsmField(StringRef Base, StringRef Member,
118  unsigned &Offset) = 0;
119 };
120 
121 /// Generic assembler parser interface, for use by target specific
122 /// assembly parsers.
123 class MCAsmParser {
124 public:
127  std::pair<MCAsmParserExtension*, DirectiveHandler>;
128 
129  struct MCPendingError {
133  };
134 
135 private:
136  MCTargetAsmParser *TargetParser = nullptr;
137 
138 protected: // Can only create subclasses.
139  MCAsmParser();
140 
142 
143  /// Flag tracking whether any errors have been encountered.
144  bool HadError = false;
145 
146  bool ShowParsedOperands = false;
147 
148 public:
149  MCAsmParser(const MCAsmParser &) = delete;
150  MCAsmParser &operator=(const MCAsmParser &) = delete;
151  virtual ~MCAsmParser();
152 
154  ExtensionDirectiveHandler Handler) = 0;
155 
156  virtual void addAliasForDirective(StringRef Directive, StringRef Alias) = 0;
157 
158  virtual SourceMgr &getSourceManager() = 0;
159 
160  virtual MCAsmLexer &getLexer() = 0;
161  const MCAsmLexer &getLexer() const {
162  return const_cast<MCAsmParser*>(this)->getLexer();
163  }
164 
165  virtual MCContext &getContext() = 0;
166 
167  /// Return the output streamer for the assembler.
168  virtual MCStreamer &getStreamer() = 0;
169 
170  MCTargetAsmParser &getTargetParser() const { return *TargetParser; }
172 
173  virtual unsigned getAssemblerDialect() { return 0;}
174  virtual void setAssemblerDialect(unsigned i) { }
175 
176  bool getShowParsedOperands() const { return ShowParsedOperands; }
178 
179  /// Run the parser on the input source buffer.
180  virtual bool Run(bool NoInitialTextSection, bool NoFinalize = false) = 0;
181 
182  virtual void setParsingMSInlineAsm(bool V) = 0;
183  virtual bool isParsingMSInlineAsm() = 0;
184 
185  virtual bool discardLTOSymbol(StringRef) const { return false; }
186 
187  virtual bool isParsingMasm() const { return false; }
188 
189  virtual bool defineMacro(StringRef Name, StringRef Value) { return true; }
190 
191  virtual bool lookUpField(StringRef Name, AsmFieldInfo &Info) const {
192  return true;
193  }
194  virtual bool lookUpField(StringRef Base, StringRef Member,
195  AsmFieldInfo &Info) const {
196  return true;
197  }
198 
199  virtual bool lookUpType(StringRef Name, AsmTypeInfo &Info) const {
200  return true;
201  }
202 
203  /// Parse MS-style inline assembly.
204  virtual bool parseMSInlineAsm(
205  void *AsmLoc, std::string &AsmString, unsigned &NumOutputs,
206  unsigned &NumInputs, SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
207  SmallVectorImpl<std::string> &Constraints,
208  SmallVectorImpl<std::string> &Clobbers, const MCInstrInfo *MII,
210 
211  /// Emit a note at the location \p L, with the message \p Msg.
212  virtual void Note(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
213 
214  /// Emit a warning at the location \p L, with the message \p Msg.
215  ///
216  /// \return The return value is true, if warnings are fatal.
217  virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
218 
219  /// Return an error at the location \p L, with the message \p Msg. This
220  /// may be modified before being emitted.
221  ///
222  /// \return The return value is always true, as an idiomatic convenience to
223  /// clients.
224  bool Error(SMLoc L, const Twine &Msg, SMRange Range = None);
225 
226  /// Emit an error at the location \p L, with the message \p Msg.
227  ///
228  /// \return The return value is always true, as an idiomatic convenience to
229  /// clients.
230  virtual bool printError(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
231 
232  bool hasPendingError() { return !PendingErrors.empty(); }
233 
235  bool rv = !PendingErrors.empty();
236  for (auto Err : PendingErrors) {
237  printError(Err.Loc, Twine(Err.Msg), Err.Range);
238  }
239  PendingErrors.clear();
240  return rv;
241  }
242 
243  void clearPendingErrors() { PendingErrors.clear(); }
244 
245  bool addErrorSuffix(const Twine &Suffix);
246 
247  /// Get the next AsmToken in the stream, possibly handling file
248  /// inclusion first.
249  virtual const AsmToken &Lex() = 0;
250 
251  /// Get the current AsmToken from the stream.
252  const AsmToken &getTok() const;
253 
254  /// Report an error at the current lexer location.
255  bool TokError(const Twine &Msg, SMRange Range = None);
256 
257  bool parseTokenLoc(SMLoc &Loc);
258  bool parseToken(AsmToken::TokenKind T, const Twine &Msg = "unexpected token");
259  /// Attempt to parse and consume token, returning true on
260  /// success.
262 
263  bool parseComma() { return parseToken(AsmToken::Comma, "expected comma"); }
264  bool parseEOL();
265  bool parseEOL(const Twine &ErrMsg);
266 
267  bool parseMany(function_ref<bool()> parseOne, bool hasComma = true);
268 
269  bool parseIntToken(int64_t &V, const Twine &ErrMsg);
270 
271  bool check(bool P, const Twine &Msg);
272  bool check(bool P, SMLoc Loc, const Twine &Msg);
273 
274  /// Parse an identifier or string (as a quoted identifier) and set \p
275  /// Res to the identifier contents.
276  virtual bool parseIdentifier(StringRef &Res) = 0;
277 
278  /// Parse up to the end of statement and return the contents from the
279  /// current token until the end of the statement; the current token on exit
280  /// will be either the EndOfStatement or EOF.
282 
283  /// Parse the current token as a string which may include escaped
284  /// characters and return the string contents.
285  virtual bool parseEscapedString(std::string &Data) = 0;
286 
287  /// Parse an angle-bracket delimited string at the current position if one is
288  /// present, returning the string contents.
289  virtual bool parseAngleBracketString(std::string &Data) = 0;
290 
291  /// Skip to the end of the current statement, for error recovery.
292  virtual void eatToEndOfStatement() = 0;
293 
294  /// Parse an arbitrary expression.
295  ///
296  /// \param Res - The value of the expression. The result is undefined
297  /// on error.
298  /// \return - False on success.
299  virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
300  bool parseExpression(const MCExpr *&Res);
301 
302  /// Parse a primary expression.
303  ///
304  /// \param Res - The value of the expression. The result is undefined
305  /// on error.
306  /// \return - False on success.
307  virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc,
308  AsmTypeInfo *TypeInfo) = 0;
309 
310  /// Parse an arbitrary expression, assuming that an initial '(' has
311  /// already been consumed.
312  ///
313  /// \param Res - The value of the expression. The result is undefined
314  /// on error.
315  /// \return - False on success.
316  virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
317 
318  /// Parse an expression which must evaluate to an absolute value.
319  ///
320  /// \param Res - The value of the absolute expression. The result is undefined
321  /// on error.
322  /// \return - False on success.
323  virtual bool parseAbsoluteExpression(int64_t &Res) = 0;
324 
325  /// Ensure that we have a valid section set in the streamer. Otherwise,
326  /// report an error and switch to .text.
327  /// \return - False on success.
328  virtual bool checkForValidSection() = 0;
329 
330  /// Parse an arbitrary expression of a specified parenthesis depth,
331  /// assuming that the initial '(' characters have already been consumed.
332  ///
333  /// \param ParenDepth - Specifies how many trailing expressions outside the
334  /// current parentheses we have to parse.
335  /// \param Res - The value of the expression. The result is undefined
336  /// on error.
337  /// \return - False on success.
338  virtual bool parseParenExprOfDepth(unsigned ParenDepth, const MCExpr *&Res,
339  SMLoc &EndLoc) = 0;
340 };
341 
342 /// Create an MCAsmParser instance for parsing assembly similar to gas syntax
343 MCAsmParser *createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &,
344  const MCAsmInfo &, unsigned CB = 0);
345 
346 /// Create an MCAsmParser instance for parsing Microsoft MASM-style assembly
347 MCAsmParser *createMCMasmParser(SourceMgr &, MCContext &, MCStreamer &,
348  const MCAsmInfo &, unsigned CB = 0);
349 
350 } // end namespace llvm
351 
352 #endif // LLVM_MC_MCPARSER_MCASMPARSER_H
i
i
Definition: README.txt:29
llvm::MCAsmParser
Generic assembler parser interface, for use by target specific assembly parsers.
Definition: MCAsmParser.h:123
llvm::MCAsmParser::getSourceManager
virtual SourceMgr & getSourceManager()=0
llvm::AsmFieldInfo::Offset
unsigned Offset
Definition: MCAsmParser.h:104
llvm::MCAsmParser::operator=
MCAsmParser & operator=(const MCAsmParser &)=delete
llvm::InlineAsmIdentifierInfo::IdKind
IdKind
Definition: MCAsmParser.h:37
llvm::MCAsmParser::Error
bool Error(SMLoc L, const Twine &Msg, SMRange Range=None)
Return an error at the location L, with the message Msg.
Definition: MCAsmParser.cpp:99
llvm::MCAsmParser::printError
virtual bool printError(SMLoc L, const Twine &Msg, SMRange Range=None)=0
Emit an error at the location L, with the message Msg.
llvm::MCAsmParserSemaCallback
Generic Sema callback for assembly parser.
Definition: MCAsmParser.h:108
llvm::MCAsmParser::getStreamer
virtual MCStreamer & getStreamer()=0
Return the output streamer for the assembler.
llvm
Definition: AllocatorList.h:23
llvm::MCAsmParser::getLexer
const MCAsmLexer & getLexer() const
Definition: MCAsmParser.h:161
llvm::InlineAsmIdentifierInfo::setEnum
void setEnum(int64_t enumVal)
Definition: MCAsmParser.h:67
llvm::MCAsmLexer
Generic assembler lexer interface, for use by target specific assembly lexers.
Definition: MCAsmLexer.h:39
llvm::InlineAsmIdentifierInfo::VariableIdentifier::IsGlobalLV
bool IsGlobalLV
Definition: MCAsmParser.h:54
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:71
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::MCAsmParser::addDirectiveHandler
virtual void addDirectiveHandler(StringRef Directive, ExtensionDirectiveHandler Handler)=0
llvm::MCAsmParser::parseEOL
bool parseEOL()
Definition: MCAsmParser.cpp:47
llvm::MCAsmParser::ShowParsedOperands
bool ShowParsedOperands
Definition: MCAsmParser.h:146
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::MCAsmParser::setAssemblerDialect
virtual void setAssemblerDialect(unsigned i)
Definition: MCAsmParser.h:174
llvm::MCAsmParser::parseIdentifier
virtual bool parseIdentifier(StringRef &Res)=0
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents.
llvm::MCAsmParser::getAssemblerDialect
virtual unsigned getAssemblerDialect()
Definition: MCAsmParser.h:173
llvm::MCAsmParser::parseEscapedString
virtual bool parseEscapedString(std::string &Data)=0
Parse the current token as a string which may include escaped characters and return the string conten...
llvm::InlineAsmIdentifierInfo::InlineAsmIdentifierInfo
InlineAsmIdentifierInfo()
Definition: MCAsmParser.h:86
llvm::MCAsmParserSemaCallback::LookupInlineAsmIdentifier
virtual void LookupInlineAsmIdentifier(StringRef &LineBuf, InlineAsmIdentifierInfo &Info, bool IsUnevaluatedContext)=0
llvm::MCAsmParser::defineMacro
virtual bool defineMacro(StringRef Name, StringRef Value)
Definition: MCAsmParser.h:189
llvm::MCAsmParser::parseParenExprOfDepth
virtual bool parseParenExprOfDepth(unsigned ParenDepth, const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression of a specified parenthesis depth, assuming that the initial '(' charact...
llvm::InlineAsmIdentifierInfo::EnumIdentifier
Definition: MCAsmParser.h:44
llvm::MCAsmParser::parseOptionalToken
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
Definition: MCAsmParser.cpp:78
llvm::AsmTypeInfo::Name
StringRef Name
Definition: MCAsmParser.h:96
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::InlineAsmIdentifierInfo
Definition: MCAsmParser.h:36
STLExtras.h
llvm::MCAsmParserSemaCallback::~MCAsmParserSemaCallback
virtual ~MCAsmParserSemaCallback()
llvm::MCAsmParser::~MCAsmParser
virtual ~MCAsmParser()
llvm::InlineAsmIdentifierInfo::Label
LabelIdentifier Label
Definition: MCAsmParser.h:62
llvm::InlineAsmIdentifierInfo::IK_EnumVal
@ IK_EnumVal
Definition: MCAsmParser.h:40
llvm::InlineAsmIdentifierInfo::LabelIdentifier::Decl
void * Decl
Definition: MCAsmParser.h:49
llvm::MCAsmParser::MCPendingError
Definition: MCAsmParser.h:129
llvm::Data
@ Data
Definition: SIMachineScheduler.h:56
llvm::MCAsmParser::parseAbsoluteExpression
virtual bool parseAbsoluteExpression(int64_t &Res)=0
Parse an expression which must evaluate to an absolute value.
llvm::AsmToken
Target independent representation for an assembler token.
Definition: MCAsmMacro.h:21
llvm::createMCMasmParser
MCAsmParser * createMCMasmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance for parsing Microsoft MASM-style assembly.
Definition: MasmParser.cpp:7307
llvm::MCAsmParser::Lex
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:197
llvm::MCAsmParser::hasPendingError
bool hasPendingError()
Definition: MCAsmParser.h:232
llvm::MCAsmParserSemaCallback::LookupInlineAsmField
virtual bool LookupInlineAsmField(StringRef Base, StringRef Member, unsigned &Offset)=0
llvm::MCAsmParser::parseExpression
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
SmallString.h
llvm::MCAsmParser::parseStringToEndOfStatement
virtual StringRef parseStringToEndOfStatement()=0
Parse up to the end of statement and return the contents from the current token until the end of the ...
llvm::AsmTypeInfo::Size
unsigned Size
Definition: MCAsmParser.h:97
Twine.h
llvm::MCAsmParser::parseIntToken
bool parseIntToken(int64_t &V, const Twine &ErrMsg)
Definition: MCAsmParser.cpp:70
llvm::AsmTypeInfo
Definition: MCAsmParser.h:95
llvm::MCAsmParser::discardLTOSymbol
virtual bool discardLTOSymbol(StringRef) const
Definition: MCAsmParser.h:185
SI
@ SI
Definition: SIInstrInfo.cpp:7411
IP
Definition: NVPTXLowerArgs.cpp:166
llvm::MCAsmParser::printPendingErrors
bool printPendingErrors()
Definition: MCAsmParser.h:234
llvm::MCAsmParser::PendingErrors
SmallVector< MCPendingError, 0 > PendingErrors
Definition: MCAsmParser.h:141
llvm::MCAsmParser::ExtensionDirectiveHandler
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
Definition: MCAsmParser.h:127
llvm::MCAsmParser::parseComma
bool parseComma()
Definition: MCAsmParser.h:263
llvm::MCAsmParser::getContext
virtual MCContext & getContext()=0
llvm::MCAsmParser::isParsingMasm
virtual bool isParsingMasm() const
Definition: MCAsmParser.h:187
SMLoc.h
llvm::MCAsmParser::addAliasForDirective
virtual void addAliasForDirective(StringRef Directive, StringRef Alias)=0
llvm::InlineAsmIdentifierInfo::IK_Label
@ IK_Label
Definition: MCAsmParser.h:39
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::MCAsmParser::Note
virtual void Note(SMLoc L, const Twine &Msg, SMRange Range=None)=0
Emit a note at the location L, with the message Msg.
llvm::None
const NoneType None
Definition: None.h:23
llvm::MCAsmParser::setParsingMSInlineAsm
virtual void setParsingMSInlineAsm(bool V)=0
llvm::MCAsmParser::parsePrimaryExpr
virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc, AsmTypeInfo *TypeInfo)=0
Parse a primary expression.
llvm::SmallString< 64 >
llvm::MCAsmParser::MCPendingError::Range
SMRange Range
Definition: MCAsmParser.h:132
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:168
llvm::AsmTypeInfo::ElementSize
unsigned ElementSize
Definition: MCAsmParser.h:98
llvm::MCAsmParser::getTargetParser
MCTargetAsmParser & getTargetParser() const
Definition: MCAsmParser.h:170
llvm::MCAsmParser::checkForValidSection
virtual bool checkForValidSection()=0
Ensure that we have a valid section set in the streamer.
MCAsmLexer.h
type
AMD64 Optimization Manual has some nice information about optimizing integer multiplication by a constant How much of it applies to Intel s X86 implementation There are definite trade offs to xmm0 cvttss2siq rdx jb L3 subss xmm0 rax cvttss2siq rdx xorq rdx rax ret instead of xmm1 cvttss2siq rcx movaps xmm2 subss xmm2 cvttss2siq rax rdx xorq rax ucomiss xmm0 cmovb rax ret Seems like the jb branch has high likelihood of being taken It would have saved a few instructions It s not possible to reference and DH registers in an instruction requiring REX prefix divb and mulb both produce results in AH If isel emits a CopyFromReg which gets turned into a movb and that can be allocated a r8b r15b To get around isel emits a CopyFromReg from AX and then right shift it down by and truncate it It s not pretty but it works We need some register allocation magic to make the hack go which would often require a callee saved register Callees usually need to keep this value live for most of their body so it doesn t add a significant burden on them We currently implement this in however this is suboptimal because it means that it would be quite awkward to implement the optimization for callers A better implementation would be to relax the LLVM IR rules for sret arguments to allow a function with an sret argument to have a non void return type
Definition: README-X86-64.txt:70
llvm::InlineAsmIdentifierInfo::IK_Invalid
@ IK_Invalid
Definition: MCAsmParser.h:38
llvm::MCAsmParser::addErrorSuffix
bool addErrorSuffix(const Twine &Suffix)
Definition: MCAsmParser.cpp:115
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
llvm::MCAsmParser::parseMany
bool parseMany(function_ref< bool()> parseOne, bool hasComma=true)
Definition: MCAsmParser.cpp:124
llvm::InlineAsmIdentifierInfo::Enum
EnumIdentifier Enum
Definition: MCAsmParser.h:61
llvm::MCAsmParser::check
bool check(bool P, const Twine &Msg)
Definition: MCAsmParser.cpp:85
llvm::InlineAsmIdentifierInfo::VariableIdentifier::Length
unsigned Length
Definition: MCAsmParser.h:55
llvm::AsmFieldInfo
Definition: MCAsmParser.h:102
llvm::InlineAsmIdentifierInfo::IK_Var
@ IK_Var
Definition: MCAsmParser.h:41
llvm::MCAsmParser::MCPendingError::Loc
SMLoc Loc
Definition: MCAsmParser.h:130
llvm::MCAsmParser::parseParenExpression
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression, assuming that an initial '(' has already been consumed.
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCAsmParser::lookUpField
virtual bool lookUpField(StringRef Base, StringRef Member, AsmFieldInfo &Info) const
Definition: MCAsmParser.h:194
llvm::MCAsmParser::DirectiveHandler
bool(*)(MCAsmParserExtension *, StringRef, SMLoc) DirectiveHandler
Definition: MCAsmParser.h:125
llvm::InlineAsmIdentifierInfo::setVar
void setVar(void *decl, bool isGlobalLV, unsigned size, unsigned type)
Definition: MCAsmParser.h:77
llvm::AsmToken::Comma
@ Comma
Definition: MCAsmMacro.h:49
llvm::size
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition: STLExtras.h:1463
None.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::MCAsmParser::getTok
const AsmToken & getTok() const
Get the current AsmToken from the stream.
Definition: MCAsmParser.cpp:38
llvm::MCAsmParserExtension
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
Definition: MCAsmParserExtension.h:25
llvm::SourceMgr
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
Definition: SourceMgr.h:31
llvm::MCAsmParser::lookUpField
virtual bool lookUpField(StringRef Name, AsmFieldInfo &Info) const
Definition: MCAsmParser.h:191
llvm::MCAsmParser::parseAngleBracketString
virtual bool parseAngleBracketString(std::string &Data)=0
Parse an angle-bracket delimited string at the current position if one is present,...
llvm::MCAsmParser::isParsingMSInlineAsm
virtual bool isParsingMSInlineAsm()=0
llvm::AsmFieldInfo::Type
AsmTypeInfo Type
Definition: MCAsmParser.h:103
llvm::InlineAsmIdentifierInfo::Var
VariableIdentifier Var
Definition: MCAsmParser.h:63
llvm::MCAsmParser::eatToEndOfStatement
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::MCAsmParser::clearPendingErrors
void clearPendingErrors()
Definition: MCAsmParser.h:243
llvm::MCAsmParser::TokError
bool TokError(const Twine &Msg, SMRange Range=None)
Report an error at the current lexer location.
Definition: MCAsmParser.cpp:95
llvm::MCAsmParserSemaCallback::LookupInlineAsmLabel
virtual StringRef LookupInlineAsmLabel(StringRef Identifier, SourceMgr &SM, SMLoc Location, bool Create)=0
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MCAsmParser::MCPendingError::Msg
SmallString< 64 > Msg
Definition: MCAsmParser.h:131
llvm::InlineAsmIdentifierInfo::VariableIdentifier::Size
unsigned Size
Definition: MCAsmParser.h:56
llvm::MCTargetAsmParser
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Definition: MCTargetAsmParser.h:309
llvm::InlineAsmIdentifierInfo::EnumIdentifier::EnumVal
int64_t EnumVal
Definition: MCAsmParser.h:45
llvm::MCAsmParser::lookUpType
virtual bool lookUpType(StringRef Name, AsmTypeInfo &Info) const
Definition: MCAsmParser.h:199
llvm::MCAsmParser::parseMSInlineAsm
virtual bool parseMSInlineAsm(void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, SmallVectorImpl< std::pair< void *, bool >> &OpDecls, SmallVectorImpl< std::string > &Constraints, SmallVectorImpl< std::string > &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI)=0
Parse MS-style inline assembly.
llvm::AsmTypeInfo::Length
unsigned Length
Definition: MCAsmParser.h:99
llvm::AsmToken::TokenKind
TokenKind
Definition: MCAsmMacro.h:23
SmallVector.h
llvm::MCAsmParser::getLexer
virtual MCAsmLexer & getLexer()=0
llvm::SMRange
Represents a range in source code.
Definition: SMLoc.h:48
llvm::MCAsmParser::HadError
bool HadError
Flag tracking whether any errors have been encountered.
Definition: MCAsmParser.h:144
llvm::InlineAsmIdentifierInfo::setLabel
void setLabel(void *decl)
Definition: MCAsmParser.h:72
llvm::createMCAsmParser
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance for parsing assembly similar to gas syntax.
Definition: AsmParser.cpp:6211
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::InlineAsmIdentifierInfo::VariableIdentifier::Type
unsigned Type
Definition: MCAsmParser.h:57
llvm::InlineAsmIdentifierInfo::VariableIdentifier
Definition: MCAsmParser.h:52
llvm::MCAsmParser::setShowParsedOperands
void setShowParsedOperands(bool Value)
Definition: MCAsmParser.h:177
llvm::MCAsmParser::Warning
virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range=None)=0
Emit a warning at the location L, with the message Msg.
llvm::InlineAsmIdentifierInfo::LabelIdentifier
Definition: MCAsmParser.h:48
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCAsmParser::getShowParsedOperands
bool getShowParsedOperands() const
Definition: MCAsmParser.h:176
llvm::Directive
Definition: DirectiveEmitter.h:100
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::InlineAsmIdentifierInfo::VariableIdentifier::Decl
void * Decl
Definition: MCAsmParser.h:53
llvm::InlineAsmIdentifierInfo::isKind
bool isKind(IdKind kind) const
Definition: MCAsmParser.h:65
llvm::MCAsmParser::Run
virtual bool Run(bool NoInitialTextSection, bool NoFinalize=false)=0
Run the parser on the input source buffer.
llvm::MCAsmParser::MCAsmParser
MCAsmParser()
Definition: MCAsmParser.cpp:28
llvm::MCAsmParser::parseToken
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
Definition: MCAsmParser.cpp:61
llvm::MCAsmParser::setTargetParser
void setTargetParser(MCTargetAsmParser &P)
Definition: MCAsmParser.cpp:32
llvm::MCAsmParser::parseTokenLoc
bool parseTokenLoc(SMLoc &Loc)
Definition: MCAsmParser.cpp:42