From: Daniel Dunbar Date: Fri, 17 Sep 2010 02:47:28 +0000 (+0000) Subject: Driver: Support -dumpmachine. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d829950b2b75d50fca2772a20129323a186993a5;p=clang Driver: Support -dumpmachine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114155 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index a574f41d8c..040b2b2efc 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -214,7 +214,7 @@ def dD : Flag<"-dD">, Group; def dM : Flag<"-dM">, 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">; diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 3707acad24..e24f017ceb 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -387,6 +387,11 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { // 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;