[PATCH] D34637: [libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS

Tom Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 12:02:50 PDT 2017


thomasanderson created this revision.

It's useful to be able to disable visibility annotations entirely; for
example, if we're building libunwind static to include in another library,
and we don't want any libunwind functions getting exported out of that
library.


https://reviews.llvm.org/D34637

Files:
  src/config.h


Index: src/config.h
===================================================================
--- src/config.h
+++ src/config.h
@@ -44,9 +44,14 @@
   #endif
 #endif
 
-// FIXME: these macros are not correct for COFF targets
-#define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
-#define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+#if defined(_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS)
+  #define _LIBUNWIND_EXPORT
+  #define _LIBUNWIND_HIDDEN
+#else
+  // FIXME: these macros are not correct for COFF targets
+  #define _LIBUNWIND_EXPORT __attribute__((visibility("default")))
+  #define _LIBUNWIND_HIDDEN __attribute__((visibility("hidden")))
+#endif
 
 #if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
 #define _LIBUNWIND_BUILD_SJLJ_APIS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34637.104001.patch
Type: text/x-patch
Size: 794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170626/c42c1fc6/attachment.bin>


More information about the llvm-commits mailing list