[PATCH] D98124: [RISCV] Clean up parsing fence arguments

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 6 11:47:12 PST 2021


jrtc27 created this revision.
jrtc27 added reviewers: craig.topper, luismarques, asb.
Herald added subscribers: vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, jfb, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
jrtc27 requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Currently this is done rather hackily by letting it be parsed as an
MCSymbolRefExpr whose name we then validate. The logic is also split
across isFenceArg and addFenceArgOperands as a result. Instead, use a
custom parser so we look at the identifier token directly and construct
the immediate at the same time. As well as being cleaner, this also
allows us to give better error messages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98124

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98124.328795.patch
Type: text/x-patch
Size: 6931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210306/d113550e/attachment.bin>


More information about the llvm-commits mailing list