[PATCH] D49398: clang-cl: Postpone Wmsvc-not-found emission until link.exe gets used.

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 17 07:20:18 PDT 2018


thakis added inline comments.


================
Comment at: lib/Driver/ToolChains/MSVC.cpp:467-468
   if (Linker.equals_lower("link")) {
+    if (!TC.FoundMSVCInstall())
+      C.getDriver().Diag(clang::diag::warn_drv_msvc_not_found);
+
----------------
zturner wrote:
> It looks like it's possible for this warning to be emitted even when `FindVisualStudioExecutable` succeeds (after looking in the install location it checks `PATH`).  Would it make more sense to put this check after the call to `FindVisualStudioExecutable`, but only if it fails?
If we find link.exe on PATH but LIB isn't set, will link.exe do the right thing? Or is the warning still useful for that case?

I'll upload a patch that does what you suggest, but since I'm not sure what exactly the warning is supposed to catch, I find it difficult to say which version is better.


https://reviews.llvm.org/D49398





More information about the cfe-commits mailing list