[llvm] fb9c7dd - [RISCV] Minor cleanups to RISCVISAInfo::parseArchString. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 13:05:14 PDT 2024


Author: Craig Topper
Date: 2024-04-15T13:04:50-07:00
New Revision: fb9c7dd6f1f3463b539d1f62f6ec7b5c7e061cf8

URL: https://github.com/llvm/llvm-project/commit/fb9c7dd6f1f3463b539d1f62f6ec7b5c7e061cf8
DIFF: https://github.com/llvm/llvm-project/commit/fb9c7dd6f1f3463b539d1f62f6ec7b5c7e061cf8.diff

LOG: [RISCV] Minor cleanups to RISCVISAInfo::parseArchString. NFC

Remove unneeded an unneeded variable and rename another.

Added: 
    

Modified: 
    llvm/lib/Support/RISCVISAInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index 7a19d24d1ff483..cbdc64bc7a97be 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<std::string> SplittedExts;
-  if (auto E = splitExtsByUnderscore(Exts, SplittedExts))
+  std::vector<std::string> 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())) {


        


More information about the llvm-commits mailing list