[PATCH] D39994: Loosen MSVC 2017 path requirements

David Major via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 17:52:08 PST 2017


dmajor created this revision.
Herald added subscribers: kristof.beyls, aemerson.

Mozilla's build machines are currently applying this patch locally, but I thought I'd offer it upstream because it should be pretty harmless.

clang-cl has some sanity checks to make sure that the cl.exe it finds is actually the Microsoft compiler and not something else. The code expects the path to look like: 
...\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.exe

It doesn't work on Mozilla's build automation where we have a fake Visual Studio installation that looks like: c:\vs2017\VC\bin\HostX64\x64\cl.exe

This patch reduces the path requirement to `...\bin\Host*\*\cl.exe`.


https://reviews.llvm.org/D39994

Files:
  lib/Driver/ToolChains/MSVC.cpp


Index: lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- lib/Driver/ToolChains/MSVC.cpp
+++ lib/Driver/ToolChains/MSVC.cpp
@@ -152,8 +152,7 @@
         // path components with these prefixes when walking backwards through
         // the path.
         // Note: empty strings match anything.
-        llvm::StringRef ExpectedPrefixes[] = {"",     "Host",  "bin", "",
-                                              "MSVC", "Tools", "VC"};
+        llvm::StringRef ExpectedPrefixes[] = {"", "Host", "bin"};
 
         auto It = llvm::sys::path::rbegin(PathEntry);
         auto End = llvm::sys::path::rend(PathEntry);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39994.122755.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171114/d54d9bf6/attachment.bin>


More information about the cfe-commits mailing list