[PATCH] D79210: Let clang print registered targets for --version

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 15:06:44 PDT 2020


yaxunl created this revision.
yaxunl added reviewers: rjmccall, tra.

We need a way to know supported targets by clang since we use clang as assembler.

This patch let clang print registered targets when --version option is passed to clang.


https://reviews.llvm.org/D79210

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1569,6 +1569,9 @@
   // If configuration file was used, print its path.
   if (!ConfigFile.empty())
     OS << "Configuration file: " << ConfigFile << '\n';
+
+  // Print the registered targets.
+  llvm::TargetRegistry::printRegisteredTargetsForVersion(OS);
 }
 
 /// PrintDiagnosticCategories - Implement the --print-diagnostic-categories


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79210.261362.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200430/2bd8afd2/attachment.bin>


More information about the cfe-commits mailing list