Reland [RISCV] Fix gaps in IgnoreUnknown=true for RISCVISAInfo::parseArchString
authorAlex Bradbury <asb@igalia.com>
Mon, 13 Mar 2023 15:14:43 +0000 (15:14 +0000)
committerAlex Bradbury <asb@igalia.com>
Mon, 13 Mar 2023 15:19:15 +0000 (15:19 +0000)
commita159e58c008435ba1992617b5ebfe8eb2d3fccb5
treed671cddb9b1bdfb3ab0b0aa9fc872b875a64396d
parent775451b66a4c726f1c3925f74be8cefcb308e4f8
Reland [RISCV] Fix gaps in IgnoreUnknown=true for RISCVISAInfo::parseArchString

Prior to this patch, unrecognised z/s/sx/x prefixed extensions were not
ignored when IgnoreUnknown=true.

The first version of this patch, a7313f83b9ca9, incorrectly used
`!isSupportedExtension(Ext)` rather than `!isSupportedExtension(Name)`.
i.e. checked the full substring rather than the split out name, causing
incorrect behaviour when a version is specified. This was fixed and a
new test case addded.

Differential Revision: https://reviews.llvm.org/D145882
llvm/lib/Support/RISCVISAInfo.cpp
llvm/unittests/Support/RISCVISAInfoTest.cpp