[RISCV] Improve tracking of EndLoc in the assembly parser.
The SMLoc::getFromPointer(S.getPointer() - 1) pattern used in several place didn't make sense since that puts the End before the Start location. This patch corrects this to properly calculate the end location as we parse. Unsure how much this matters, a lot of these are for custom operand parsing. If the custom parsing succeeds, the instruction matching probably won't fail, so the end loc won't be used to build a range for a diagnostic. I've also fixed the creation functions for the CSR and VType operands to assign the EndLoc of the RISCVOperand class using the StartLoc instead of an empty SMLoc. I don't think these will ever be accessed, but it makes the code look less like we forgot to assign it. This is consistent with some operands on the ARM target. Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D115192
Loading
Please sign in to comment