[PATCH] D79565: Add -print-targets to print the registered targets
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 12 06:24:55 PDT 2020
yaxunl updated this revision to Diff 263410.
yaxunl retitled this revision from "Document outputing registered targets with -v in release notes" to "Add -print-targets to print the registered targets".
yaxunl added reviewers: MaskRay, thakis, echristo, tra.
yaxunl added a comment.
add option -print-targets to print the registered targets.
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.263410.patch
Type: text/x-patch
Size: 1567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200512/70e20d2c/attachment.bin>
More information about the cfe-commits
mailing list