[PATCH] D101972: Force visibility of llvm::Any to external

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 22:47:57 PDT 2021


serge-sans-paille updated this revision to Diff 346347.
serge-sans-paille added a comment.

Patch updated with the advised comment.

I second @rnk opinion on this patch being non-optimal, but I also think we need to land it as is for 12.0.1 release.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101972/new/

https://reviews.llvm.org/D101972

Files:
  llvm/include/llvm/ADT/Any.h


Index: llvm/include/llvm/ADT/Any.h
===================================================================
--- llvm/include/llvm/ADT/Any.h
+++ llvm/include/llvm/ADT/Any.h
@@ -23,7 +23,12 @@
 
 namespace llvm {
 
-class Any {
+class LLVM_EXTERNAL_VISIBILITY Any {
+
+  // The `Typeid<T>::Id` static data member below is a globally unique
+  // identifier for the type `T`. It is explicitly marked with default
+  // visibility so that when `-fvisibility=hidden` is used, the loader still
+  // merges duplicate definitions across DSO boundaries.
   template <typename T> struct TypeId { static const char Id; };
 
   struct StorageBase {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101972.346347.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210519/2d5e8df8/attachment.bin>


More information about the llvm-commits mailing list