[PATCH] D144353: [lld][RISCV] Avoid error when encountering unrecognised ISA extensions/versions in RISC-V attributes

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 14:58:19 PST 2023


asb added a comment.

In D144353#4145824 <https://reviews.llvm.org/D144353#4145824>, @reames wrote:

> Alex, on the code, can you explain why you took the approach of writing a new parser specifically for this case?  The existing routine has the IgnoreUnknown flag.  How does that differ from the semantics you need here?

That's a good question and a consideration I should have mentioned in the patch description. The issue with `IgnoreUnknown` is the extension is literally ignored - it isn't added to the returned `RISCVISAInfo`, and so will be silently dropped rather than merged according to the merging rules implemented in LLD and specified in the psABI. There's also the fact that the existing routine accepts a much wider range of inputs (and performs additional normalisation) than is required/desired for the inputs from the ELF attributes - though if `parseArchString` with `IgnoreUnknown` was closer to what we want, I'd have strongly considered just using that as a stop-gap.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144353/new/

https://reviews.llvm.org/D144353



More information about the llvm-commits mailing list