99#ifndef LLVM_WINDOWSDRIVER_MSVCPATHS_H
1010#define LLVM_WINDOWSDRIVER_MSVCPATHS_H
1111
12+ #include " llvm/Support/Compiler.h"
1213#include " llvm/ADT/SmallString.h"
1314#include " llvm/ADT/StringRef.h"
1415#include " llvm/TargetParser/Triple.h"
@@ -36,57 +37,57 @@ enum class ToolsetLayout {
3637// Windows SDKs and VC Toolchains group their contents into subdirectories based
3738// on the target architecture. This function converts an llvm::Triple::ArchType
3839// to the corresponding subdirectory name.
39- const char *archToWindowsSDKArch (llvm::Triple::ArchType Arch);
40+ LLVM_ABI const char *archToWindowsSDKArch (llvm::Triple::ArchType Arch);
4041
4142// Similar to the above function, but for Visual Studios before VS2017.
42- const char *archToLegacyVCArch (llvm::Triple::ArchType Arch);
43+ LLVM_ABI const char *archToLegacyVCArch (llvm::Triple::ArchType Arch);
4344
4445// Similar to the above function, but for DevDiv internal builds.
45- const char *archToDevDivInternalArch (llvm::Triple::ArchType Arch);
46+ LLVM_ABI const char *archToDevDivInternalArch (llvm::Triple::ArchType Arch);
4647
47- bool appendArchToWindowsSDKLibPath (int SDKMajor, llvm::SmallString<128 > LibPath,
48+ LLVM_ABI bool appendArchToWindowsSDKLibPath (int SDKMajor, llvm::SmallString<128 > LibPath,
4849 llvm::Triple::ArchType Arch,
4950 std::string &path);
5051
5152// Get the path to a specific subdirectory in the current toolchain for
5253// a given target architecture.
5354// VS2017 changed the VC toolchain layout, so this should be used instead
5455// of hardcoding paths.
55- std::string getSubDirectoryPath (SubDirectoryType Type, ToolsetLayout VSLayout,
56+ LLVM_ABI std::string getSubDirectoryPath (SubDirectoryType Type, ToolsetLayout VSLayout,
5657 const std::string &VCToolChainPath,
5758 llvm::Triple::ArchType TargetArch,
5859 llvm::StringRef SubdirParent = " " );
5960
6061// Check if the Include path of a specified version of Visual Studio contains
6162// specific header files. If not, they are probably shipped with Universal CRT.
62- bool useUniversalCRT (ToolsetLayout VSLayout, const std::string &VCToolChainPath,
63+ LLVM_ABI bool useUniversalCRT (ToolsetLayout VSLayout, const std::string &VCToolChainPath,
6364 llvm::Triple::ArchType TargetArch,
6465 llvm::vfs::FileSystem &VFS);
6566
6667// / Get Windows SDK installation directory.
67- bool getWindowsSDKDir (vfs::FileSystem &VFS,
68+ LLVM_ABI bool getWindowsSDKDir (vfs::FileSystem &VFS,
6869 std::optional<llvm::StringRef> WinSdkDir,
6970 std::optional<llvm::StringRef> WinSdkVersion,
7071 std::optional<llvm::StringRef> WinSysRoot,
7172 std::string &Path, int &Major,
7273 std::string &WindowsSDKIncludeVersion,
7374 std::string &WindowsSDKLibVersion);
7475
75- bool getUniversalCRTSdkDir (vfs::FileSystem &VFS,
76+ LLVM_ABI bool getUniversalCRTSdkDir (vfs::FileSystem &VFS,
7677 std::optional<llvm::StringRef> WinSdkDir,
7778 std::optional<llvm::StringRef> WinSdkVersion,
7879 std::optional<llvm::StringRef> WinSysRoot,
7980 std::string &Path, std::string &UCRTVersion);
8081
8182// Check command line arguments to try and find a toolchain.
82- bool findVCToolChainViaCommandLine (
83+ LLVM_ABI bool findVCToolChainViaCommandLine (
8384 vfs::FileSystem &VFS, std::optional<llvm::StringRef> VCToolsDir,
8485 std::optional<llvm::StringRef> VCToolsVersion,
8586 std::optional<llvm::StringRef> WinSysRoot, std::string &Path,
8687 ToolsetLayout &VSLayout);
8788
8889// Check various environment variables to try and find a toolchain.
89- bool findVCToolChainViaEnvironment (vfs::FileSystem &VFS, std::string &Path,
90+ LLVM_ABI bool findVCToolChainViaEnvironment (vfs::FileSystem &VFS, std::string &Path,
9091 ToolsetLayout &VSLayout);
9192
9293// Query the Setup Config server for installs, then pick the newest version
@@ -95,15 +96,15 @@ bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path,
9596//
9697// This is the preferred way to discover new Visual Studios, as they're no
9798// longer listed in the registry.
98- bool
99+ LLVM_ABI bool
99100findVCToolChainViaSetupConfig (vfs::FileSystem &VFS,
100101 std::optional<llvm::StringRef> VCToolsVersion,
101102 std::string &Path, ToolsetLayout &VSLayout);
102103
103104// Look in the registry for Visual Studio installs, and use that to get
104105// a toolchain path. VS2017 and newer don't get added to the registry.
105106// So if we find something here, we know that it's an older version.
106- bool findVCToolChainViaRegistry (std::string &Path, ToolsetLayout &VSLayout);
107+ LLVM_ABI bool findVCToolChainViaRegistry (std::string &Path, ToolsetLayout &VSLayout);
107108
108109} // namespace llvm
109110
0 commit comments