[clang] 6604118 - Let clang print registered targets for --version
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Mon May 4 09:27:06 PDT 2020
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
More information about the cfe-commits
mailing list