[RISCV] When parsing vsetvli in the assembler, use StringRef::getAsInteger instead...
authorCraig Topper <craig.topper@sifive.com>
Tue, 8 Dec 2020 18:30:06 +0000 (10:30 -0800)
committerCraig Topper <craig.topper@sifive.com>
Tue, 8 Dec 2020 19:25:39 +0000 (11:25 -0800)
commit88e58939dcea54d59a77277d420a014dc90b06e7
treebf98a0c10c59ce0ef47ff4c33fab2e2a0fd4795a
parentfc750f609dfb2fd51b6810cc55058568dfe4b3a9
[RISCV] When parsing vsetvli in the assembler, use StringRef::getAsInteger instead of APInt's string constructor

APInt's string constructor asserts on error. Since this is the parser and we don't yet know if the string is a valid integer we shouldn't use that.

Instead use StringRef::getAsInteger which returns a bool to indicate success or failure.

Since we no longer need APInt, use 'unsigned' instead.

Differential Revision: https://reviews.llvm.org/D92801
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/rvv/invalid.s