[PATCH] D79565: Add -print-targets to print the registered targets

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 13 08:38:53 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcf2fb139321c: Add -print-targets to print the registered targets (authored by yaxunl).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79565

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1815,6 +1815,11 @@
     return false;
   }
 
+  if (C.getArgs().hasArg(options::OPT_print_targets)) {
+    llvm::TargetRegistry::printRegisteredTargetsForVersion(llvm::outs());
+    return false;
+  }
+
   return true;
 }
 
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2804,6 +2804,8 @@
   HelpText<"Print the resource directory pathname">;
 def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
   HelpText<"Print the paths used for finding libraries and programs">;
+def print_targets : Flag<["-", "--"], "print-targets">,
+  HelpText<"Print the registered targets">;
 def private__bundle : Flag<["-"], "private_bundle">;
 def pthreads : Flag<["-"], "pthreads">;
 def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -130,6 +130,7 @@
 - ``-fno-char8_t`` now disables the ``char8_t`` keyword, not just the use of
   ``char8_t`` as the character type of ``u8`` literals. This restores the
   Clang 8 behavior that regressed in Clang 9 and 10.
+- -print-targets has been added to print the registered targets.
 
 New Pragmas in Clang
 --------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79565.263740.patch
Type: text/x-patch
Size: 1567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200513/c1bccc43/attachment.bin>


More information about the cfe-commits mailing list