From: Dimitry Andric Date: Wed, 7 Jun 2017 12:05:41 +0000 (+0000) Subject: Only print registered targets for `--version` X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a5e4c3b26f5f8b9e53b1e164974199bb2efb637;p=clang Only print registered targets for `--version` Summary: In D33900, I added printing of the registered targets in clang's `PrintVersion` function, which is not only used for `--version` output, but also for `-v` (verbose mode) and `-###`. Especially the latter seems to trip up some test cases, so it is probably better to only print the registered targets for `--version`. Reviewers: nemanjai, mehdi_amini Reviewed By: nemanjai Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33981 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304899 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index ec106fa93b..63496af3f3 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1117,10 +1117,6 @@ void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const { // Print out the install directory. OS << "InstalledDir: " << InstalledDir << '\n'; - - // Print registered targets. - OS << '\n'; - llvm::TargetRegistry::printRegisteredTargetsForVersion(OS); } /// PrintDiagnosticCategories - Implement the --print-diagnostic-categories @@ -1166,6 +1162,10 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { if (C.getArgs().hasArg(options::OPT__version)) { // Follow gcc behavior and use stdout for --version and stderr for -v. PrintVersion(C, llvm::outs()); + + // Print registered targets. + llvm::outs() << '\n'; + llvm::TargetRegistry::printRegisteredTargetsForVersion(llvm::outs()); return false; }