|
12 | 12 | #ifndef LLVM_ABI_BREAKING_CHECKS_H
|
13 | 13 | #define LLVM_ABI_BREAKING_CHECKS_H
|
14 | 14 |
|
15 |
| -// llvm-config.h is required for LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS |
16 |
| -#include "llvm/Config/llvm-config.h" |
| 15 | +// Compiler.h is required for LLVM_ABI definition. |
| 16 | +#include "llvm/Support/Compiler.h" |
17 | 17 |
|
18 | 18 | /* Define to enable checks that alter the LLVM C++ ABI */
|
19 | 19 | #cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
|
20 | 20 |
|
21 | 21 | /* Define to enable reverse iteration of unordered llvm containers */
|
22 | 22 | #cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION
|
23 | 23 |
|
24 |
| -// Properly annotate EnableABIBreakingChecks or DisableABIBreakingChecks for |
25 |
| -// export from shared library. |
26 |
| -#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS) |
27 |
| -// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for |
28 |
| -// two preprocessor definitions to gate LLVM_ABI macro definitions. |
29 |
| -#if defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS) && !defined(LLVM_BUILD_STATIC) |
30 |
| -#if defined(_WIN32) && !defined(__MINGW32__) |
31 |
| -#if defined(LLVM_EXPORTS) |
32 |
| -#define ABI_BREAKING_EXPORT_ABI __declspec(dllexport) |
33 |
| -#else |
34 |
| -#define ABI_BREAKING_EXPORT_ABI __declspec(dllimport) |
35 |
| -#endif |
36 |
| -#elif defined(__has_attribute) && __has_attribute(visibility) |
37 |
| -#define ABI_BREAKING_EXPORT_ABI __attribute__((visibility("default"))) |
38 |
| -#endif |
39 |
| -#endif |
40 |
| -#if !defined(ABI_BREAKING_EXPORT_ABI) |
41 |
| -#define ABI_BREAKING_EXPORT_ABI |
42 |
| -#endif |
43 |
| -#endif |
44 |
| - |
45 | 24 | /* Allow selectively disabling link-time mismatch checking so that header-only
|
46 | 25 | ADT content from LLVM can be used without linking libSupport. */
|
47 | 26 | #if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
|
|
67 | 46 | #endif
|
68 | 47 | namespace llvm {
|
69 | 48 | #if LLVM_ENABLE_ABI_BREAKING_CHECKS
|
70 |
| -ABI_BREAKING_EXPORT_ABI extern int EnableABIBreakingChecks; |
| 49 | +LLVM_ABI extern int EnableABIBreakingChecks; |
71 | 50 | LLVM_HIDDEN_VISIBILITY
|
72 | 51 | __attribute__((weak)) int *VerifyEnableABIBreakingChecks =
|
73 | 52 | &EnableABIBreakingChecks;
|
74 | 53 | #else
|
75 |
| -ABI_BREAKING_EXPORT_ABI extern int DisableABIBreakingChecks; |
| 54 | +LLVM_ABI extern int DisableABIBreakingChecks; |
76 | 55 | LLVM_HIDDEN_VISIBILITY
|
77 | 56 | __attribute__((weak)) int *VerifyDisableABIBreakingChecks =
|
78 | 57 | &DisableABIBreakingChecks;
|
|
0 commit comments