Improve Windows toolchain support for non-standard environments.
authorZachary Turner <zturner@google.com>
Mon, 20 Oct 2014 20:08:04 +0000 (20:08 +0000)
committerZachary Turner <zturner@google.com>
Mon, 20 Oct 2014 20:08:04 +0000 (20:08 +0000)
commit63350417e19b3f062a89f44214bc6a70613f7682
tree04835d188af5672ff15e35cb0acedf31a814d1fe
parent65c275686955f19f411ceaab593b42ebdcd242f3
Improve Windows toolchain support for non-standard environments.

Typically clang finds Visual Studio by the user explicitly setting
up a Visual Studio environment via vcvarsall.  But we still try to
behave intelligently and fallback to different methods of finding
Visual Studio when this is not done.  This patch improves various
fallback codepaths to make Visual Studio locating more robust.

Specifically, this patch:

* Adds support for searching environment variables for VS 12.0
* Correctly locates include folders for Windows SDK 8.x (this was
  previously broken, and would cause clang to error)
* Prefers locating link.exe in the same location as cl.exe.  This
  is helpful in case another link.exe is in the path earlier than
  Visual Studio (e.g. GnuWin32)
* Minor cleanup in the registry reading code to make it more
  robust in the presence of long pathnames.

llvm-svn: 220226
clang/lib/Driver/ToolChains.h
clang/lib/Driver/Tools.cpp
clang/lib/Driver/WindowsToolChain.cpp