This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] When parsing vsetvli, use StringRef::getAsInteger instead of APInt's string constructor
ClosedPublic

Authored by craig.topper on Dec 7 2020, 4:57 PM.

Details

Summary

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.

Diff Detail