This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] factor code common to all builtin_function implementations


:ADDPATCH langhooks:

This patch creates the "add_builtin_function" with code common to all
front-end implementation of the builtin_function hook. Additionally,
it defines a minimal default implementation that is sufficient for
java and treelang. The remaining implementations  are renamed to use a
language specific prefix. For example, the C++ one is now named
cxx_builtin_function.

bootstraped with ../trunk/configure 
--enable-languages=c,c++,objc,obj-c++,fortran,treelang,java
(will test ada as soon as it builds again)

regtested with "make -k check" on the top-level directory.

Ok for the trunk?

Thanks,
Rafael

2006-05-02  Rafael Ãvila de EspÃdola <rafael.espindola@gmail.com>

	* gcc/java/decl.c: Include langhooks.h.
	(builtin_function): Remove.
	(java_init_decl_processing): Replace calls to builtin_function
	with add_builtin_function.

	* gcc/java/Make-lang.in (jc1$(exeext)): Depend on and link with
	attribs.o.
	(java/decl.o): Depend on langhooks.h.

	* gcc/java/java-tree.h (builtin_function): Remove.

	* gcc/tree.c (local_define_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/objc/objc-act.c (synth_module_prologue): Replace calls to
	builtin_function with add_builtin_function.
	(build_next_objc_exception_stuff): Replace calls to
	builtin_function with add_builtin_function.
	(build_objc_exception_stuff): Replace calls to
	builtin_function with add_builtin_function.

	* gcc/objcp/objcp-decl.h (objcp_builtin_function): Remove.

	* gcc/cp/decl.c (builtin_function_1): Move common code to
	add_builtin_function.
	(builtin_function): Rename to cxx_builtin_function.
	Change the signature.

	* gcc/cp/call.c: Include langhooks.h.
	(build_java_interface_fn_ref):  Replace calls to
	builtin_function with add_builtin_function.

	* gcc/cp/Make-lang.in (cp/call.o): Depend on langhooks.h.

	* gcc/cp/cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
	cxx_builtin_function.

	* gcc/cp/cp-tree.h (builtin_function): Rename to cxx_builtin_function.
	Change the signature.

	* gcc/c-objc-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
	c_builtin_function.

	* gcc/c-tree.h (builtin_function): Rename to c_builtin_function. Change
	the signature.

	* gcc/ada/utils.c (builtin_function): Rename to gnat_builtin_function.
	Move common code to add_builtin_function.

	* gcc/ada/misc.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as
	gnat_builtin_function.

	* gcc/ada/gigi.h (builtin_function): Rename to gnat_builtin_function.
	Change the signature.

	* gcc/c-decl.c (builtin_function): Rename to c_builtin_function. Move
	common code to add_builtin_function.

	* gcc/fortran/Make-lang.in (f951$(exeext)): Depend on and link with
	attribs.o.

	* gcc/fortran/trans.h (builtin_function): Rename to
	gfc_builtin_function. Change the signature.

	* gcc/fortran/f95-lang.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as
	gfc_builtin_function.
	(builtin_function): Rename to gfc_builtin_function. Move common
	code to builtin_function.
	(gfc_define_builtin): Replace calls to builtin_function with
	gfc_define_builtin.

	* gcc/langhooks.c (add_builtin_function): New function.
	(lhd_builtin_function): New function.

	* gcc/langhooks.h (struct lang_hooks): Change the signature of
	builtin_function.
	(add_builtin_function): New function.

	* gcc/treelang/treetree.c (builtin_function): Remove.

	* gcc/tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Replace
	calls to lang_hooks.builtin_function with add_builtin_function.

	* gcc/c-common.c (decl_builtin_1): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/alpha/alpha.c (alpha_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/frv/frv.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/s390/s390.c (s390_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/sparc/sparc.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/i386/i386.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.
	(def_builtin): Replace calls to lang_hooks.builtin_function with
	add_builtin_function.

	* gcc/config/sh/sh.c (sh_media_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/c4x/c4x.c (c4x_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/stormy16/stormy16.c (xstormy16_init_builtins):
	Replace calls to lang_hooks.builtin_function with
	add_builtin_function.

	* gcc/config/iq2000/iq2000.c (def_builtin):
	Replace calls to lang_hooks.builtin_function with
	add_builtin_function.

	* gcc/config/ia64/ia64.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/rs6000/rs6000.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.
	(altivec_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/arm/arm.c (def_mbuiltin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.
	(arm_init_tls_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/mips/mips.c (mips_init_builtins): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/config/bfin/bfin.c (def_builtin): Replace calls to
	lang_hooks.builtin_function with add_builtin_function.

	* gcc/langhooks-def.h (lhd_builtin_function): New function.
	(LANG_HOOKS_BUILTIN_FUNCTION): Define as lhd_builtin_function.

Attachment: builtin.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]