summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-21 20:06:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-21 20:06:58 +0000
commit08e41d65a216fc5ea506d6bae20bec34451c7330 (patch)
tree7f9c07f4e92e5c03953e15280f1a48c1020794f5 /clang/lib/Driver/Driver.cpp
parent1e08ca7313527857939c2adeacc6822bc2df4c02 (diff)
downloadbcm5719-llvm-08e41d65a216fc5ea506d6bae20bec34451c7330.tar.gz
bcm5719-llvm-08e41d65a216fc5ea506d6bae20bec34451c7330.zip
driver: Print --version on stdout, to match gcc.
- Patch by Jean-Daniel Dupas llvm-svn: 76632
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index df72426057b..c4136df56bf 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -385,7 +385,7 @@ void Driver::PrintHelp(bool ShowHidden) const {
OS.flush();
}
-void Driver::PrintVersion(const Compilation &C) const {
+void Driver::PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const {
static char buf[] = "$URL$";
char *zap = strstr(buf, "/lib/Driver");
if (zap)
@@ -402,17 +402,16 @@ void Driver::PrintVersion(const Compilation &C) const {
#endif
// FIXME: The following handlers should use a callback mechanism, we
// don't know what the client would like to do.
-
- llvm::errs() << "clang version " CLANG_VERSION_STRING " ("
+ OS << "clang version " CLANG_VERSION_STRING " ("
<< vers << " " << revision << ")" << '\n';
const ToolChain &TC = C.getDefaultToolChain();
- llvm::errs() << "Target: " << TC.getTripleString() << '\n';
+ OS << "Target: " << TC.getTripleString() << '\n';
// Print the threading model.
//
// FIXME: Implement correctly.
- llvm::errs() << "Thread model: " << "posix" << '\n';
+ OS << "Thread model: " << "posix" << '\n';
}
bool Driver::HandleImmediateArgs(const Compilation &C) {
@@ -432,13 +431,14 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
}
if (C.getArgs().hasArg(options::OPT__version)) {
- PrintVersion(C);
+ // Follow gcc behavior and use stdout for --version and stderr for -v
+ PrintVersion(C, llvm::outs());
return false;
}
if (C.getArgs().hasArg(options::OPT_v) ||
C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) {
- PrintVersion(C);
+ PrintVersion(C, llvm::errs());
SuppressMissingInputWarning = true;
}
OpenPOWER on IntegriCloud