Commit 6773a41c by Rainer Orth Committed by Rainer Orth

target.h (struct gcc_target): New member external_libcall.

	* target.h (struct gcc_target): New member external_libcall.
	* target-def.h (TARGET_ASM_EXTERNAL_LIBCALL): Provide default.
	(TARGET_ASM_OUT): Use it.
	* doc/tm.texi (TARGET_ASM_EXTERNAL_LIBCALL): Document.
	* targhooks.c: Convert to ISO C 90.
	(default_external_libcall): New function.
	* targhooks.h (default_external_libcall): Declare.
	* varasm.c (assemble_external_libcall): Use
	targetm.asm_out.external_libcall instead of
	ASM_OUTPUT_EXTERNAL_LIBCALL.
	* config/mips/mips-protos.h [TARGET_IRIX5 || TARGET_IRIX 6]
	(mips_output_external_libcall): Declare.
	* config/mips/mips.c (mips_output_external_libcall): Change
	definition guard.
	Change to match TARGET_ASM_EXTERNAL_LIBCALL.
	Only operate for O32 ABI.
	* config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Define
	instead of ASM_OUTPUT_EXTERNAL_LIBCALL.
	* config/mips/iris6.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Don't undef,
	superceded by TARGET_ASM_EXTERNAL_LIBCALL.

