Skip to content

Commit

Permalink
[RISCV] Minor cleanups to RISCVISAInfo::parseArchString. NFC
Browse files Browse the repository at this point in the history
Remove unneeded an unneeded variable and rename another.
  • Loading branch information
topperc committed Apr 15, 2024
1 parent faad4e3 commit fb9c7dd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions llvm/lib/Support/RISCVISAInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand All @@ -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;
}

Expand Down Expand Up @@ -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())) {
Expand Down

0 comments on commit fb9c7dd

Please sign in to comment.