[llvm] [RISCV] Detect duplicate extensions in parseNormalizedArchString. (PR #91416)

Shao-Ce SUN via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 20:10:23 PDT 2024


================
@@ -492,7 +492,9 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) {
                                "'" + Twine(ExtName[0]) +
                                    "' must be followed by a letter");
 
-    ISAInfo->addExtension(ExtName, {MajorVersion, MinorVersion});
+    if (!ISAInfo->addExtension(ExtName, {MajorVersion, MinorVersion}))
+      return createStringError(errc::invalid_argument,
+                               "duplicate extension '" + ExtName + "'");
----------------
sunshaoce wrote:

Thanks for the explanation!

https://github.com/llvm/llvm-project/pull/91416


More information about the llvm-commits mailing list