[cfe-commits] r67756 - in /cfe/trunk: include/clang/Driver/Driver.h lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Thu Mar 26 09:09:13 PDT 2009


Author: ddunbar
Date: Thu Mar 26 11:09:13 2009
New Revision: 67756

URL: http://llvm.org/viewvc/llvm-project?rev=67756&view=rev
Log:
Driver: Print the correct target when printing the version.

Modified:
    cfe/trunk/include/clang/Driver/Driver.h
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=67756&r1=67755&r2=67756&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Thu Mar 26 11:09:13 2009
@@ -161,7 +161,7 @@
   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;

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=67756&r1=67755&r2=67756&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Mar 26 11:09:13 2009
@@ -225,7 +225,7 @@
   }
 }
 
-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 @@
   // 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 @@
   // in practice.
   if (C.getArgs().hasArg(options::OPT_v) || 
       C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) {
-    PrintVersion();
+    PrintVersion(C);
     SuppressMissingInputWarning = true;
   }
 





More information about the cfe-commits mailing list