[mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.
authorToma Tabacu <toma.tabacu@imgtec.com>
Thu, 25 Jun 2015 09:52:02 +0000 (09:52 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Thu, 25 Jun 2015 09:52:02 +0000 (09:52 +0000)
commite39f000353834255336b9b34f018f7c3ffbf75f5
treebcb2945d0d5432ff2b7ca4a73fdd1e962b2e7a90
parenteb78c2fbdf4f1d7ef7f2b5340f41eca245e30d83
[mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.

Summary:
In an expression such as "(((a+b)+c)+d)", parseParenExpression() would only parse the "a+b)+c", which would result in an error later on in the parser.
This means that we can only parse one level of inner parentheses.

In order to fix this, I added a new function called parseParenExprOfDepth(), which parses a specified number of trailing parenthesis expressions
(except for the outermost parenthesis), and changed MipsAsmParser to use it in parseMemOffset instead of parseParenExpression().

Reviewers: dsanders, rafael

Reviewed By: dsanders, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9742

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240625 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCParser/MCAsmParser.h
lib/MC/MCParser/AsmParser.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/expr1.s