================
@@ -210,24 +210,33 @@ static void verifyTables() {
 #endif
 }
 
-void llvm::riscvExtensionsHelp() {
+void llvm::riscvExtensionsHelp(std::map<StringRef, StringRef> llvmDescMap) {
+
   outs() << "All available -march extensions for RISC-V\n\n";
-  outs() << '\t' << left_justify("Name", 20) << "Version\n";
+  outs() << '\t' << left_justify("Name", 20) << "Version";
+  outs() << (llvmDescMap.empty() ? "\n" : "\tDescription\n");
 
   RISCVISAInfo::OrderedExtensionMap ExtMap;
   for (const auto &E : SupportedExtensions)
     ExtMap[E.Name] = {E.Version.Major, E.Version.Minor};
-  for (const auto &E : ExtMap)
-    outs() << format("\t%-20s%d.%d\n", E.first.c_str(), E.second.MajorVersion,
+  for (const auto &E : ExtMap) {
+    outs() << format("\t%-20s%d.%d", E.first.c_str(), E.second.MajorVersion,
                      E.second.MinorVersion);
+    outs() << (llvmDescMap.empty() ? "\n"
----------------
DavidSpickett wrote:

In general I don't think we should assume that all named frontend features will 
be in the backend by the same name, and then also have a description.

Practically, that means I'd prefer we do a lookup for each name, expecting that 
it might fail. Instead of checking if the map is empty and if not doing an 
unconditional lookup.

In 99.9% of cases, the name probably matches. Maybe even has to match, but I 
know we've bent that rule in AArch64 in the past, and it wouldn't cost that 
much in terms of cpu time to do it that way. This is not a hot path, and we're 
spending time building a map already.

https://github.com/llvm/llvm-project/pull/66715
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to