MSVC: support version preference with search
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 7 Mar 2023 18:10:31 +0000 (10:10 -0800)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 13 Mar 2023 16:25:31 +0000 (09:25 -0700)
commitaf5f468228472ef2d4f58c2ac51842d4a6d91c9d
tree3d937ec67c3ccdc7782e30da42064ac38f4a258d
parent21700677cb44f58a8f4c9d9ed6c05dd049108854
MSVC: support version preference with search

Extend the logic for the WinSDK and UCRT handling to prefer a user
specified version of the VisualC++ tools and Windows SDK.  This allows
us to now perform the regular search for the installation but select the
exact version of the SDK or VC++ tools to override the latest version.
Similar to the other flags controlling this behaviour, if the user
specifies a value, we will not perform validation on the input and will
attempt to prefer that, particularly in the case of VisualC++ tools
where no fallback occurs.

Reviewed by: hans
Differential Revision: https://reviews.llvm.org/D145517
clang/lib/Driver/ToolChains/MSVC.cpp
lld/COFF/Driver.cpp
llvm/include/llvm/WindowsDriver/MSVCPaths.h
llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
llvm/lib/WindowsDriver/MSVCPaths.cpp