[llvm] [clang] Enable descriptions for --print-supported-extensions (PR #66715)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 19 02:32:53 PDT 2023
================
@@ -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"
+ : ("\t\t" + llvmDescMap[E.first] + "\n"));
----------------
DavidSpickett wrote:
I think you might have an extra tab here, the risc-v output was misaligned.
https://github.com/llvm/llvm-project/pull/66715
More information about the llvm-commits
mailing list