[RISCV] Make .option arch parser less mind-bending
Currently the early-return flow in the infinite loop makes it hard to find the non-error termination points amongst the sea of errors. Rewrite it with a more conventional control flow that has a clear loop guard (in place of one of the early returns) and a break (in place of the other), and with greater code reuse. This has a small effect on the errors given for malformed input, as seen in the affected test, and is probably more helpful as a result. Note that we also bail early now if parseComma fails, as is standard. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D152192
Loading
Please sign in to comment