Commit 92dee628 by Richard Stallman

(ASM_DECLARE_OBJECT_NAME): Set size_directive_output.

(ASM_FINISH_DECLARE_OBJECT): Defined.

From-SVN: r5839
parent 77a2f698
...@@ -718,28 +718,50 @@ while (0) ...@@ -718,28 +718,50 @@ while (0)
in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */ in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
#undef ASM_DECLARE_OBJECT_NAME #undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
do \ do \
{ \ { \
ASM_OUTPUT_LABEL(STREAM,NAME); \ ASM_OUTPUT_LABEL(STREAM,NAME); \
HALF_PIC_DECLARE (NAME); \ HALF_PIC_DECLARE (NAME); \
if (TARGET_ELF) \ if (TARGET_ELF) \
{ \ { \
fprintf (STREAM, "\t%s\t ", TYPE_ASM_OP); \ fprintf (STREAM, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (STREAM, NAME); \ assemble_name (STREAM, NAME); \
putc (',', STREAM); \ putc (',', STREAM); \
fprintf (STREAM, TYPE_OPERAND_FMT, "object"); \ fprintf (STREAM, TYPE_OPERAND_FMT, "object"); \
putc ('\n', STREAM); \ putc ('\n', STREAM); \
if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ size_directive_output = 0; \
{ \ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
fprintf (STREAM, "\t%s\t ", SIZE_ASM_OP); \ { \
assemble_name (STREAM, NAME); \ size_directive_output = 1; \
fprintf (STREAM, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (STREAM, NAME); \
fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
} \ } \
} \ } \
} \ } \
while (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_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
do { \
char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
&& ! AT_END && TOP_LEVEL \
&& DECL_INITIAL (DECL) == error_mark_node \
&& !size_directive_output) \
{ \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, name); \
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
} \
} while (0)
/* This is how to declare a function name. */ /* This is how to declare a function name. */
#undef ASM_DECLARE_FUNCTION_NAME #undef ASM_DECLARE_FUNCTION_NAME
......
...@@ -1912,25 +1912,47 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -1912,25 +1912,47 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
/* Write the extra assembler code needed to declare an object properly. */ /* Write the extra assembler code needed to declare an object properly. */
#undef ASM_DECLARE_OBJECT_NAME #undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
do { \ do { \
if (DECLARE_ASM_NAME) \ if (DECLARE_ASM_NAME) \
{ \ { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \ assemble_name (FILE, NAME); \
putc (',', FILE); \ putc (',', FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
putc ('\n', FILE); \ putc ('\n', FILE); \
if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ size_directive_output = 0; \
{ \ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \ { \
assemble_name (FILE, NAME); \ size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, NAME); \
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
} \ } \
} \ } \
ASM_OUTPUT_LABEL(FILE, NAME); \ ASM_OUTPUT_LABEL(FILE, NAME); \
} while (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_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
do { \
char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
&& ! AT_END && TOP_LEVEL \
&& DECL_INITIAL (DECL) == error_mark_node \
&& !size_directive_output) \
{ \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, name); \
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
} \
} while (0)
/* This is how to declare the size of a function. */ /* This is how to declare the size of a function. */
#undef ASM_DECLARE_FUNCTION_SIZE #undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment