[cfe-commits] r114155 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Thu Sep 16 19:47:29 PDT 2010


Author: ddunbar
Date: Thu Sep 16 21:47:28 2010
New Revision: 114155

URL: http://llvm.org/viewvc/llvm-project?rev=114155&view=rev
Log:
Driver: Support -dumpmachine.

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=114155&r1=114154&r2=114155&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Sep 16 21:47:28 2010
@@ -214,7 +214,7 @@
 def dM : Flag<"-dM">, Group<d_Group>;
 def dead__strip : Flag<"-dead_strip">;
 def dependency_file : Separate<"-dependency-file">;
-def dumpmachine : Flag<"-dumpmachine">, Flags<[Unsupported]>;
+def dumpmachine : Flag<"-dumpmachine">;
 def dumpspecs : Flag<"-dumpspecs">, Flags<[Unsupported]>;
 def dumpversion : Flag<"-dumpversion">;
 def dylib__file : Separate<"-dylib_file">;

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=114155&r1=114154&r2=114155&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Sep 16 21:47:28 2010
@@ -387,6 +387,11 @@
   // The order these options are handled in gcc is all over the place, but we
   // don't expect inconsistencies w.r.t. that to matter in practice.
 
+  if (C.getArgs().hasArg(options::OPT_dumpmachine)) {
+    llvm::outs() << C.getDefaultToolChain().getTripleString() << '\n';
+    return false;
+  }
+
   if (C.getArgs().hasArg(options::OPT_dumpversion)) {
     llvm::outs() << CLANG_VERSION_STRING "\n";
     return false;





More information about the cfe-commits mailing list