[PATCH] D52029: [RISCV][MC] Improve parsing of jal/j operands

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 05:53:50 PDT 2018


asb created this revision.
asb added a reviewer: apazos.
Herald added subscribers: jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar.

Examples such as `jal a3`, `j a3` and `jal a3, a3` were previously accepted by gas but rejected by LLVM MC. This patch rectifies this. I introduce RISCVAsmParser::parseJALOffset to ensure that symbol names that coincide with register names can safely be parsed. This is made a somewhat fiddly due to the single-operand alias form (see the comment in parseJALOffset for more info).


https://reviews.llvm.org/D52029

Files:
  lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  lib/Target/RISCV/RISCVInstrInfo.td
  test/MC/RISCV/rv32i-invalid.s
  test/MC/RISCV/rv32i-valid.s
  test/MC/RISCV/rvi-aliases-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52029.165262.patch
Type: text/x-patch
Size: 7917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180913/7ceeb723/attachment-0001.bin>


More information about the llvm-commits mailing list