[PATCH] D14411: Use __attribute__((internal_linkage)) when available.

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 18:26:50 PST 2015


eugenis created this revision.
eugenis added reviewers: EricWF, mclow.lists.
eugenis added a subscriber: cfe-commits.
eugenis set the repository for this revision to rL LLVM.

Use __attribute__((internal_linkage)) instead of always_inline and visibility("hidden") when it is available.

Repository:
  rL LLVM

http://reviews.llvm.org/D14411

Files:
  include/__config

Index: include/__config
===================================================================
--- include/__config
+++ include/__config
@@ -233,15 +233,23 @@
 #endif
 
 #ifndef _LIBCPP_INLINE_VISIBILITY
+#if __has_attribute(internal_linkage)
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((internal_linkage))
+#else
 #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
 #endif
+#endif
 
 #ifndef _LIBCPP_EXCEPTION_ABI
 #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
 #endif
 
 #ifndef _LIBCPP_ALWAYS_INLINE
-#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
+#if __has_attribute(internal_linkage)
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((internal_linkage))
+#else
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
+#endif
 #endif
 
 #if defined(__clang__)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14411.39456.patch
Type: text/x-patch
Size: 920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151106/80955e1e/attachment.bin>


More information about the cfe-commits mailing list