[clang] [llvm] [clang] Clean up the Clang export annotations (PR #239750)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 12:53:34 PST 2026


================
@@ -56,17 +54,22 @@
 #define CLANG_EXPORT_TEMPLATE
 #endif
 #define CLANG_ABI_EXPORT __declspec(dllexport)
-#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) ||             \
-    defined(__MVS__) || defined(__CYGWIN__)
-#define CLANG_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
-#define CLANG_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
-#define CLANG_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
+#elif __has_attribute(visibility)
+#if defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) ||               \
+    defined(__MVS__) || defined(__CYGWIN__) || defined(__MACH__) ||            \
+    defined(__wasm__) || defined(__EMSCRIPTEN__)
----------------
compnerd wrote:

Yeah, lets simplify this, it is complex and can confuse developers.

https://github.com/llvm/llvm-project/pull/239750


More information about the cfe-commits mailing list