From: Joseph Myers Date: Sat, 17 Jul 2004 19:35:04 +0000 (+0100) Subject: langhooks.h (builtin_function): New langhook. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e34d3a39f0ce48e95a2853df4be8d01eb745850;p=gcc.git langhooks.h (builtin_function): New langhook. * langhooks.h (builtin_function): New langhook. * langhooks-def.h (LANG_HOOKS_BUILTIN_FUNCTION): New. (LANG_HOOKS_INITIALIZER): Update. * tree.h (builtin_function): Remove. * doc/tm.texi: Update. * c-tree.h (builtin_function): Declare. * c-common.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/frv/frv.c, config/i386/i386.c, config/ia64/ia64.c, config/iq2000/iq2000.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/stormy16/stormy16.c: All callers of builtin_function changed. ada: * gigi.h (builtin_function): Declare. cp: * cp-tree.h (builtin_function): Declare. fortran: * trans.h (builtin_function): Declare. java: * java-tree.h (builtin_function): Declare. From-SVN: r84878 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f90423bd73a..f71c9050dc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2004-07-17 Joseph S. Myers + + * langhooks.h (builtin_function): New langhook. + * langhooks-def.h (LANG_HOOKS_BUILTIN_FUNCTION): New. + (LANG_HOOKS_INITIALIZER): Update. + * tree.h (builtin_function): Remove. + * doc/tm.texi: Update. + * c-tree.h (builtin_function): Declare. + * c-common.c, config/alpha/alpha.c, config/arm/arm.c, + config/c4x/c4x.c, config/frv/frv.c, config/i386/i386.c, + config/ia64/ia64.c, config/iq2000/iq2000.c, + config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, + config/stormy16/stormy16.c: All callers of builtin_function + changed. + 2004-07-17 Andrew Pinski PR target/16556 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5b5a0e9eade..5af5ee31420 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2004-07-17 Joseph S. Myers + + * gigi.h (builtin_function): Declare. + 2004-07-15 Robert Dewar * makegpr.adb, s-secsta.ads, sem_ch3.adb, sem_case.adb: Minor diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index e63334189ad..78a2f2b6f73 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -693,6 +693,10 @@ extern tree fill_vms_descriptor (tree, Entity_Id); should not be allocated in a register. Return true if successful. */ extern bool gnat_mark_addressable (tree); +/* Implementation of the builtin_function langhook. */ +extern tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); + /* This function is called by the front end to enumerate all the supported modes for the machine. We pass a function which is called back with the following integer parameters: diff --git a/gcc/c-common.c b/gcc/c-common.c index e177d884b2b..cc743cc9da8 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3106,7 +3106,8 @@ c_common_nodes_and_builtins (void) abort (); \ \ if (!BOTH_P) \ - decl = builtin_function (NAME, builtin_types[TYPE], ENUM, \ + decl = lang_hooks.builtin_function (NAME, builtin_types[TYPE], \ + ENUM, \ CLASS, \ (FALLBACK_P \ ? (NAME + strlen ("__builtin_")) \ @@ -3214,12 +3215,14 @@ builtin_function_2 (const char *builtin_name, const char *name, tree decl = NULL_TREE; if (builtin_name != 0) - bdecl = builtin_function (builtin_name, builtin_type, function_code, - class, library_name_p ? name : NULL, attrs); + bdecl = lang_hooks.builtin_function (builtin_name, builtin_type, + function_code, class, + library_name_p ? name : NULL, attrs); if (name != 0 && !flag_no_builtin && !builtin_function_disabled_p (name) && !(nonansi_p && flag_no_nonansi_builtin)) - decl = builtin_function (name, type, function_code, class, NULL, attrs); + decl = lang_hooks.builtin_function (name, type, function_code, class, + NULL, attrs); return (bdecl != 0 ? bdecl : decl); } diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 5eb2e81e479..7cb69baf415 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -180,6 +180,8 @@ extern void c_pop_function_context (struct function *); extern void push_parm_decl (tree); extern tree pushdecl_top_level (tree); extern tree set_array_declarator_type (tree, tree, int); +extern tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); extern void shadow_tag (tree); extern void shadow_tag_warned (tree, int); extern tree start_enum (tree); diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index e10468b8eaf..102cbb1b2b9 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -6532,8 +6532,8 @@ alpha_init_builtins (void) p = zero_arg_builtins; for (i = 0; i < ARRAY_SIZE (zero_arg_builtins); ++i, ++p) if ((target_flags & p->target_mask) == p->target_mask) - builtin_function (p->name, ftype, p->code, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type_list (long_integer_type_node, long_integer_type_node, NULL_TREE); @@ -6541,8 +6541,8 @@ alpha_init_builtins (void) p = one_arg_builtins; for (i = 0; i < ARRAY_SIZE (one_arg_builtins); ++i, ++p) if ((target_flags & p->target_mask) == p->target_mask) - builtin_function (p->name, ftype, p->code, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type_list (long_integer_type_node, long_integer_type_node, @@ -6551,18 +6551,18 @@ alpha_init_builtins (void) p = two_arg_builtins; for (i = 0; i < ARRAY_SIZE (two_arg_builtins); ++i, ++p) if ((target_flags & p->target_mask) == p->target_mask) - builtin_function (p->name, ftype, p->code, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type (ptr_type_node, void_list_node); - builtin_function ("__builtin_thread_pointer", ftype, - ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_thread_pointer", ftype, + ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); - builtin_function ("__builtin_set_thread_pointer", ftype, - ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_set_thread_pointer", ftype, + ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); } /* Expand an expression EXP that calls a built-in function, diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 1de284e1d62..f342a802453 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -51,6 +51,7 @@ #include "target.h" #include "target-def.h" #include "debug.h" +#include "langhooks.h" /* Forward definitions of types. */ typedef struct minipool_node Mnode; @@ -11591,7 +11592,8 @@ arm_debugger_arg_offset (int value, rtx addr) do \ { \ if ((MASK) & insn_flags) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE); \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), \ + BUILT_IN_MD, NULL, NULL_TREE); \ } \ while (0) diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 4e6dd8f5484..4011a51591a 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. */ #include "tm_p.h" #include "target.h" #include "target-def.h" +#include "langhooks.h" rtx smulhi3_libfunc; rtx umulhi3_libfunc; @@ -4767,41 +4768,52 @@ c4x_init_builtins (void) { tree endlink = void_list_node; - builtin_function ("fast_ftoi", - build_function_type - (integer_type_node, - tree_cons (NULL_TREE, double_type_node, endlink)), - C4X_BUILTIN_FIX, BUILT_IN_MD, NULL, NULL_TREE); - builtin_function ("ansi_ftoi", - build_function_type - (integer_type_node, - tree_cons (NULL_TREE, double_type_node, endlink)), - C4X_BUILTIN_FIX_ANSI, BUILT_IN_MD, NULL, NULL_TREE); + lang_hooks.builtin_function ("fast_ftoi", + build_function_type + (integer_type_node, + tree_cons (NULL_TREE, double_type_node, + endlink)), + C4X_BUILTIN_FIX, BUILT_IN_MD, NULL, NULL_TREE); + lang_hooks.builtin_function ("ansi_ftoi", + build_function_type + (integer_type_node, + tree_cons (NULL_TREE, double_type_node, + endlink)), + C4X_BUILTIN_FIX_ANSI, BUILT_IN_MD, NULL, + NULL_TREE); if (TARGET_C3X) - builtin_function ("fast_imult", - build_function_type - (integer_type_node, - tree_cons (NULL_TREE, integer_type_node, - tree_cons (NULL_TREE, - integer_type_node, endlink))), - C4X_BUILTIN_MPYI, BUILT_IN_MD, NULL, NULL_TREE); + lang_hooks.builtin_function ("fast_imult", + build_function_type + (integer_type_node, + tree_cons (NULL_TREE, integer_type_node, + tree_cons (NULL_TREE, + integer_type_node, + endlink))), + C4X_BUILTIN_MPYI, BUILT_IN_MD, NULL, + NULL_TREE); else { - builtin_function ("toieee", - build_function_type - (double_type_node, - tree_cons (NULL_TREE, double_type_node, endlink)), - C4X_BUILTIN_TOIEEE, BUILT_IN_MD, NULL, NULL_TREE); - builtin_function ("frieee", - build_function_type - (double_type_node, - tree_cons (NULL_TREE, double_type_node, endlink)), - C4X_BUILTIN_FRIEEE, BUILT_IN_MD, NULL, NULL_TREE); - builtin_function ("fast_invf", - build_function_type - (double_type_node, - tree_cons (NULL_TREE, double_type_node, endlink)), - C4X_BUILTIN_RCPF, BUILT_IN_MD, NULL, NULL_TREE); + lang_hooks.builtin_function ("toieee", + build_function_type + (double_type_node, + tree_cons (NULL_TREE, double_type_node, + endlink)), + C4X_BUILTIN_TOIEEE, BUILT_IN_MD, NULL, + NULL_TREE); + lang_hooks.builtin_function ("frieee", + build_function_type + (double_type_node, + tree_cons (NULL_TREE, double_type_node, + endlink)), + C4X_BUILTIN_FRIEEE, BUILT_IN_MD, NULL, + NULL_TREE); + lang_hooks.builtin_function ("fast_invf", + build_function_type + (double_type_node, + tree_cons (NULL_TREE, double_type_node, + endlink)), + C4X_BUILTIN_RCPF, BUILT_IN_MD, NULL, + NULL_TREE); } } diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 5e4a12f5c4a..d9355408110 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. */ #include "target-def.h" #include "targhooks.h" #include "integrate.h" +#include "langhooks.h" #ifndef FRV_INLINE #define FRV_INLINE inline @@ -8888,7 +8889,7 @@ frv_pack_insns (void) #define def_builtin(name, type, code) \ - builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL) + lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL) struct builtin_description { diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 02af192d010..b8aa661fdaf 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12665,12 +12665,12 @@ x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) #endif } -#define def_builtin(MASK, NAME, TYPE, CODE) \ -do { \ - if ((MASK) & target_flags \ - && (!((MASK) & MASK_64BIT) || TARGET_64BIT)) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ - NULL, NULL_TREE); \ +#define def_builtin(MASK, NAME, TYPE, CODE) \ +do { \ + if ((MASK) & target_flags \ + && (!((MASK) & MASK_64BIT) || TARGET_64BIT)) \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ + NULL, NULL_TREE); \ } while (0) struct builtin_description diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 85ac56b1d7f..bee9720d443 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -8184,8 +8184,9 @@ ia64_init_builtins (void) (*lang_hooks.types.register_builtin_type) (long_double_type_node, "__float128"); -#define def_builtin(name, type, code) \ - builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL_TREE) +#define def_builtin(name, type, code) \ + lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, \ + NULL, NULL_TREE) def_builtin ("__sync_val_compare_and_swap_si", si_ftype_psi_si_si, IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI); diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 0e2f7c146f6..b2156d678a6 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA. */ #include "debug.h" #include "target.h" #include "target-def.h" +#include "langhooks.h" /* Enumeration for all of the relational tests, so that we can build arrays indexed by the test type, and not worry about the order @@ -2690,8 +2691,9 @@ iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p, return 0; } -#define def_builtin(NAME, TYPE, CODE) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE) +#define def_builtin(NAME, TYPE, CODE) \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ + NULL, NULL_TREE) static void iq2000_init_builtins (void) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b6ee8313b14..e81e1b37900 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5618,11 +5618,11 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) /* Builtins. */ -#define def_builtin(MASK, NAME, TYPE, CODE) \ -do { \ - if ((MASK) & target_flags) \ - builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ - NULL, NULL_TREE); \ +#define def_builtin(MASK, NAME, TYPE, CODE) \ +do { \ + if ((MASK) & target_flags) \ + lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ + NULL, NULL_TREE); \ } while (0) /* Simple ternary operations: VECd = foo (VECa, VECb, VECc). */ diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index cde728a4a3a..9de035051e2 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6802,14 +6802,14 @@ s390_init_builtins (void) tree ftype; ftype = build_function_type (ptr_type_node, void_list_node); - builtin_function ("__builtin_thread_pointer", ftype, - S390_BUILTIN_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_thread_pointer", ftype, + S390_BUILTIN_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); - builtin_function ("__builtin_set_thread_pointer", ftype, - S390_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function ("__builtin_set_thread_pointer", ftype, + S390_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); } /* Expand an expression EXP that calls a built-in function, diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7f99cab4ab6..d8e3e610f95 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -9291,8 +9291,8 @@ sh_media_init_builtins (void) if (signature < SH_BLTIN_NUM_SHARED_SIGNATURES) shared[signature] = type; } - builtin_function (d->name, type, d - bdesc, BUILT_IN_MD, - NULL, NULL_TREE); + lang_hooks.builtin_function (d->name, type, d - bdesc, BUILT_IN_MD, + NULL, NULL_TREE); } } diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 7f2a2feb7fe..a5ee896ee56 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -2109,9 +2109,9 @@ xstormy16_init_builtins (void) else args = tree_cons (NULL_TREE, arg, args); } - builtin_function (s16builtins[i].name, - build_function_type (ret_type, args), - i, BUILT_IN_MD, NULL, NULL); + lang_hooks.builtin_function (s16builtins[i].name, + build_function_type (ret_type, args), + i, BUILT_IN_MD, NULL, NULL); } } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a67bfc37713..1e0bec12ccb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-17 Joseph S. Myers + + * cp-tree.h (builtin_function): Declare. + 2004-07-16 Mark Mitchell * class.c (finish_struct_methods): Remove unncessary code. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index a7d35d46ecd..7ed1d5f0de4 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3763,6 +3763,8 @@ extern tree declare_global_var (tree, tree); extern void register_dtor_fn (tree); extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); +extern tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); extern tree check_elaborated_type_specifier (enum tag_types, tree, bool); extern void warn_extern_redeclared_static (tree, tree); extern bool cp_missing_noreturn_ok_p (tree); diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 30c58d6511e..ca5c9955287 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -9110,7 +9110,8 @@ instructions that would otherwise not normally be generated because they have no equivalent in the source language (for example, SIMD vector instructions or prefetch instructions). -To create a built-in function, call the function @code{builtin_function} +To create a built-in function, call the function +@code{lang_hooks.builtin_function} which is defined by the language front end. You can use any type nodes set up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2}; only language front ends that use those two functions will call diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 925b45c45d4..819d7357fea 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2004-07-17 Joseph S. Myers + + * trans.h (builtin_function): Declare. + 2004-07-16 Tobias Schlueter PR fortran/16404 diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index fe8db4e370d..9d6473486c2 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -427,6 +427,8 @@ void pushlevel (int); tree poplevel (int, int, int); tree getdecls (void); tree gfc_truthvalue_conversion (tree); +tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); /* Runtime library function decls. */ extern GTY(()) tree gfor_fndecl_internal_malloc; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 5cd390e2dfc..f06412333cb 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2004-07-17 Joseph S. Myers + + * java-tree.h (builtin_function): Declare. + 2004-07-16 Steven Bosscher * parse.y (java_complete_expand_methods, java_expand_classes): Don't diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 89599764c89..5f33ec5a54d 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -1355,6 +1355,8 @@ extern void gen_indirect_dispatch_tables (tree type); extern int split_qualified_name (tree *left, tree *right, tree source); extern int in_same_package (tree, tree); +extern tree builtin_function (const char *, tree, int, enum built_in_class, + const char *, tree); #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL) diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index ae8dcd2ef95..1f7f32c6b76 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -126,6 +126,7 @@ extern int lhd_gimplify_expr (tree *, tree *, tree *); #define LANG_HOOKS_EXPR_SIZE lhd_expr_size #define LANG_HOOKS_TREE_SIZE lhd_tree_size #define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p +#define LANG_HOOKS_BUILTIN_FUNCTION builtin_function #define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f #define LANG_HOOKS_FUNCTION_FINAL lhd_do_nothing_f @@ -301,6 +302,7 @@ extern tree lhd_make_node (enum tree_code); LANG_HOOKS_FOR_TYPES_INITIALIZER, \ LANG_HOOKS_GIMPLIFY_EXPR, \ LANG_HOOKS_FOLD_OBJ_TYPE_REF, \ + LANG_HOOKS_BUILTIN_FUNCTION, \ } #endif /* GCC_LANG_HOOKS_DEF_H */ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 345e89c5047..349c450a0cd 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -407,6 +407,18 @@ struct lang_hooks KNOWN_TYPE carries the true type of the OBJ_TYPE_REF_OBJECT. */ tree (*fold_obj_type_ref) (tree, tree); + /* Return a definition for a builtin function named NAME and whose data type + is TYPE. TYPE should be a function type with argument types. + FUNCTION_CODE tells later passes how to compile calls to this function. + See tree.h for its possible values. + + If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME, + the name to be called if we can't opencode the function. If + ATTRS is nonzero, use that for the function's attribute list. */ + tree (*builtin_function) (const char *name, tree type, int function_code, + enum built_in_class class, + const char *library_name, tree attrs); + /* Whenever you add entries here, make sure you adjust langhooks-def.h and langhooks.c accordingly. */ }; diff --git a/gcc/tree.h b/gcc/tree.h index 0c308686b61..31e117312fa 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3306,11 +3306,6 @@ extern GTY(()) tree current_function_func_begin_label; chain of FILE_DECLs; currently only C uses it. */ extern GTY(()) tree current_file_decl; - -/* Declare a predefined function. Return the declaration. This function is - provided by each language frontend. */ -extern tree builtin_function (const char *, tree, int, enum built_in_class, - const char *, tree); /* In tree.c */ extern unsigned crc32_string (unsigned, const char *);