summaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCParser/MCAsmParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCParser/MCAsmParser.h')
-rw-r--r--include/llvm/MC/MCParser/MCAsmParser.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/include/llvm/MC/MCParser/MCAsmParser.h b/include/llvm/MC/MCParser/MCAsmParser.h
index d7e3902..dcc9886 100644
--- a/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/include/llvm/MC/MCParser/MCAsmParser.h
@@ -33,15 +33,31 @@ class Twine;
/// MCAsmParserSemaCallback - Generic Sema callback for assembly parser.
class MCAsmParserSemaCallback {
public:
+ typedef struct {
+ void *OpDecl;
+ bool IsVarDecl;
+ unsigned Length, Size, Type;
+
+ void clear() {
+ OpDecl = 0;
+ IsVarDecl = false;
+ Length = 1;
+ Size = 0;
+ Type = 0;
+ }
+ } InlineAsmIdentifierInfo;
+
virtual ~MCAsmParserSemaCallback();
- virtual void *LookupInlineAsmIdentifier(StringRef Name, void *Loc,
- unsigned &Length, unsigned &Size,
- unsigned &Type, bool &IsVarDecl) = 0;
+ virtual void *LookupInlineAsmIdentifier(StringRef &LineBuf,
+ InlineAsmIdentifierInfo &Info,
+ bool IsUnevaluatedContext) = 0;
virtual bool LookupInlineAsmField(StringRef Base, StringRef Member,
unsigned &Offset) = 0;
};
+typedef MCAsmParserSemaCallback::InlineAsmIdentifierInfo
+ InlineAsmIdentifierInfo;
/// MCAsmParser - Generic assembler parser interface, for use by target specific
/// assembly parsers.
@@ -106,14 +122,14 @@ public:
///
/// \return The return value is true, if warnings are fatal.
virtual bool Warning(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) = 0;
+ ArrayRef<SMRange> Ranges = None) = 0;
/// Error - Emit an error at the location \p L, with the message \p Msg.
///
/// \return The return value is always true, as an idiomatic convenience to
/// clients.
virtual bool Error(SMLoc L, const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>()) = 0;
+ ArrayRef<SMRange> Ranges = None) = 0;
/// Lex - Get the next AsmToken in the stream, possibly handling file
/// inclusion first.
@@ -123,8 +139,7 @@ public:
const AsmToken &getTok();
/// \brief Report an error at the current lexer location.
- bool TokError(const Twine &Msg,
- ArrayRef<SMRange> Ranges = ArrayRef<SMRange>());
+ bool TokError(const Twine &Msg, ArrayRef<SMRange> Ranges = None);
/// parseIdentifier - Parse an identifier or string (as a quoted identifier)
/// and set \p Res to the identifier contents.
@@ -151,6 +166,13 @@ public:
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc) = 0;
bool parseExpression(const MCExpr *&Res);
+ /// parsePrimaryExpr - Parse a primary expression.
+ ///
+ /// @param Res - The value of the expression. The result is undefined
+ /// on error.
+ /// @result - False on success.
+ virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) = 0;
+
/// parseParenExpression - Parse an arbitrary expression, assuming that an
/// initial '(' has already been consumed.
///
OpenPOWER on IntegriCloud