[clang] [llvm] [AArch64] Add ability to list extensions enabled for a target (PR #95805)

Lucas Duarte Prates via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 08:09:03 PDT 2024


================
@@ -134,17 +136,39 @@ std::optional<AArch64::CpuInfo> AArch64::parseCpu(StringRef Name) {
   return {};
 }
 
-void AArch64::PrintSupportedExtensions(StringMap<StringRef> DescMap) {
+void AArch64::PrintSupportedExtensions() {
   outs() << "All available -march extensions for AArch64\n\n"
          << "    " << left_justify("Name", 20)
-         << (DescMap.empty() ? "\n" : "Description\n");
+         << left_justify("Architecture Feature(s)", 55)
+         << "Description\n";
   for (const auto &Ext : Extensions) {
     // Extensions without a feature cannot be used with -march.
-    if (!Ext.Feature.empty()) {
-      std::string Description = DescMap[Ext.Name].str();
+    if (!Ext.UserVisibleName.empty() && !Ext.TargetFeature.empty()) {
----------------
pratlucas wrote:

I've added a new unit test to cover the formatting in `TargetParserTest.cpp`.

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


More information about the cfe-commits mailing list