diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp index 7a19d24d1ff48..cbdc64bc7a97b 100644 --- a/llvm/lib/Support/RISCVISAInfo.cpp +++ b/llvm/lib/Support/RISCVISAInfo.cpp @@ -935,7 +935,6 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, // The canonical order specified in ISA manual. // Ref: Table 22.1 in RISC-V User-Level ISA V2.2 - StringRef StdExts = AllStdExts; char Baseline = Arch[4]; // First letter should be 'e', 'i' or 'g'. @@ -951,7 +950,6 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, if (Arch.size() > 5 && isDigit(Arch[5])) return createStringError(errc::invalid_argument, "version not supported for 'g'"); - StdExts = StdExts.drop_front(4); break; } @@ -1001,11 +999,11 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, Exts = Exts.drop_front(ConsumeLength); Exts.consume_front("_"); - std::vector SplittedExts; - if (auto E = splitExtsByUnderscore(Exts, SplittedExts)) + std::vector SplitExts; + if (auto E = splitExtsByUnderscore(Exts, SplitExts)) return std::move(E); - for (auto &Ext : SplittedExts) { + for (auto &Ext : SplitExts) { StringRef CurrExt = Ext; while (!CurrExt.empty()) { if (AllStdExts.contains(CurrExt.front())) {