[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
authorChad Rosier <mcrosier@apple.com>
Tue, 9 Apr 2013 19:34:59 +0000 (19:34 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 9 Apr 2013 19:34:59 +0000 (19:34 +0000)
commitd4727e3798981af3d1308418464a10a398290851
treec44579a1404a7719cc6ca855cd283dcd5914bdaf
parente0828ec6027e43724a7c5c76a3409344198dac71
[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]

The existing test cases exercise this patch.
rdar://13611297

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179115 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCParser/MCAsmParser.h
lib/MC/MCParser/AsmParser.cpp
lib/Target/X86/AsmParser/X86AsmParser.cpp