1//===-- MSVCPaths.h - MSVC path-parsing helpers -----------------*- C++ -*-===// 
  3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 
  4// See https://llvm.org/LICENSE.txt for license information. 
  5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 
  7//===----------------------------------------------------------------------===// 
  9#ifndef LLVM_WINDOWSDRIVER_MSVCPATHS_H 
  10#define LLVM_WINDOWSDRIVER_MSVCPATHS_H 
  37// Windows SDKs and VC Toolchains group their contents into subdirectories based 
  38// on the target architecture. This function converts an llvm::Triple::ArchType 
  39// to the corresponding subdirectory name. 
  42// Similar to the above function, but for Visual Studios before VS2017. 
  45// Similar to the above function, but for DevDiv internal builds. 
  53// Get the path to a specific subdirectory in the current toolchain for 
  54// a given target architecture. 
  55// VS2017 changed the VC toolchain layout, so this should be used instead 
  56// of hardcoding paths. 
  59 const std::string &VCToolChainPath,
 
  63// Check if the Include path of a specified version of Visual Studio contains 
  64// specific header files. If not, they are probably shipped with Universal CRT. 
  66 const std::string &VCToolChainPath,
 
  70/// Get Windows SDK installation directory. 
  72 std::optional<llvm::StringRef> WinSdkDir,
 
  73 std::optional<llvm::StringRef> WinSdkVersion,
 
  74 std::optional<llvm::StringRef> WinSysRoot,
 
  75 std::string &Path, 
int &Major,
 
  76 std::string &WindowsSDKIncludeVersion,
 
  77 std::string &WindowsSDKLibVersion);
 
  81 std::optional<llvm::StringRef> WinSdkDir,
 
  82 std::optional<llvm::StringRef> WinSdkVersion,
 
  83 std::optional<llvm::StringRef> WinSysRoot,
 
  84 std::string &Path, std::string &UCRTVersion);
 
  86// Check command line arguments to try and find a toolchain. 
  89 std::optional<llvm::StringRef> VCToolsDir,
 
  90 std::optional<llvm::StringRef> VCToolsVersion,
 
  91 std::optional<llvm::StringRef> WinSysRoot,
 
  94// Check various environment variables to try and find a toolchain. 
  99// Query the Setup Config server for installs, then pick the newest version 
  100// and find its default VC toolchain. If `VCToolsVersion` is specified, that 
  101// version is preferred over the latest version. 
  103// This is the preferred way to discover new Visual Studios, as they're no 
  104// longer listed in the registry. 
  107 std::optional<llvm::StringRef> VCToolsVersion,
 
  110// Look in the registry for Visual Studio installs, and use that to get 
  111// a toolchain path. VS2017 and newer don't get added to the registry. 
  112// So if we find something here, we know that it's an older version. 
This file defines the SmallString class.
 
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
 
StringRef - Represent a constant reference to a string, i.e.
 
The virtual file system interface.
 
This is an optimization pass for GlobalISel generic memory operations.
 
LLVM_ABI const char * archToWindowsSDKArch(llvm::Triple::ArchType Arch)
 
LLVM_ABI bool findVCToolChainViaCommandLine(vfs::FileSystem &VFS, std::optional< llvm::StringRef > VCToolsDir, std::optional< llvm::StringRef > VCToolsVersion, std::optional< llvm::StringRef > WinSysRoot, std::string &Path, ToolsetLayout &VSLayout)
 
LLVM_ABI bool getWindowsSDKDir(vfs::FileSystem &VFS, std::optional< llvm::StringRef > WinSdkDir, std::optional< llvm::StringRef > WinSdkVersion, std::optional< llvm::StringRef > WinSysRoot, std::string &Path, int &Major, std::string &WindowsSDKIncludeVersion, std::string &WindowsSDKLibVersion)
Get Windows SDK installation directory.
 
LLVM_ABI bool useUniversalCRT(ToolsetLayout VSLayout, const std::string &VCToolChainPath, llvm::Triple::ArchType TargetArch, llvm::vfs::FileSystem &VFS)
 
LLVM_ABI bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path, ToolsetLayout &VSLayout)
 
LLVM_ABI bool findVCToolChainViaSetupConfig(vfs::FileSystem &VFS, std::optional< llvm::StringRef > VCToolsVersion, std::string &Path, ToolsetLayout &VSLayout)
 
LLVM_ABI const char * archToLegacyVCArch(llvm::Triple::ArchType Arch)
 
LLVM_ABI const char * archToDevDivInternalArch(llvm::Triple::ArchType Arch)
 
LLVM_ABI std::string getSubDirectoryPath(SubDirectoryType Type, ToolsetLayout VSLayout, const std::string &VCToolChainPath, llvm::Triple::ArchType TargetArch, llvm::StringRef SubdirParent="")
 
LLVM_ABI bool appendArchToWindowsSDKLibPath(int SDKMajor, llvm::SmallString< 128 > LibPath, llvm::Triple::ArchType Arch, std::string &path)
 
LLVM_ABI bool findVCToolChainViaRegistry(std::string &Path, ToolsetLayout &VSLayout)
 
LLVM_ABI bool getUniversalCRTSdkDir(vfs::FileSystem &VFS, std::optional< llvm::StringRef > WinSdkDir, std::optional< llvm::StringRef > WinSdkVersion, std::optional< llvm::StringRef > WinSysRoot, std::string &Path, std::string &UCRTVersion)