Author: Yaxun (Sam) Liu
Date: 2020-05-04T12:26:18-04:00
New Revision: 66041187c9028f730c41597fe5ea6a63fda1ccad

URL: 
https://github.com/llvm/llvm-project/commit/66041187c9028f730c41597fe5ea6a63fda1ccad
DIFF: 
https://github.com/llvm/llvm-project/commit/66041187c9028f730c41597fe5ea6a63fda1ccad.diff

LOG: Let clang print registered targets for --version

We need a way to know supported targets by clang since
people may use clang as assembler and they want to
choose the clang which supports their target.

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

Differential Revision: https://reviews.llvm.org/D79210

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 7d82c8faa573..80a2d202efa1 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1569,6 +1569,9 @@ void Driver::PrintVersion(const Compilation &C, 
raw_ostream &OS) const {
   // 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


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to