cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.
authorDanny Smith <dannysmith@users.sourceforge.net>
Thu, 16 Oct 2003 19:37:53 +0000 (19:37 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Thu, 16 Oct 2003 19:37:53 +0000 (19:37 +0000)
* config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.

* config/i386/winnt.c (gen_stdcall_suffix): Make static
(gen_fastcall_suffix): Likewise.
(i386_pe_dllexport_p): Likewise.
(i386_pe_dllimport_p): Likewise.
(i386_pe_mark_dllexport): Likewise.
(i386_pe_mark_dllimport): Likewise.
(i386_pe_asm_named_section): Fix formatting.

From-SVN: r72566

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

index f3e2a44f1e25d3781b9ccfce8c74528fcfc83677..d9c52aa9aedbdb9e6c4d41b1ac3f1dc87bc89d57 100644 (file)
@@ -1,3 +1,15 @@
+2003-10-16  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.
+
+       * config/i386/winnt.c (gen_stdcall_suffix): Make static
+       (gen_fastcall_suffix): Likewise.
+       (i386_pe_dllexport_p): Likewise.
+       (i386_pe_dllimport_p): Likewise.
+       (i386_pe_mark_dllexport): Likewise.
+       (i386_pe_mark_dllimport): Likewise.
+       (i386_pe_asm_named_section): Fix formatting.
+
 2003-10-16  Zack Weinberg  <zack@codesourcery.com>
 
        * configure.in: Add snprintf to gcc_AC_CHECK_DECLS list.
index dfdb499492798d7606da629bec565e3768485f09..8ed30443bc806f26bcc18b10ef251a5329494070 100644 (file)
@@ -364,9 +364,24 @@ extern int i386_pe_dllimport_name_p (const char *);
 #ifndef SET_ASM_OP
 #define SET_ASM_OP "\t.set\t"
 #endif
+/* This implements the `alias' attribute, keeping any stdcall or
+   fastcall decoration.  */
+#undef ASM_OUTPUT_DEF_FROM_DECLS
+#define        ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET)                 \
+  do                                                                   \
+    {                                                                  \
+      const char *alias;                                               \
+      rtx rtlname = XEXP (DECL_RTL (DECL), 0);                         \
+      if (GET_CODE (rtlname) == SYMBOL_REF)                            \
+       alias = XSTR (rtlname, 0);                                      \
+      else                                                             \
+       abort ();                                                       \
+      ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET));     \
+    } while (0)
 
 #undef TREE
 
 #ifndef BUFSIZ
 # undef FILE
 #endif
+
index c1c54956fdc755ec942d47ef1a0416cd152e2f80..486fc5a10f82a3499f576dfd06780fc256083671 100644 (file)
@@ -47,12 +47,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 */
 
 static tree associated_type (tree);
-const char * gen_stdcall_suffix (tree);
-const char * gen_fastcall_suffix (tree);
-int i386_pe_dllexport_p (tree);
-int i386_pe_dllimport_p (tree);
-void i386_pe_mark_dllexport (tree);
-void i386_pe_mark_dllimport (tree);
+static const char * gen_stdcall_suffix (tree);
+static const char * gen_fastcall_suffix (tree);
+static int i386_pe_dllexport_p (tree);
+static int i386_pe_dllimport_p (tree);
+static void i386_pe_mark_dllexport (tree);
+static void i386_pe_mark_dllimport (tree);
 
 /* This is we how mark internal identifiers with dllimport or dllexport
    attributes.  */
@@ -182,7 +182,7 @@ associated_type (tree decl)
 
 /* Return nonzero if DECL is a dllexport'd object.  */
 
-int
+static int
 i386_pe_dllexport_p (tree decl)
 {
   tree exp;
@@ -208,7 +208,7 @@ i386_pe_dllexport_p (tree decl)
 
 /* Return nonzero if DECL is a dllimport'd object.  */
 
-int
+static int
 i386_pe_dllimport_p (tree decl)
 {
   tree imp;
@@ -308,7 +308,7 @@ i386_pe_dllimport_name_p (const char *symbol)
 /* Mark a DECL as being dllexport'd.
    Note that we override the previous setting (eg: dllimport).  */
 
-void
+static void
 i386_pe_mark_dllexport (tree decl)
 {
   const char *oldname;
@@ -350,7 +350,7 @@ i386_pe_mark_dllexport (tree decl)
 
 /* Mark a DECL as being dllimport'd.  */
 
-void
+static void
 i386_pe_mark_dllimport (tree decl)
 {
   const char *oldname;
@@ -406,11 +406,10 @@ i386_pe_mark_dllimport (tree decl)
    prefix consisting of FASTCALL_PREFIX and a suffix consisting of an
    atsign (@) followed by the number of bytes of arguments.  */
 
-const char *
+static const char *
 gen_fastcall_suffix (tree decl)
 {
   int total = 0;
-
   const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
   char *newsym;
 
@@ -446,7 +445,7 @@ gen_fastcall_suffix (tree decl)
    suffix consisting of an atsign (@) followed by the number of bytes of
    arguments */
 
-const char *
+static const char *
 gen_stdcall_suffix (tree decl)
 {
   int total = 0;
@@ -717,14 +716,14 @@ i386_pe_asm_named_section (const char *name, unsigned int flags)
       *f++ ='r';
     }
   else 
-  {
-    if (flags & SECTION_CODE)
-      *f++ = 'x';
-    if (flags & SECTION_WRITE)
-      *f++ = 'w';
-    if (flags & SECTION_PE_SHARED)
-      *f++ = 's';
-  }
+    {
+      if (flags & SECTION_CODE)
+        *f++ = 'x';
+      if (flags & SECTION_WRITE)
+        *f++ = 'w';
+      if (flags & SECTION_PE_SHARED)
+        *f++ = 's';
+    }
 
   *f = '\0';