final.c (no_asm_to_stream): New.

* 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
This commit is contained in:
Neil Booth 2001-07-08 19:55:57 +00:00 committed by Neil Booth
parent 45c8268d06
commit b4c25db2df
15 changed files with 79 additions and 38 deletions

View File

@ -1,3 +1,34 @@
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.

View File

@ -973,9 +973,6 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
#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); \

View File

@ -28,7 +28,6 @@ extern int alpha_pv_save_size PARAMS ((void));
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));

View File

@ -129,6 +129,8 @@ static void alpha_emit_xfloating_libcall
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
@ -147,6 +149,9 @@ static rtx alpha_emit_xfloating_compare
# 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;
/* Parse target option strings. */
@ -5001,8 +5006,8 @@ alpha_start_function (file, fnname, decl)
/* 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)

View File

@ -1202,10 +1202,6 @@ extern struct alpha_compare alpha_compare;
#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

View File

@ -128,7 +128,6 @@ extern void ia64_encode_section_info PARAMS((tree));
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));

View File

@ -137,8 +137,9 @@ static rtx ia64_expand_lock_test_and_set PARAMS ((enum machine_mode,
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 *));
/* Initialize the GCC target structure. */
#undef TARGET_VALID_TYPE_ATTRIBUTE
@ -146,6 +147,8 @@ static void ia64_function_epilogue PARAMS((FILE *, HOST_WIDE_INT));
#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
@ -2572,8 +2575,8 @@ ia64_output_function_prologue (file, size)
/* 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))

View File

@ -1458,10 +1458,6 @@ do { \
/* 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

View File

@ -84,9 +84,7 @@ extern int null_prologue PARAMS ((void));
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));

View File

@ -65,10 +65,16 @@ enum processor_type m88k_cpu; /* target cpu */
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 *));
/* 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
@ -1954,8 +1960,8 @@ m88k_output_function_prologue (stream, size)
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)
@ -2031,8 +2037,8 @@ m88k_expand_prologue ()
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)

View File

@ -1046,9 +1046,6 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#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. */
@ -1080,9 +1077,6 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
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.

View File

@ -546,6 +546,13 @@ default_function_pro_epilogue (file, size)
{
}
/* 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. */
@ -2090,16 +2097,12 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
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:

View File

@ -451,3 +451,6 @@ extern int profile_label_no;
/* 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 *));

View File

@ -25,10 +25,15 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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. */

View File

@ -52,6 +52,12 @@ struct gcc_target
/* 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;