[all-commits] [llvm/llvm-project] de8d26: [RISCV] Improve tracking of EndLoc in the assembly...
Craig Topper via All-commits
all-commits at lists.llvm.org
Wed Dec 8 15:32:57 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: de8d26ac026452620b8584addfa4171671f2765c
https://github.com/llvm/llvm-project/commit/de8d26ac026452620b8584addfa4171671f2765c
Author: Craig Topper <craig.topper at sifive.com>
Date: 2021-12-08 (Wed, 08 Dec 2021)
Changed paths:
M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Log Message:
-----------
[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
More information about the All-commits
mailing list