OSDN Git Service

* config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2003 20:23:38 +0000 (20:23 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2003 20:23:38 +0000 (20:23 +0000)
mips_declare_object_name.
(ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object.
* config/mips/elf64.h: As for elf.h.
* config/mips/iris6.h: Likewise.
* config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h.
* config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary
do...while (0) block.
* config/mips/mips-protos.h (mips_declare_object_name): Declare.
(mips_finish_declare_object): Declare.
* config/mips/mips.c (mips_declare_object_name): New function.
(mips_finish_declare_object): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69352 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/elf.h
gcc/config/mips/elf64.h
gcc/config/mips/iris6.h
gcc/config/mips/linux.h
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h

index 37c8737..f3132a1 100644 (file)
@@ -1,5 +1,18 @@
 2003-07-14  Richard Sandiford  <rsandifo@redhat.com>
 
+       * config/mips/elf.h (ASM_DECLARE_OBJECT_NAME): Use
+       mips_declare_object_name.
+       (ASM_FINISH_DECLARE_OBJECT): Likewise mips_finish_declare_object.
+       * config/mips/elf64.h: As for elf.h.
+       * config/mips/iris6.h: Likewise.
+       * config/mips/linux.h (ASM_DECLARE_OBJECT_NAME): As for elf.h.
+       * config/mips/mips.h (ASM_DECLARE_OBJECT_NAME): Remove unnecessary
+       do...while (0) block.
+       * config/mips/mips-protos.h (mips_declare_object_name): Declare.
+       (mips_finish_declare_object): Declare.
+       * config/mips/mips.c (mips_declare_object_name): New function.
+       (mips_finish_declare_object): New function.
+
        * config/mips/elf.h (SBSS_SECTION_ASM_OP): Delete.
        * config/mips/linux.h: Likewise.
 
index f801525..a13c864 100644 (file)
@@ -95,50 +95,11 @@ do {                                                                        \
 } while (0)
 #endif
 
-/* These macros generate the special .type and .size directives which
-   are used to set the corresponding fields of the linker symbol table
-   entries in an ELF object file under SVR4.  These macros also output
-   the starting labels for the relevant functions/objects.  */
-
-/* Write the extra assembler code needed to declare an object properly.  */
-
-#undef  ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                      \
-  do {                                                                 \
-    HOST_WIDE_INT size;                                                        \
-    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                  \
-    size_directive_output = 0;                                         \
-    if (!flag_inhibit_size_directive && DECL_SIZE (DECL))              \
-      {                                                                        \
-       size_directive_output = 1;                                      \
-       size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);                   \
-      }                                                                        \
-    mips_declare_object (FILE, NAME, "", ":\n", 0);                    \
-  } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
-   in the case where we did not do so before the initializer.
-   Once we find the error_mark_node, we know that the value of
-   size_directive_output was set
-   by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
-
-#undef  ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)        \
-do {                                                                    \
-     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);            \
-     HOST_WIDE_INT size;                                                \
-                                                                        \
-     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)               \
-         && ! AT_END && TOP_LEVEL                                       \
-        && DECL_INITIAL (DECL) == error_mark_node                       \
-        && !size_directive_output)                                      \
-       {                                                                \
-        size_directive_output = 1;                                      \
-        size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-        ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
-       }                                                                \
-   } while (0)
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
 
 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                            \
  do { fputc ( '\t', FILE);                                            \
index 6972128..b520812 100644 (file)
@@ -60,49 +60,11 @@ Boston, MA 02111-1307, USA.  */
 #define TYPE_ASM_OP    "\t.type\t"
 #define SIZE_ASM_OP    "\t.size\t"
 
-/* These macros generate the special .type and .size directives which
-   are used to set the corresponding fields of the linker symbol table
-   entries in an ELF object file under SVR4.  These macros also output
-   the starting labels for the relevant functions/objects.  */
-
-/* Write the extra assembler code needed to declare an object properly.  */
-
 #undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                      \
-  do {                                                                 \
-    HOST_WIDE_INT size;                                                        \
-    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                  \
-    size_directive_output = 0;                                         \
-    if (!flag_inhibit_size_directive && DECL_SIZE (DECL))              \
-      {                                                                        \
-       size_directive_output = 1;                                      \
-       size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);                   \
-      }                                                                        \
-    mips_declare_object (FILE, NAME, "", ":\n", 0);                    \
-  } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
-   in the case where we did not do so before the initializer.
-   Once we find the error_mark_node, we know that the value of
-   size_directive_output was set
-   by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
 
 #undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)        \
-do {                                                                    \
-     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);            \
-     HOST_WIDE_INT size;                                                \
-     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)               \
-         && ! AT_END && TOP_LEVEL                                       \
-        && DECL_INITIAL (DECL) == error_mark_node                       \
-        && !size_directive_output)                                      \
-       {                                                                \
-        size_directive_output = 1;                                      \
-        size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-        ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
-       }                                                                \
-   } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
 
 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                            \
  do { fputc ( '\t', FILE);                                            \
index 0bfc44b..c9b4ec8 100644 (file)
@@ -370,51 +370,17 @@ while (0)
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
 
-/* Write the extra assembler code needed to declare an object properly.  */
-
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL)                    \
-do                                                                     \
- {                                                                     \
-   HOST_WIDE_INT size;                                                 \
-   size_directive_output = 0;                                          \
-   if (!flag_inhibit_size_directive && DECL_SIZE (DECL))               \
-     {                                                                 \
-       size_directive_output = 1;                                      \
-       size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-       ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, size);                 \
-     }                                                                 \
-   mips_declare_object (STREAM, NAME, "", ":\n", 0);                   \
- }                                                                     \
-while (0)
-
 /* Define the `__builtin_va_list' type for the ABI.  On IRIX 6, this
    type is `char *'.  */
 #undef BUILD_VA_LIST_TYPE
 #define BUILD_VA_LIST_TYPE(VALIST) \
   (VALIST) = build_pointer_type (char_type_node)
 
