[PATCH] D105168: [RISCV] Unify the arch string parsing logic to RISCVISAInfo.

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 06:53:02 PDT 2021


luismarques added inline comments.


================
Comment at: llvm/include/llvm/Support/RISCVISAInfo.h:1
+//===-- RISCVArchStringParser.h - RISCV Arch String Parser ------*- C++ -*-===//
+//
----------------
Incorrect header name.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:24-38
+// Represents the major and version number components of a RISC-V extension
+struct RISCVExtensionVersion {
+  unsigned Major;
+  unsigned Minor;
+};
+
+struct RISCVSupportedExtensionInfo {
----------------
Use `///` to add to the generated documentation?


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:112
+
+// Helper function for fiilter SupportedExtensionInfos by name.
+static auto filterSupportedExtensionInfosByName(StringRef ExtName) {
----------------
fiilter -> filtering


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:190-191
+  if (Pos == StringRef::npos)
+    // If got an unknown extension letter, then give it an alphabetical
+    // order, but after all known standard extension.
+    Rank = AllStdExts.size() + (Ext - 'a');
----------------
got -> we got. extension -> extensions.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:235
+// Compare function for extension.
+// Only compare the extension name, ignore version comparesion.
+bool RISCVISAInfo::compareExtension(const std::string &LHS,
----------------
comparesion -> comparison.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:260
+
+  // If the rank is same, it must be sorted by lexical order.
+  return LHS < RHS;
----------------
lexicographic order


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105168



More information about the llvm-commits mailing list