[RISCV][MC] Use a custom ParserMethod for the bare_symbol operand type
authorAlex Bradbury <asb@lowrisc.org>
Tue, 18 Sep 2018 15:18:16 +0000 (15:18 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Tue, 18 Sep 2018 15:18:16 +0000 (15:18 +0000)
commit68f73c12067573c01e6e1351d346776d0373570d
tree74dad3596f68b07ebcd730a9226e2a6cdc0798df
parent7d0e18d0dd287eefcd379c2f3693c373ae927071
[RISCV][MC] Use a custom ParserMethod for the bare_symbol operand type

This allows the hard-coded shouldForceImmediate logic to be removed because
the generated MatchOperandParserImpl makes use of the current context (i.e.
the current mnemonic) to determine parsing behaviour, and so won't first try
to parse a register before parsing a symbol name.

No functional change is intended. gas accepts immediate arguments for call,
tail and lla. This patch doesn't address this discrepancy.

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

llvm-svn: 342488
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.td