diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-24 01:07:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-24 01:07:33 +0000 |
commit | 75f265fbbbb64ab060bf41c5a4677ce56014ce9f (patch) | |
tree | 08f32d5af2ae43aa5dae6b92ca10701fc3de83f5 | |
parent | dd7da4f368c7e1139ef78f36ef173a8b8f8f1c61 (diff) | |
download | external_llvm-75f265fbbbb64ab060bf41c5a4677ce56014ce9f.zip external_llvm-75f265fbbbb64ab060bf41c5a4677ce56014ce9f.tar.gz external_llvm-75f265fbbbb64ab060bf41c5a4677ce56014ce9f.tar.bz2 |
fix a parsing problem on instructions like:
movw $8, (_cost_table_-L97$pb)+66(%eax)
After the parens, we could still have a binop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94345 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 7 | ||||
-rw-r--r-- | lib/Target/X86/AsmParser/X86AsmParser.cpp | 4 | ||||
-rw-r--r-- | test/MC/AsmParser/exprs.s | 1 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index dd438b7..077d2df 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -331,10 +331,9 @@ bool AsmParser::ParseExpression(const MCExpr *&Res, SMLoc &EndLoc) { } bool AsmParser::ParseParenExpression(const MCExpr *&Res, SMLoc &EndLoc) { - if (ParseParenExpr(Res, EndLoc)) - return true; - - return false; + Res = 0; + return ParseParenExpr(Res, EndLoc) || + ParseBinOpRHS(1, Res, EndLoc); } bool AsmParser::ParseAbsoluteExpression(int64_t &Res) { diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 7a9218e..19fbf85 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -300,8 +300,8 @@ X86Operand *X86ATTAsmParser::ParseMemOperand() { // We have to disambiguate a parenthesized expression "(4+5)" from the start // of a memory operand with a missing displacement "(%ebx)" or "(,%eax)". The - // only way to do this without lookahead is to eat the ( and see what is after - // it. + // only way to do this without lookahead is to eat the '(' and see what is + // after it. const MCExpr *Disp = MCConstantExpr::Create(0, getParser().getContext()); if (getLexer().isNot(AsmToken::LParen)) { SMLoc ExprEnd; diff --git a/test/MC/AsmParser/exprs.s b/test/MC/AsmParser/exprs.s index 5fa4a37..62b11c2 100644 --- a/test/MC/AsmParser/exprs.s +++ b/test/MC/AsmParser/exprs.s @@ -60,3 +60,4 @@ n: nop + movw $8, (42)+66(%eax) |