]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
winnt.c (ix86_handle_dll_attribute): Set DECL_EXTERN and TREE_PUBLIC for dllimported...
authorJason Merrill <jason@redhat.com>
Mon, 16 Sep 2002 22:24:43 +0000 (18:24 -0400)
committerDanny Smith <dannysmith@gcc.gnu.org>
Mon, 16 Sep 2002 22:24:43 +0000 (22:24 +0000)
* config/i386/winnt.c (ix86_handle_dll_attribute): Set
DECL_EXTERN and TREE_PUBLIC for dllimported variables here...
(i386_pe_mark_dllimport): Not here.

Co-Authored-By: Danny Smith <dannysmith@users.sourceforge.net>
From-SVN: r57217

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

index 783f3d13a8cbb402fd932fe5383ecdaa57f3b776..e43b3283f398f9fe73221a8689e241ed3ffe7074 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-16  Jason Merrill  <jason@redhat.com>
+           Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/i386/winnt.c (ix86_handle_dll_attribute): Set
+       DECL_EXTERN and TREE_PUBLIC for dllimported variables here...
+       (i386_pe_mark_dllimport): Not here.
+
 2002-09-14  Stephane Carrez  <stcarrez@nerim.fr>
 
        * config/m68hc11/m68hc11.md ("movdi_internal"): Allow any offsetable
index 9d955df2f48ea5c7f2c5d81e7596edb26a855d08..6928a8c7b3af3373747a89602da947316853d00c 100644 (file)
@@ -76,6 +76,15 @@ ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs)
        }
     }
 
+  /* `extern' needn't be specified with dllimport.
+     Specify `extern' now and hope for the best.  Sigh.  */
+  else if (TREE_CODE (*node) == VAR_DECL
+          && is_attribute_p ("dllimport", name))
+    {
+      DECL_EXTERNAL (*node) = 1;
+      TREE_PUBLIC (*node) = 1;
+    }
+
   return NULL_TREE;
 }
 
@@ -300,16 +309,6 @@ i386_pe_mark_dllimport (decl)
       return;
     }
 
-  /* `extern' needn't be specified with dllimport.
-     Specify `extern' now and hope for the best.  Sigh.  */
-  if (TREE_CODE (decl) == VAR_DECL
-      /* ??? Is this test for vtables needed?  */
-      && !DECL_VIRTUAL_P (decl))
-    {
-      DECL_EXTERNAL (decl) = 1;
-      TREE_PUBLIC (decl) = 1;
-    }
-
   newname = alloca (strlen (oldname) + 11);
   sprintf (newname, "@i._imp__%s", oldname);