[RISCV] Move FRM parsing in the assembler to a custom operand parser.
authorCraig Topper <craig.topper@sifive.com>
Sun, 29 Jan 2023 20:25:00 +0000 (12:25 -0800)
committerCraig Topper <craig.topper@sifive.com>
Sun, 29 Jan 2023 20:25:00 +0000 (12:25 -0800)
commit2a45aa8dc2b98815c2e270be3c5d1832c9eec10e
tree5b248bc28554c1ba809e665ba9f34aced894add6
parent1f6150ff520c1c84f5e71df898529fa22b1f0e41
[RISCV] Move FRM parsing in the assembler to a custom operand parser.

Previously we parsed it as a symbol, and then accessed the name.
This works, but seems like an unusual way to do it.

This adds a custom parser that looks for an Identifier token containing
one of the valid FRM strings.

Differential Revision: https://reviews.llvm.org/D142833
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoF.td