Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -68,6 +68,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Process.h" #include "llvm/Support/Program.h" +#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -1116,6 +1117,10 @@ // Print out the install directory. OS << "InstalledDir: " << InstalledDir << '\n'; + + // Print registered targets. + OS << '\n'; + llvm::TargetRegistry::printRegisteredTargetsForVersion(OS); } /// PrintDiagnosticCategories - Implement the --print-diagnostic-categories Index: tools/clang-format/ClangFormat.cpp =================================================================== --- tools/clang-format/ClangFormat.cpp +++ tools/clang-format/ClangFormat.cpp @@ -328,8 +328,7 @@ } // namespace format } // namespace clang -static void PrintVersion() { - raw_ostream &OS = outs(); +static void PrintVersion(raw_ostream &OS) { OS << clang::getClangToolFullVersion("clang-format") << '\n'; } Index: tools/clang-offload-bundler/ClangOffloadBundler.cpp =================================================================== --- tools/clang-offload-bundler/ClangOffloadBundler.cpp +++ tools/clang-offload-bundler/ClangOffloadBundler.cpp @@ -915,8 +915,7 @@ return false; } -static void PrintVersion() { - raw_ostream &OS = outs(); +static void PrintVersion(raw_ostream &OS) { OS << clang::getClangToolFullVersion("clang-offload-bundler") << '\n'; }