]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/40068 (GCC fails to apply dllexport attribute to typeinfo.)
authorKai Tietz <ktietz@redhat.com>
Tue, 7 Feb 2012 10:45:59 +0000 (11:45 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Tue, 7 Feb 2012 10:45:59 +0000 (11:45 +0100)
2012-02-07  Kai Tietz  <ktietz@redhat.com>
            Dave Korn  <dave.korn.cygwin@gmail.com>

        PR target/40068
        * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition):
        Take care that typinfo gets dllexport-attribute.

Co-Authored-By: Dave Korn <dave.korn.cygwin@gmail.com>
From-SVN: r183962

gcc/ChangeLog
gcc/config/i386/winnt-cxx.c

index b3662384cd76e31f8d6b9c9ceef3aeb607fd9926..a35ee2c43002ed1bdd23c846409d114423318cd5 100644 (file)
@@ -1,3 +1,10 @@
+2012-02-07  Kai Tietz  <ktietz@redhat.com>
+            Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/40068
+       * config/i386/winnt-cxx.c (i386_pe_adjust_class_at_definition):
+       Take care that typinfo gets dllexport-attribute.
+
 2012-02-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/52074
index 9c55230069947ce4b2751492b6d066ea3bbc183f..0c47e3a8b58b835cc91f93cf88c9d0f35fa967ea 100644 (file)
@@ -97,6 +97,20 @@ i386_pe_adjust_class_at_definition (tree t)
  
   if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (t)) != NULL_TREE)
     {
+      tree tmv = TYPE_MAIN_VARIANT (t);
+
+      /* Make sure that we set dllexport attribute to typeinfo's
+        base declaration, as otherwise it would fail to be exported as
+        it isn't a class-member.  */
+      if (tmv != NULL_TREE
+         && CLASSTYPE_TYPEINFO_VAR (tmv) != NULL_TREE)
+       {
+         tree na, ti_decl = CLASSTYPE_TYPEINFO_VAR (tmv);
+         na = tree_cons (get_identifier ("dllexport"), NULL_TREE,
+                         NULL_TREE);
+         decl_attributes (&ti_decl, na, 0);
+       }
+
       /* Check static VAR_DECL's.  */
       for (member = TYPE_FIELDS (t); member; member = DECL_CHAIN (member))
        if (TREE_CODE (member) == VAR_DECL)