summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-24 01:07:33 +0000
committerChris Lattner <sabre@nondot.org>2010-01-24 01:07:33 +0000
commit807a3bcbbbf65c50d9ad87b7c86b85119389a730 (patch)
tree0588465d17570ed398da3549c7f2ede764ee03ef
parentd3637edc4c3a71ba93dbba83d6c668411a0f45e8 (diff)
downloadbcm5719-llvm-807a3bcbbbf65c50d9ad87b7c86b85119389a730.tar.gz
bcm5719-llvm-807a3bcbbbf65c50d9ad87b7c86b85119389a730.zip
fix a parsing problem on instructions like:
movw $8, (_cost_table_-L97$pb)+66(%eax) After the parens, we could still have a binop. llvm-svn: 94345
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp7
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp4
-rw-r--r--llvm/test/MC/AsmParser/exprs.s1
3 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index dd438b76124..077d2dffa65 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/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/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 7a9218e743c..19fbf85e4af 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/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/llvm/test/MC/AsmParser/exprs.s b/llvm/test/MC/AsmParser/exprs.s
index 5fa4a371c3d..62b11c2d4e4 100644
--- a/llvm/test/MC/AsmParser/exprs.s
+++ b/llvm/test/MC/AsmParser/exprs.s
@@ -60,3 +60,4 @@ n:
nop
+ movw $8, (42)+66(%eax)
OpenPOWER on IntegriCloud