[clang] [clang] Enable descriptions for --print-supported-extensions (PR #66715)

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 01:59:32 PDT 2023


================
@@ -210,24 +210,42 @@ static void verifyTables() {
 #endif
 }
 
-void llvm::riscvExtensionsHelp() {
-  outs() << "All available -march extensions for RISC-V\n\n";
-  outs() << '\t' << left_justify("Name", 20) << "Version\n";
+void llvm::getAllExtensions(StringMap<RISCVExtensionInfo> &ExtMap) {
+  for (const auto &E : SupportedExtensions)
+    ExtMap[E.Name] = {E.Version.Major, E.Version.Minor};
+  for (const auto &E : SupportedExperimentalExtensions)
+    ExtMap[(StringRef("experimental-") + E.Name).str().c_str()] = {
+        E.Version.Major, E.Version.Minor};
+}
----------------
DavidSpickett wrote:

Given that you don't need to add dummy descriptions to *all* extensions in the tests, this method becomes unused.

https://github.com/llvm/llvm-project/pull/66715


More information about the cfe-commits mailing list