Skip to content

Commit b385d74

Browse files
committed
code review feedback
1 parent 00dfba5 commit b385d74

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

llvm/include/llvm/Config/abi-breaking.h.cmake

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,31 @@
2121
/* Define to enable reverse iteration of unordered llvm containers */
2222
#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION
2323

24+
#if !defined(__has_attribute)
25+
#define __has_attribute(attribute) 0
26+
#endif
27+
2428
// Properly annotate EnableABIBreakingChecks or DisableABIBreakingChecks for
2529
// export from shared library.
26-
#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS)
2730
// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for
2831
// 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__)
32+
#if defined(LLVM_BUILD_STATIC) || !defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS)
33+
#define ABI_BREAKING_EXPORT_ABI
34+
#else
35+
#if defined(_WIN32)
3136
#if defined(LLVM_EXPORTS)
3237
#define ABI_BREAKING_EXPORT_ABI __declspec(dllexport)
3338
#else
3439
#define ABI_BREAKING_EXPORT_ABI __declspec(dllimport)
3540
#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+
#else
42+
#if __has_attribute(visibility)
43+
#define ABI_BREAKING_EXPORT_ABI __attribute__((__visibility__("default")))
44+
#else
4145
#define ABI_BREAKING_EXPORT_ABI
4246
#endif
4347
#endif
48+
#endif
4449

4550
/* Allow selectively disabling link-time mismatch checking so that header-only
4651
ADT content from LLVM can be used without linking libSupport. */

0 commit comments

Comments
 (0)