[PATCH] D152423: [RISCV] Add function that check extension name with version

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 11:39:19 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:1200
+
+  auto Pos = findFirstNonVersionCharacter(Ext) + 1;
+  StringRef Name(Ext.substr(0, Pos));
----------------
This function is poorly named. Shouldn't it be findLastNonVersionCharacter?


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:1201
+  auto Pos = findFirstNonVersionCharacter(Ext) + 1;
+  StringRef Name(Ext.substr(0, Pos));
+  StringRef Vers(Ext.substr(Pos));
----------------
I think writing as an assignment is more common

```
StringRef Name = Ext.substr(0, Pos);
StringRef Vers = Ext.substr(Pos);
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152423/new/

https://reviews.llvm.org/D152423



More information about the llvm-commits mailing list