[Driver] Set the default driver mode based on the executable.
authorZachary Turner <zturner@google.com>
Fri, 12 Aug 2016 17:47:52 +0000 (17:47 +0000)
committerZachary Turner <zturner@google.com>
Fri, 12 Aug 2016 17:47:52 +0000 (17:47 +0000)
commitaff19c3864cfb4f80b3b47863e085d9f4edc8b0e
treef46725f4cb92de5d2f932e7252b33f1f9ba5168a
parent03878729fb6e12e4289676494008663d45963b7a
[Driver] Set the default driver mode based on the executable.

Currently, if --driver-mode is not passed at all, it will default
to GCC style driver.  This is never an issue for clang because
it manually constructs a --driver-mode option and passes it.

However, we should still try to do as good as we can even if no
--driver-mode is passed.  LibTooling, for example, does not pass
a --driver-mode option and while it could, it seems like we should
still fallback to the best possible default we can.

This is one of two steps necessary to get clang-tidy working on Windows.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D23454

llvm-svn: 278535
clang/include/clang/Driver/Driver.h
clang/lib/Driver/Driver.cpp
clang/unittests/Driver/ToolChainTest.cpp