[llvm] Initial changes for llvm shared library build using explicit visibility annotations (PR #96630)

Thomas Fransham via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 09:48:05 PDT 2024


================
@@ -114,7 +114,8 @@
 /// this attribute will be made public and visible outside of any shared library
 /// they are linked in to.
 
-#if LLVM_HAS_CPP_ATTRIBUTE(gnu::visibility)
+#if LLVM_HAS_CPP_ATTRIBUTE(gnu::visibility) && defined(__GNUC__) &&            \
+    !defined(__clang__)
----------------
fsfod wrote:

That file is my pain. I did add a option to the clang tool to switch between the two places where to generate the macro for for functions. I also did try generating export macros on template classes, but it just creates ton a more code that needs to be fixed for MSVC and can be problematic for class static fields when classes with instantiations outside the llvm shared library.

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


More information about the llvm-commits mailing list