summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCParser
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-10 17:35:30 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-10 17:35:30 +0000
commitba69b366929a39d393e7eed0bbf2edc31d8de599 (patch)
treebdb781c0154504364b38eb9fa592066ccbe89e4c /include/llvm/MC/MCParser
parentb187f8cd1ce98e40405ce8acf49997444646408a (diff)
downloadllvm-ba69b366929a39d393e7eed0bbf2edc31d8de599.tar.gz
llvm-ba69b366929a39d393e7eed0bbf2edc31d8de599.tar.bz2
llvm-ba69b366929a39d393e7eed0bbf2edc31d8de599.tar.xz
Reapply r179115, but use parsePrimaryExpression a little more judiciously.
Test cases that regressed due to r179115, plus a few more, were added in r179182. Original commit message below: [ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to parse an identifier. Otherwise, parseExpression may parse multiple tokens, which makes it impossible to properly compute an immediate displacement. An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in the below example: __asm mov eax, [Symbol + ImmDisp] Part of rdar://13611297 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCParser')
-rw-r--r--include/llvm/MC/MCParser/MCAsmParser.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/MC/MCParser/MCAsmParser.h b/include/llvm/MC/MCParser/MCAsmParser.h
index d7e3902ac4..601f8f7734 100644
--- a/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/include/llvm/MC/MCParser/MCAsmParser.h
@@ -151,6 +151,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.
///