Skip to content

Commit ddce059

Browse files
committed
[llvm] auto-annotate WindowsManifest and WindowsDriver library interfaces for DLL export
1 parent c8a9579 commit ddce059

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

llvm/include/llvm/WindowsDriver/MSVCPaths.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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
99100
findVCToolChainViaSetupConfig(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

llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#ifndef LLVM_WINDOWSMANIFEST_WINDOWSMANIFESTMERGER_H
2626
#define LLVM_WINDOWSMANIFEST_WINDOWSMANIFESTMERGER_H
2727

28+
#include "llvm/Support/Compiler.h"
2829
#include "llvm/Support/Error.h"
2930

3031
namespace llvm {
@@ -34,9 +35,9 @@ class MemoryBufferRef;
3435

3536
namespace windows_manifest {
3637

37-
bool isAvailable();
38+
LLVM_ABI bool isAvailable();
3839

39-
class WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
40+
class LLVM_ABI WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
4041
public:
4142
static char ID;
4243
WindowsManifestError(const Twine &Msg);
@@ -48,13 +49,13 @@ class WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
4849

4950
class WindowsManifestMerger {
5051
public:
51-
WindowsManifestMerger();
52-
~WindowsManifestMerger();
53-
Error merge(MemoryBufferRef Manifest);
52+
LLVM_ABI WindowsManifestMerger();
53+
LLVM_ABI ~WindowsManifestMerger();
54+
LLVM_ABI Error merge(MemoryBufferRef Manifest);
5455

5556
// Returns vector containing merged xml manifest, or uninitialized vector for
5657
// empty manifest.
57-
std::unique_ptr<MemoryBuffer> getMergedManifest();
58+
LLVM_ABI std::unique_ptr<MemoryBuffer> getMergedManifest();
5859

5960
private:
6061
class WindowsManifestMergerImpl;

0 commit comments

Comments
 (0)