* final.c (no_asm_to_stream): New.
(final_scan_insn): Use target structures for prologue ends
and epilogue starts.
* output.h (no_asm_to_stream): New.
* target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE,
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New.
(TARGET_ASM_OUT): Update.
* target.h (struct gcc_target): New members function_end_prologue
and function_begin_epilogue.
config:
* 1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused.
* alpha/alpha-protos.h (output_end_prologue): Delete.
* alpha/alpha.c (output_end_prologue): Rename to
alpha_output_function_end_prologue. Use in target struct
and make static.
* alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete.
* ia64/ia64-protos.h (ia64_output_end_prologue): Delete.
* ia64/ia64.c (ia64_output_end_prologue): Rename to
ia64_output_function_end_prologue. Use in target struct
and make static.
(ia64_function_prologue, ia64_funciton_epilogue): Rename
mistyped prototypes.
* ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete.
* m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue): Delete.
* m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename
an use in target struct, make static.
* ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE): Delete.
From-SVN: r43849
+2001-07-08 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * final.c (no_asm_to_stream): New.
+ (final_scan_insn): Use target structures for prologue ends
+ and epilogue starts.
+ * output.h (no_asm_to_stream): New.
+ * target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE,
+ TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New.
+ (TARGET_ASM_OUT): Update.
+ * target.h (struct gcc_target): New members function_end_prologue
+ and function_begin_epilogue.
+config:
+ * 1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused.
+ * alpha/alpha-protos.h (output_end_prologue): Delete.
+ * alpha/alpha.c (output_end_prologue): Rename to
+ alpha_output_function_end_prologue. Use in target struct
+ and make static.
+ * alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete.
+ * ia64/ia64-protos.h (ia64_output_end_prologue): Delete.
+ * ia64/ia64.c (ia64_output_end_prologue): Rename to
+ ia64_output_function_end_prologue. Use in target struct
+ and make static.
+ (ia64_function_prologue, ia64_funciton_epilogue): Rename
+ mistyped prototypes.
+ * ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete.
+ * m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue): Delete.
+ * m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename
+ an use in target struct, make static.
+ * ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE): Delete.
+
+
2001-07-08 Richard Henderson <rth@redhat.com>
* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
#define ASM_COMMENT_START ";"
-#define ASM_OUTPUT_FUNNAM(FILE,NAME) \
- fprintf(FILE,"%s\n",NAME)
-
#define ASM_OUTPUT_OPCODE(FILE,PTR) do { \
while (*(PTR) != '\0' && *(PTR) != ' ') { \
putc (*(PTR), FILE); \
extern int alpha_using_fp PARAMS ((void));
extern void alpha_write_verstamp PARAMS ((FILE *));
extern void alpha_expand_prologue PARAMS ((void));
-extern void output_end_prologue PARAMS ((FILE *));
extern void alpha_expand_epilogue PARAMS ((void));
extern void alpha_output_filename PARAMS ((FILE *, const char *));
extern void alpha_output_lineno PARAMS ((FILE *, int));
PARAMS ((const char *, rtx, rtx[], int, rtx));
static rtx alpha_emit_xfloating_compare
PARAMS ((enum rtx_code, rtx, rtx));
+static void alpha_output_function_end_prologue
+ PARAMS ((FILE *));
/* Get the number of args of a function in one of two ways. */
#ifdef OPEN_VMS
# define TARGET_VALID_DECL_ATTRIBUTE vms_valid_decl_attribute_p
#endif
+#undef TARGET_ASM_FUNCTION_END_PROLOGUE
+#define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
+
struct gcc_target targetm = TARGET_INITIALIZER;
\f
/* Parse target option strings. */
/* Emit the .prologue note at the scheduled end of the prologue. */
-void
-output_end_prologue (file)
+static void
+alpha_output_function_end_prologue (file)
FILE *file;
{
if (TARGET_OPEN_VMS)
#define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \
alpha_end_function(FILE,NAME,DECL)
-/* This macro notes the end of the prologue. */
-
-#define FUNCTION_END_PROLOGUE(FILE) output_end_prologue (FILE)
-
/* Output any profiling code before the prologue. */
#define PROFILE_BEFORE_PROLOGUE 1
extern int ia64_register_move_cost PARAMS((enum reg_class, enum reg_class));
extern int ia64_epilogue_uses PARAMS((int));
extern void emit_safe_across_calls PARAMS((FILE *));
-extern void ia64_output_end_prologue PARAMS((FILE *));
extern void ia64_init_builtins PARAMS((void));
extern void ia64_override_options PARAMS((void));
extern int ia64_dbx_register_number PARAMS((int));
tree, rtx));
static rtx ia64_expand_lock_release PARAMS ((enum machine_mode, tree, rtx));
static int ia64_valid_type_attribute PARAMS((tree, tree, tree, tree));
-static void ia64_function_prologue PARAMS((FILE *, HOST_WIDE_INT));
-static void ia64_function_epilogue PARAMS((FILE *, HOST_WIDE_INT));
+static void ia64_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
+static void ia64_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void ia64_output_function_end_prologue PARAMS ((FILE *));
\f
/* Initialize the GCC target structure. */
#undef TARGET_VALID_TYPE_ATTRIBUTE
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE ia64_output_function_prologue
+#undef TARGET_ASM_FUNCTION_END_PROLOGUE
+#define TARGET_ASM_FUNCTION_END_PROLOGUE ia64_output_function_end_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE ia64_output_function_epilogue
/* Emit the .body directive at the scheduled end of the prologue. */
-void
-ia64_output_end_prologue (file)
+static void
+ia64_output_function_end_prologue (file)
FILE *file;
{
if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
\f
/* Function Entry and Exit */
-/* This macro notes the end of the prologue. */
-
-#define FUNCTION_END_PROLOGUE(FILE) ia64_output_end_prologue (FILE)
-
/* Define this macro as a C expression that is nonzero if the return
instruction or the function epilogue ignores the value of the stack pointer;
in other words, if it is safe to delete an instruction to adjust the stack
extern int integer_ok_for_set PARAMS ((unsigned));
extern void m88k_layout_frame PARAMS ((void));
extern void m88k_expand_prologue PARAMS ((void));
-extern void m88k_end_prologue PARAMS ((FILE *));
extern void m88k_expand_epilogue PARAMS ((void));
-extern void m88k_begin_epilogue PARAMS ((FILE *));
extern void output_function_profiler PARAMS ((FILE *, int, const char *, int));
extern void output_function_block_profiler PARAMS ((FILE *, int));
extern void output_block_profiler PARAMS ((FILE *, int));
static void m88k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void m88k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void m88k_output_function_end_prologue PARAMS ((FILE *));
+static void m88k_output_function_begin_epilogue PARAMS ((FILE *));
\f
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE m88k_output_function_prologue
+#undef TARGET_ASM_FUNCTION_END_PROLOGUE
+#define TARGET_ASM_FUNCTION_END_PROLOGUE m88k_output_function_end_prologue
+#undef TARGET_ASM_FUNCTION_BEGIN_EPILOGUE
+#define TARGET_ASM_FUNCTION_BEGIN_EPILOGUE m88k_output_function_begin_epilogue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m88k_output_function_epilogue
m88k_prologue_done = 1; /* it's ok now to put out ln directives */
}
-void
-m88k_end_prologue (stream)
+static void
+m88k_output_function_end_prologue (stream)
FILE *stream;
{
if (TARGET_OCS_DEBUG_INFO && !prologue_marked)
This is mandatory because of alloca; we also take advantage of it to
omit stack adjustments before returning. */
-void
-m88k_begin_epilogue (stream)
+static void
+m88k_output_function_begin_epilogue (stream)
FILE *stream;
{
if (TARGET_OCS_DEBUG_INFO && !epilogue_marked && prologue_marked)
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
m88k_va_arg (valist, type)
-/* Perform special actions at the point where the prologue ends. */
-#define FUNCTION_END_PROLOGUE(FILE) m88k_end_prologue(FILE)
-
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. Redefined in sysv3.h, sysv4.h and
dgux.h. */
No definition is equivalent to always zero. */
#define EXIT_IGNORE_STACK (1)
-/* Perform special actions at the point where the epilogue begins. */
-#define FUNCTION_BEGIN_EPILOGUE(FILE) m88k_begin_epilogue(FILE)
-
/* Value should be nonzero if functions must have frame pointers.
Zero means the frame pointer need not be set up (and parms
may be accessed via the stack pointer) in functions that seem suitable.
{
}
+/* Default target hook that outputs nothing to a stream. */
+void
+no_asm_to_stream (file)
+ FILE *file ATTRIBUTE_UNUSED;
+{
+}
+
/* Enable APP processing of subsequent output.
Used before the output from an `asm' statement. */
break;
case NOTE_INSN_PROLOGUE_END:
-#ifdef FUNCTION_END_PROLOGUE
- FUNCTION_END_PROLOGUE (file);
-#endif
+ (*targetm.asm_out.function_end_prologue) (file);
profile_after_prologue (file);
break;
case NOTE_INSN_EPILOGUE_BEG:
-#ifdef FUNCTION_BEGIN_EPILOGUE
- FUNCTION_BEGIN_EPILOGUE (file);
-#endif
+ (*targetm.asm_out.function_begin_epilogue) (file);
break;
case NOTE_INSN_FUNCTION_BEG:
/* Default target function prologue and epilogue assembler output. */
extern void default_function_pro_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+
+/* Default target hook that outputs nothing to a stream. */
+extern void no_asm_to_stream PARAMS ((FILE *));
We want to have non-NULL default definitions of all hook functions,
even if they do nothing. */
+/* Assembler output. */
#define TARGET_ASM_FUNCTION_PROLOGUE default_function_pro_epilogue
#define TARGET_ASM_FUNCTION_EPILOGUE default_function_pro_epilogue
+#define TARGET_ASM_FUNCTION_END_PROLOGUE no_asm_to_stream
+#define TARGET_ASM_FUNCTION_BEGIN_EPILOGUE no_asm_to_stream
-#define TARGET_ASM_OUT {TARGET_ASM_FUNCTION_PROLOGUE, \
+#define TARGET_ASM_OUT {TARGET_ASM_FUNCTION_PROLOGUE, \
+ TARGET_ASM_FUNCTION_END_PROLOGUE, \
+ TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, \
TARGET_ASM_FUNCTION_EPILOGUE}
/* All in tree.c. */
/* Output the assembler code for entry to a function. */
void (* function_prologue) PARAMS ((FILE *, HOST_WIDE_INT));
+ /* Output the assembler code for end of prologue. */
+ void (* function_end_prologue) PARAMS ((FILE *));
+
+ /* Output the assembler code for start of epilogue. */
+ void (* function_begin_epilogue) PARAMS ((FILE *));
+
/* Output the assembler code for function exit. */
void (* function_epilogue) PARAMS ((FILE *, HOST_WIDE_INT));
} asm_out;