OSDN Git Service

[mips] Partially fix PR34391
authorSimon Dardis <simon.dardis@imgtec.com>
Tue, 10 Oct 2017 13:34:45 +0000 (13:34 +0000)
committerSimon Dardis <simon.dardis@imgtec.com>
Tue, 10 Oct 2017 13:34:45 +0000 (13:34 +0000)
commitbceed5cdaf64ea2520f5342bb83ba97a8899c28a
treea1eb4f83a60dbc23c66dbf4d7388f1fd1b2f1bb3
parent60e48ff092336d0e1767774358104a6a4f03c85f
[mips] Partially fix PR34391

Previously, the parsing of the 'subu $reg, ($reg,) imm' relied on a parser
which also rendered the operand to the instruction. In some cases the
general parser could construct an MCExpr which was not a MCConstantExpr
which MipsAsmParser was expecting.

Address this by altering the special handling to cope with unexpected inputs
and fine-tune the handling of cases where an register name that is not
available in the current ABI is regarded as not a match for the custom parser
but also not as an outright error.

Also enforces the binutils restriction that only constants are accepted.

This partially resolves PR34391.

Thanks to Ed Maste for reporting the issue!

Reviewers: nitesh.jain, arichardson

Differential Revision: https://reviews.llvm.org/D37476

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315310 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/macro-aliases-invalid-wrong-error.s [new file with mode: 0644]
test/MC/Mips/macro-aliases.s [new file with mode: 0644]