d: Use d_comdat_linkage on generated internal decl.
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 30 Mar 2020 09:37:30 +0000 (11:37 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 31 Mar 2020 13:54:45 +0000 (15:54 +0200)
This adds weak linkage to internal TypeInfo data on top of the existing
DECL_COMDAT, which helps in the unlikely event that two of the same
TypeInfo data ends up in multiple places.

gcc/d/ChangeLog:

* typeinfo.cc (TypeInfoVisitor::internal_reference): Call
d_comdat_linkage on generated decl.

gcc/d/ChangeLog
gcc/d/typeinfo.cc

index 606f7f30eb04fab8b720854080eb4268c6503220..ea1d7d5c896fa942fbf7f4ee8d0ca167a24755c1 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-31  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * typeinfo.cc (TypeInfoVisitor::internal_reference): Call
+       d_comdat_linkage on generated decl.
+
 2020-03-22  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        PR d/93038
index 07011deaf6f951f2e4dc5b028ccf1fc17ef88dde..90a44944f4ce6fbe71328621ad0bad8e0093be5d 100644 (file)
@@ -358,7 +358,7 @@ class TypeInfoVisitor : public Visitor
     DECL_EXTERNAL (decl) = 0;
     TREE_PUBLIC (decl) = 1;
     DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL;
-    DECL_COMDAT (decl) = 1;
+    d_comdat_linkage (decl);
     d_pushdecl (decl);
 
     return decl;