From: Daniel Dunbar Date: Thu, 26 Mar 2009 16:09:13 +0000 (+0000) Subject: Driver: Print the correct target when printing the version. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70c8db1003af49d3627aeef41fcdd7c6c6a7df79;p=clang Driver: Print the correct target when printing the version. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67756 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index cdcb97691f..cb7f3b035a 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -161,7 +161,7 @@ public: void PrintOptions(const ArgList &Args) const; /// PrintVersion - Print the driver version. - void PrintVersion() const; + void PrintVersion(const Compilation &C) const; /// PrintActions - Print the list of actions. void PrintActions(const Compilation &C) const; diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 1562fde14c..94b33ff61f 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -225,7 +225,7 @@ void Driver::PrintOptions(const ArgList &Args) const { } } -void Driver::PrintVersion() const { +void Driver::PrintVersion(const Compilation &C) const { static char buf[] = "$URL$"; char *zap = strstr(buf, "/lib/Driver"); if (zap) @@ -243,10 +243,10 @@ void Driver::PrintVersion() const { // FIXME: The following handlers should use a callback mechanism, we // don't know what the client would like to do. llvm::errs() << "clang version 1.0 (" << vers << " " << revision << ")" << "\n"; - // FIXME: Add cmake support and remove #ifdef -#ifdef TARGET_TRIPLE - llvm::errs() << "Target: " << TARGET_TRIPLE << "\n"; -#endif + + const ToolChain &TC = C.getDefaultToolChain(); + llvm::errs() << "Target: " << TC.getArchName() << '-' + << TC.getPlatform() << '-' << TC.getOS() << '\n'; } bool Driver::HandleImmediateArgs(const Compilation &C) { @@ -255,7 +255,7 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { // in practice. if (C.getArgs().hasArg(options::OPT_v) || C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) { - PrintVersion(); + PrintVersion(C); SuppressMissingInputWarning = true; }