Skip to content

Commit 15fcc40

Browse files
committed
[llvm] always define LLVM_ABI using __attribute__
1 parent e5c8e4e commit 15fcc40

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/include/llvm/Support/Compiler.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,19 @@
191191
#define LLVM_EXPORT_TEMPLATE
192192
#endif
193193
#define LLVM_ABI_EXPORT __declspec(dllexport)
194-
#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
194+
#elif __has_attribute(visibility)
195+
#if defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
195196
defined(__MVS__) || defined(__CYGWIN__)
196-
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
197-
#define LLVM_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
197+
#define LLVM_ABI __attribute__((visibility("default")))
198+
#define LLVM_TEMPLATE_ABI LLVM_ABI
198199
#define LLVM_EXPORT_TEMPLATE
199-
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
200+
#define LLVM_ABI_EXPORTL LLVM_ABI
200201
#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__)
201-
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
202+
#define LLVM_ABI __attribute__((visibility("default")))
202203
#define LLVM_TEMPLATE_ABI
203204
#define LLVM_EXPORT_TEMPLATE
204-
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
205+
#define LLVM_ABI_EXPORT LLVM_ABI
206+
#endif
205207
#endif
206208
#endif
207209
#if !defined(LLVM_ABI)

0 commit comments

Comments
 (0)