From-SVN: r71689
parent 8c8a95ff
2003-09-23 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* target.h (struct gcc_target): New member external_libcall.
* target-def.h (TARGET_ASM_EXTERNAL_LIBCALL): Provide default.
(TARGET_ASM_OUT): Use it.
* doc/tm.texi (TARGET_ASM_EXTERNAL_LIBCALL): Document.
* targhooks.c: Convert to ISO C 90.
(default_external_libcall): New function.
* targhooks.h (default_external_libcall): Declare.
* varasm.c (assemble_external_libcall): Use
targetm.asm_out.external_libcall instead of
ASM_OUTPUT_EXTERNAL_LIBCALL.
* config/mips/mips-protos.h [TARGET_IRIX5 || TARGET_IRIX 6]
(mips_output_external_libcall): Declare.
* config/mips/mips.c (mips_output_external_libcall): Change
definition guard.
Change to match TARGET_ASM_EXTERNAL_LIBCALL.
Only operate for O32 ABI.
* config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Define
instead of ASM_OUTPUT_EXTERNAL_LIBCALL.
* config/mips/iris6.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Don't undef,
superceded by TARGET_ASM_EXTERNAL_LIBCALL.
2003-09-22 Nathnael Nerode <neroden@gcc.gnu.org> 2003-09-22 Nathnael Nerode <neroden@gcc.gnu.org>
* config.host: Allow unknown hosts (not targets). Allow * config.host: Allow unknown hosts (not targets). Allow
......
...@@ -215,8 +215,8 @@ do { \ ...@@ -215,8 +215,8 @@ do { \
} while (0) } while (0)
/* Also do this for libcalls. */ /* Also do this for libcalls. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ #undef TARGET_ASM_EXTERNAL_LIBCALL
mips_output_external_libcall (FILE, XSTR (FUN, 0)) #define TARGET_ASM_EXTERNAL_LIBCALL mips_output_external_libcall
/* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables. /* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
This is used indirectly by ASM_OUTPUT_EXTERNAL. */ This is used indirectly by ASM_OUTPUT_EXTERNAL. */
......
...@@ -178,7 +178,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -178,7 +178,6 @@ Boston, MA 02111-1307, USA. */
/* IRIX 5 stuff that we don't need for IRIX 6. */ /* IRIX 5 stuff that we don't need for IRIX 6. */
/* ??? We do need this for the -mabi=32 switch though. */ /* ??? We do need this for the -mabi=32 switch though. */
#undef ASM_OUTPUT_UNDEF_FUNCTION #undef ASM_OUTPUT_UNDEF_FUNCTION
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef ASM_DECLARE_FUNCTION_SIZE #undef ASM_DECLARE_FUNCTION_SIZE
/* Stuff we need for IRIX 6 that isn't in IRIX 5. */ /* Stuff we need for IRIX 6 that isn't in IRIX 5. */
......
/* Prototypes of target machine for GNU compiler. MIPS version. /* Prototypes of target machine for GNU compiler. MIPS version.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2001, 2002 Free Software Foundation, Inc. 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by A. Lichnewsky (lich@inria.inria.fr). Contributed by A. Lichnewsky (lich@inria.inria.fr).
Changed by Michael Meissner (meissner@osf.org). Changed by Michael Meissner (meissner@osf.org).
64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and 64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
...@@ -98,8 +98,8 @@ extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT); ...@@ -98,8 +98,8 @@ extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT);
extern void print_operand (FILE *, rtx, int); extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx); extern void print_operand_address (FILE *, rtx);
extern int mips_output_external (FILE *, tree, const char *); extern int mips_output_external (FILE *, tree, const char *);
#ifdef ASM_OUTPUT_UNDEF_FUNCTION #if TARGET_IRIX5 || TARGET_IRIX6
extern int mips_output_external_libcall (FILE *, const char *); extern void mips_output_external_libcall (rtx);
#endif #endif
extern void mips_output_filename (FILE *, const char *); extern void mips_output_filename (FILE *, const char *);
extern void mips_output_lineno (FILE *, int); extern void mips_output_lineno (FILE *, int);
......
...@@ -5517,19 +5517,20 @@ mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name) ...@@ -5517,19 +5517,20 @@ mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name)
return 0; return 0;
} }
#ifdef ASM_OUTPUT_UNDEF_FUNCTION #if TARGET_IRIX5 || TARGET_IRIX6
int void
mips_output_external_libcall (FILE *file ATTRIBUTE_UNUSED, const char *name) mips_output_external_libcall (rtx fun)
{ {
register struct extern_list *p; register struct extern_list *p;
p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); if (mips_abi == ABI_32)
p->next = extern_head; {
p->name = name; p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list));
p->size = -1; p->next = extern_head;
extern_head = p; p->name = XSTR (fun, 0);
p->size = -1;
return 0; extern_head = p;
}
} }
#endif #endif
......
...@@ -6729,15 +6729,11 @@ This macro need not be defined if it does not need to output anything. ...@@ -6729,15 +6729,11 @@ This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything. The GNU assembler and most Unix assemblers don't require anything.
@end defmac @end defmac
@defmac ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref}) @deftypefn {Target Hook} void TARGET_ASM_EXTERNAL_LIBCALL (rtx @var{symref})
A C statement (sans semicolon) to output on @var{stream} an assembler This target hook is a function to output to @var{asm_out_file} an assembler
pseudo-op to declare a library function name external. The name of the pseudo-op to declare a library function name external. The name of the
library function is given by @var{symref}, which has type @code{rtx} and library function is given by @var{symref}, which is a @code{symbol_ref}.
is a @code{symbol_ref}. @end deftypefn
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
@end defmac
@defmac ASM_OUTPUT_LABELREF (@var{stream}, @var{name}) @defmac ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream A C statement (sans semicolon) to output to the stdio stream
......
...@@ -166,6 +166,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -166,6 +166,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false #define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
#endif #endif
#ifndef TARGET_ASM_EXTERNAL_LIBCALL
#define TARGET_ASM_EXTERNAL_LIBCALL default_external_libcall
#endif
#define TARGET_ASM_ALIGNED_INT_OP \ #define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \ {TARGET_ASM_ALIGNED_HI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \ TARGET_ASM_ALIGNED_SI_OP, \
...@@ -202,7 +206,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -202,7 +206,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_OUTPUT_MI_THUNK, \ TARGET_ASM_OUTPUT_MI_THUNK, \
TARGET_ASM_CAN_OUTPUT_MI_THUNK, \ TARGET_ASM_CAN_OUTPUT_MI_THUNK, \
TARGET_ASM_FILE_START, \ TARGET_ASM_FILE_START, \
TARGET_ASM_FILE_END} TARGET_ASM_FILE_END, \
TARGET_ASM_EXTERNAL_LIBCALL}
/* Scheduler hooks. All of these default to null pointers, which /* Scheduler hooks. All of these default to null pointers, which
haifa-sched.c looks for and handles. */ haifa-sched.c looks for and handles. */
......
...@@ -148,6 +148,10 @@ struct gcc_target ...@@ -148,6 +148,10 @@ struct gcc_target
/* Output any boilerplate text needed at the end of a /* Output any boilerplate text needed at the end of a
translation unit. */ translation unit. */
void (*file_end) (void); void (*file_end) (void);
/* Output an assembler pseudo-op to declare a library function name
external. */
void (*external_libcall) (rtx);
} asm_out; } asm_out;
/* Functions relating to instruction scheduling. */ /* Functions relating to instruction scheduling. */
......
...@@ -61,9 +61,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -61,9 +61,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h" #include "tm_p.h"
#include "target-def.h" #include "target-def.h"
void
default_external_libcall (rtx fun ATTRIBUTE_UNUSED)
{
#ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
ASM_OUTPUT_EXTERNAL_LIBCALL(asm_out_file, fun);
#endif
}
bool bool
default_promote_function_args (fntype) default_promote_function_args (tree fntype ATTRIBUTE_UNUSED)
tree fntype ATTRIBUTE_UNUSED;
{ {
#ifdef PROMOTE_FUNCTION_ARGS #ifdef PROMOTE_FUNCTION_ARGS
return true; return true;
...@@ -73,8 +80,7 @@ default_promote_function_args (fntype) ...@@ -73,8 +80,7 @@ default_promote_function_args (fntype)
} }
bool bool
default_promote_function_return (fntype) default_promote_function_return (tree fntype ATTRIBUTE_UNUSED)
tree fntype ATTRIBUTE_UNUSED;
{ {
#ifdef PROMOTE_FUNCTION_RETURN #ifdef PROMOTE_FUNCTION_RETURN
return true; return true;
...@@ -84,8 +90,7 @@ default_promote_function_return (fntype) ...@@ -84,8 +90,7 @@ default_promote_function_return (fntype)
} }
bool bool
default_promote_prototypes (fntype) default_promote_prototypes (tree fntype ATTRIBUTE_UNUSED)
tree fntype ATTRIBUTE_UNUSED;
{ {
if (PROMOTE_PROTOTYPES) if (PROMOTE_PROTOTYPES)
return true; return true;
......
...@@ -18,6 +18,8 @@ along with GCC; see the file COPYING. If not, write to the Free ...@@ -18,6 +18,8 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
extern void default_external_libcall (rtx);
extern bool default_promote_function_args (tree); extern bool default_promote_function_args (tree);
extern bool default_promote_function_return (tree); extern bool default_promote_function_return (tree);
extern bool default_promote_prototypes (tree); extern bool default_promote_prototypes (tree);
......
...@@ -1621,16 +1621,14 @@ assemble_external (tree decl ATTRIBUTE_UNUSED) ...@@ -1621,16 +1621,14 @@ assemble_external (tree decl ATTRIBUTE_UNUSED)
/* Similar, for calling a library function FUN. */ /* Similar, for calling a library function FUN. */
void void
assemble_external_libcall (rtx fun ATTRIBUTE_UNUSED) assemble_external_libcall (rtx fun)
{ {
#ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
/* Declare library function name external when first used, if nec. */ /* Declare library function name external when first used, if nec. */
if (! SYMBOL_REF_USED (fun)) if (! SYMBOL_REF_USED (fun))
{ {
SYMBOL_REF_USED (fun) = 1; SYMBOL_REF_USED (fun) = 1;
ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun); (*targetm.asm_out.external_libcall) (fun);
} }
#endif
} }
/* Assemble a label named NAME. */ /* Assemble a label named NAME. */
......
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