aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2012-02-07 11:45:59 +0100
committerKai Tietz <ktietz@gcc.gnu.org>2012-02-07 11:45:59 +0100
commit26cfb9ab3d91892d6f6bfde59b6b6010fe467707 (patch)
tree8011b88174088067bc88a2f7f3d560cbcfba997c
parentb1b95093addde97a78ec59fef4c6930847f84566 (diff)
downloadgcc-26cfb9ab3d91892d6f6bfde59b6b6010fe467707.zip
gcc-26cfb9ab3d91892d6f6bfde59b6b6010fe467707.tar.gz
gcc-26cfb9ab3d91892d6f6bfde59b6b6010fe467707.tar.bz2
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/winnt-cxx.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b366238..a35ee2c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/winnt-cxx.c b/gcc/config/i386/winnt-cxx.c
index 9c55230..0c47e3a 100644
--- a/gcc/config/i386/winnt-cxx.c
+++ b/gcc/config/i386/winnt-cxx.c
@@ -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)