re PR target/40068 (GCC fails to apply dllexport attribute to typeinfo.)

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
This commit is contained in:
Kai Tietz 2012-02-07 11:45:59 +01:00 committed by Kai Tietz
parent b1b95093ad
commit 26cfb9ab3d
2 changed files with 21 additions and 0 deletions

View 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

View 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)