-/* Output the size directive for a decl in rest_of_decl_compilation
-   in the case where we did not do so before the initializer.
-   Once we find the error_mark_node, we know that the value of
-   size_directive_output was set
-   by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
 
 #undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)        \
-do {                                                                    \
-     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);            \
-     HOST_WIDE_INT size;                                                \
-     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)               \
-         && ! AT_END && TOP_LEVEL                                       \
-        && DECL_INITIAL (DECL) == error_mark_node                       \
-        && !size_directive_output)                                      \
-       {                                                                \
-        size_directive_output = 1;                                      \
-        size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-        ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
-       }                                                                \
-   } while (0)
+#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
 
 #undef LOCAL_LABEL_PREFIX
 #define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
index 133ce28..e7c9afd 100644 (file)
@@ -54,27 +54,8 @@ do {                                                         \
   ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1);                     \
 } while (0)
 
-/* These macros generate the special .type and .size directives which
-   are used to set the corresponding fields of the linker symbol table
-   entries in an ELF object file under SVR4.  These macros also output
-   the starting labels for the relevant functions/objects.  */
-
-/* Write the extra assembler code needed to declare an object properly.  */
-
 #undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                      \
-  do {                                                                 \
-    HOST_WIDE_INT size;                                                        \
-    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                  \
-    size_directive_output = 0;                                         \
-    if (!flag_inhibit_size_directive && DECL_SIZE (DECL))              \
-      {                                                                        \
-       size_directive_output = 1;                                      \
-       size = int_size_in_bytes (TREE_TYPE (DECL));                    \
-       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);                   \
-      }                                                                        \
-    mips_declare_object (FILE, NAME, "", ":\n", 0);                    \
-  } while (0)
+#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
 
 #undef TARGET_VERSION
 #if TARGET_ENDIAN_DEFAULT == 0
index 217647b..d60c7c7 100644 (file)
@@ -35,6 +35,10 @@ extern int           mips_can_use_return_insn PARAMS ((void));
 extern void            mips_declare_object PARAMS ((FILE *, const char *,
                                                     const char *,
                                                     const char *, int));
+extern void            mips_declare_object_name PARAMS ((FILE *, const char *,
+                                                         tree));
+extern void            mips_finish_declare_object PARAMS ((FILE *, tree,
+                                                           int, int));
 extern void            mips_expand_epilogue PARAMS ((int));
 extern void            mips_expand_prologue PARAMS ((void));
 extern void            mips_output_filename PARAMS ((FILE *, const char *));
index a6ddf2b..b7b9b7b 100644 (file)
@@ -6236,6 +6236,61 @@ mips_declare_object (stream, name, init_string, final_string, size)
       TREE_ASM_WRITTEN (name_tree) = 1;
     }
 }
+
+#ifdef ASM_OUTPUT_SIZE_DIRECTIVE
+extern int size_directive_output;
+
+/* Implement ASM_DECLARE_OBJECT_NAME.  This is like most of the standard ELF
+   definitions except that it uses mips_declare_object() to emit the label.  */
+
+void
+mips_declare_object_name (stream, name, decl)
+     FILE *stream;
+     const char *name;
+     tree decl ATTRIBUTE_UNUSED;
+{
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+  ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "object");
+#endif
+
+  size_directive_output = 0;
+  if (!flag_inhibit_size_directive && DECL_SIZE (decl))
+    {
+      HOST_WIDE_INT size;
+
+      size_directive_output = 1;
+      size = int_size_in_bytes (TREE_TYPE (decl));
+      ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+    }
+
+  mips_declare_object (stream, name, "", ":\n", 0);
+}
+
+/* Implement ASM_FINISH_DECLARE_OBJECT.  This is generic ELF stuff.  */
+
+void
+mips_finish_declare_object (stream, decl, top_level, at_end)
+     FILE *stream;
+     tree decl;
+     int top_level, at_end;
+{
+  const char *name;
+
+  name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+  if (!flag_inhibit_size_directive
+      && DECL_SIZE (decl) != 0
+      && !at_end && top_level
+      && DECL_INITIAL (decl) == error_mark_node
+      && !size_directive_output)
+    {
+      HOST_WIDE_INT size;
+
+      size_directive_output = 1;
+      size = int_size_in_bytes (TREE_TYPE (decl));
+      ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size);
+    }
+}
+#endif
 \f
 /* Return the register that should be used as the global pointer
    within this function.  Return 0 if the function doesn't need
index bb75d11..870dc51 100644 (file)
@@ -3609,23 +3609,9 @@ while (0)
        $Lc[0-9]+       Label for use in s<xx> operation.
        $Le[0-9]+       End blocks for MIPS debug support  */
 
-/* A C statement (sans semicolon) to output to the stdio stream
-   STREAM any text necessary for declaring the name NAME of an
-   initialized variable which is being defined.  This macro must
-   output the label definition (perhaps using `ASM_OUTPUT_LABEL').
-   The argument DECL is the `VAR_DECL' tree node representing the
-   variable.
-
-   If this macro is not defined, then the variable name is defined
-   in the usual manner as a label (by means of `ASM_OUTPUT_LABEL').  */
-
 #undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL)                    \
-do                                                                     \
- {                                                                     \
-   mips_declare_object (STREAM, NAME, "", ":\n", 0);                   \
- }                                                                     \
-while (0)
+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
+  mips_declare_object (STREAM, NAME, "", ":\n", 0)
 
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP "\t.globl\t"