aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog56
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/gigi.h4
-rw-r--r--gcc/ada/misc.c2
-rw-r--r--gcc/ada/utils.c28
-rw-r--r--gcc/c-common.c10
-rw-r--r--gcc/c-decl.c31
-rw-r--r--gcc/c-objc-common.h2
-rw-r--r--gcc/c-tree.h3
-rw-r--r--gcc/config/alpha/alpha.c24
-rw-r--r--gcc/config/arm/arm.c10
-rw-r--r--gcc/config/bfin/bfin.c4
-rw-r--r--gcc/config/c4x/c4x.c86
-rw-r--r--gcc/config/frv/frv.c2
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/ia64/ia64.c4
-rw-r--r--gcc/config/iq2000/iq2000.c4
-rw-r--r--gcc/config/mips/mips.c6
-rw-r--r--gcc/config/rs6000/rs6000.c16
-rw-r--r--gcc/config/s390/s390.c12
-rw-r--r--gcc/config/sh/sh.c4
-rw-r--r--gcc/config/sparc/sparc.c4
-rw-r--r--gcc/config/stormy16/stormy16.c6
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c7
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/decl.c86
-rw-r--r--gcc/fortran/ChangeLog12
-rw-r--r--gcc/fortran/Make-lang.in4
-rw-r--r--gcc/fortran/f95-lang.c40
-rw-r--r--gcc/fortran/trans.h3
-rw-r--r--gcc/java/ChangeLog10
-rw-r--r--gcc/java/Make-lang.in6
-rw-r--r--gcc/java/decl.c203
-rw-r--r--gcc/java/java-tree.h3
-rw-r--r--gcc/langhooks-def.h3
-rw-r--r--gcc/langhooks.c38
-rw-r--r--gcc/langhooks.h17
-rw-r--r--gcc/objc/ChangeLog9
-rw-r--r--gcc/objc/objc-act.c106
-rw-r--r--gcc/objcp/ChangeLog4
-rw-r--r--gcc/objcp/objcp-decl.h2
-rw-r--r--gcc/tree-ssa-loop-prefetch.c6
-rw-r--r--gcc/tree.c4
-rw-r--r--gcc/treelang/ChangeLog4
-rw-r--r--gcc/treelang/treetree.c39
48 files changed, 466 insertions, 495 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a6400a..30ae215 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,59 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * tree.c (local_define_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * c-objc-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
+ c_builtin_function.
+ * c-tree.h (builtin_function): Rename to c_builtin_function. Change
+ the signature.
+ * c-decl.c (builtin_function): Rename to c_builtin_function. Move
+ common code to add_builtin_function.
+ * langhooks.c (add_builtin_function): New function.
+ (lhd_builtin_function): New function.
+ * langhooks.h (struct lang_hooks): Change the signature of
+ builtin_function.
+ (add_builtin_function): New function.
+ * tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Replace
+ calls to lang_hooks.builtin_function with add_builtin_function.
+ * c-common.c (decl_builtin_1): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/alpha/alpha.c (alpha_init_builtins): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/frv/frv.c (def_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/s390/s390.c (s390_init_builtins): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/sparc/sparc.c (def_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/i386/i386.c (def_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/sh/sh.c (sh_media_init_builtins): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/c4x/c4x.c (c4x_init_builtins): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/stormy16/stormy16.c (xstormy16_init_builtins):
+ Replace calls to lang_hooks.builtin_function with
+ add_builtin_function.
+ * config/iq2000/iq2000.c (def_builtin):
+ Replace calls to lang_hooks.builtin_function with
+ add_builtin_function.
+ * config/ia64/ia64.c (def_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * 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.
+ * 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.
+ * config/mips/mips.c (mips_init_builtins): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * config/bfin/bfin.c (def_builtin): Replace calls to
+ lang_hooks.builtin_function with add_builtin_function.
+ * langhooks-def.h (lhd_builtin_function): New function.
+ (LANG_HOOKS_BUILTIN_FUNCTION): Define as lhd_builtin_function.
+
2006-10-23 Jakub Jelinek <jakub@redhat.com>
* builtins.c (expand_builtin, maybe_emit_chk_warning): Handle
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 771100a..3d3aaef 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+ * utils.c (builtin_function): Rename to gnat_builtin_function.
+ Move common code to add_builtin_function.
+ * misc.c (LANG_HOOKS_BUILTIN_FUNCTION): Define as
+ gnat_builtin_function.
+ * gigi.h (builtin_function): Rename to gnat_builtin_function.
+ Change the signature.
+
2006-10-16 Brooks Moses <bmoses@stanford.edu>
* Makefile.in: Add TEXI2PDF definition.
diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h
index 43d46f6..10a7012 100644
--- a/gcc/ada/gigi.h
+++ b/gcc/ada/gigi.h
@@ -764,9 +764,7 @@ extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal);
extern bool gnat_mark_addressable (tree expr_node);
/* Implementation of the builtin_function langhook. */
-extern tree builtin_function (const char *name, tree type, int function_code,
- enum built_in_class class,
- const char *library_name, tree attrs);
+extern tree gnat_builtin_function (tree decl);
/* Search the chain of currently reachable declarations for a builtin
FUNCTION_DECL node corresponding to function NAME (an IDENTIFIER_NODE).
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 11bd27b..748621a1 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -163,6 +163,8 @@ static tree gnat_type_max_size (tree);
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE gnat_signed_or_unsigned_type
#undef LANG_HOOKS_ATTRIBUTE_TABLE
#define LANG_HOOKS_ATTRIBUTE_TABLE gnat_internal_attribute_table
+#undef LANG_HOOKS_BUILTIN_FUNCTION
+#define LANG_HOOKS_BUILTIN_FUNCTION gnat_builtin_function
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 8d02d3f..5d4f9ed 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -1821,37 +1821,11 @@ gnat_gimplify_function (tree fndecl)
gnat_gimplify_function (cgn->decl);
}
-/* 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 attribute list. */
tree
-builtin_function (const char *name, tree type, int function_code,
- enum built_in_class class, const char *library_name,
- tree attrs)
+gnat_builtin_function (tree decl)
{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
-
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
-
gnat_pushdecl (decl, Empty);
- DECL_BUILT_IN_CLASS (decl) = class;
- DECL_FUNCTION_CODE (decl) = function_code;
-
- /* Possibly apply some default attributes to this built-in function. */
- if (attrs)
- decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
- else
- decl_attributes (&decl, NULL_TREE, 0);
-
return decl;
}
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 62d5261e5..e51de2d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3495,14 +3495,14 @@ def_builtin_1 (enum built_in_function fncode,
strlen ("__builtin_")));
libname = name + strlen ("__builtin_");
- decl = lang_hooks.builtin_function (name, fntype, fncode, fnclass,
- (fallback_p ? libname : NULL),
- fnattrs);
+ decl = add_builtin_function (name, fntype, fncode, fnclass,
+ (fallback_p ? libname : NULL),
+ fnattrs);
if (both_p
&& !flag_no_builtin && !builtin_function_disabled_p (libname)
&& !(nonansi_p && flag_no_nonansi_builtin))
- lang_hooks.builtin_function (libname, libtype, fncode, fnclass,
- NULL, fnattrs);
+ add_builtin_function (libname, libtype, fncode, fnclass,
+ NULL, fnattrs);
built_in_decls[(int) fncode] = decl;
if (implicit_p)
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4b3ee62..e740fca 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2812,30 +2812,15 @@ c_make_fname_decl (tree id, int type_dep)
return decl;
}
-/* 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 cl, const char *library_name,
- tree attrs)
+c_builtin_function (tree decl)
{
- tree id = get_identifier (name);
- tree decl = build_decl (FUNCTION_DECL, id, type);
- TREE_PUBLIC (decl) = 1;
- DECL_EXTERNAL (decl) = 1;
+ tree type = TREE_TYPE (decl);
+ tree id = DECL_NAME (decl);
+
+ const char *name = IDENTIFIER_POINTER (id);
DECL_LANG_SPECIFIC (decl) = GGC_CNEW (struct lang_decl);
- DECL_BUILT_IN_CLASS (decl) = cl;
- DECL_FUNCTION_CODE (decl) = function_code;
C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0);
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
/* Should never be called on a symbol with a preexisting meaning. */
gcc_assert (!I_SYMBOL_BINDING (id));
@@ -2850,12 +2835,6 @@ builtin_function (const char *name, tree type, int function_code,
visible_builtins = decl;
}
- /* Possibly apply some default attributes to this built-in function. */
- if (attrs)
- decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
- else
- decl_attributes (&decl, NULL_TREE, 0);
-
return decl;
}
diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h
index 49f9ce4..f3f0867 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -74,6 +74,8 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
+#undef LANG_HOOKS_BUILTIN_FUNCTION
+#define LANG_HOOKS_BUILTIN_FUNCTION c_builtin_function
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 79579b0..4bc4928 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -474,8 +474,7 @@ extern void push_parm_decl (const struct c_parm *);
extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
struct c_declarator *,
bool);
-extern tree builtin_function (const char *, tree, int, enum built_in_class,
- const char *, tree);
+extern tree c_builtin_function (tree);
extern void shadow_tag (const struct c_declspecs *);
extern void shadow_tag_warned (const struct c_declspecs *, int);
extern tree start_enum (tree);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 0b3da82..88fed92 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -6523,8 +6523,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)
- lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
- NULL, attrs[p->is_const]);
+ add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+ NULL, attrs[p->is_const]);
ftype = build_function_type_list (dimode_integer_type_node,
dimode_integer_type_node, NULL_TREE);
@@ -6532,8 +6532,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)
- lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
- NULL, attrs[p->is_const]);
+ add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+ NULL, attrs[p->is_const]);
ftype = build_function_type_list (dimode_integer_type_node,
dimode_integer_type_node,
@@ -6542,18 +6542,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)
- lang_hooks.builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
- NULL, attrs[p->is_const]);
+ add_builtin_function (p->name, ftype, p->code, BUILT_IN_MD,
+ NULL, attrs[p->is_const]);
ftype = build_function_type (ptr_type_node, void_list_node);
- lang_hooks.builtin_function ("__builtin_thread_pointer", ftype,
- ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
- NULL, attrs[0]);
+ add_builtin_function ("__builtin_thread_pointer", ftype,
+ ALPHA_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
+ NULL, attrs[0]);
ftype = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
- lang_hooks.builtin_function ("__builtin_set_thread_pointer", ftype,
- ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD,
- NULL, attrs[0]);
+ add_builtin_function ("__builtin_set_thread_pointer", ftype,
+ ALPHA_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD,
+ NULL, attrs[0]);
alpha_v8qi_u = build_vector_type (unsigned_intQI_type_node, 8);
alpha_v8qi_s = build_vector_type (intQI_type_node, 8);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d6f11be..1d646c7 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12060,8 +12060,8 @@ arm_debugger_arg_offset (int value, rtx addr)
do \
{ \
if ((MASK) & insn_flags) \
- lang_hooks.builtin_function ((NAME), (TYPE), (CODE), \
- BUILT_IN_MD, NULL, NULL_TREE); \
+ add_builtin_function ((NAME), (TYPE), (CODE), \
+ BUILT_IN_MD, NULL, NULL_TREE); \
} \
while (0)
@@ -12533,9 +12533,9 @@ arm_init_tls_builtins (void)
tree const_nothrow = tree_cons (get_identifier ("const"), NULL, nothrow);
ftype = build_function_type (ptr_type_node, void_list_node);
- lang_hooks.builtin_function ("__builtin_thread_pointer", ftype,
- ARM_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
- NULL, const_nothrow);
+ add_builtin_function ("__builtin_thread_pointer", ftype,
+ ARM_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
+ NULL, const_nothrow);
}
static void
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index f7cf020..fd056a2 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3915,8 +3915,8 @@ enum bfin_builtins
#define def_builtin(NAME, TYPE, CODE) \
do { \
- lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
- NULL, NULL_TREE); \
+ add_builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
+ NULL, NULL_TREE); \
} while (0)
/* Set up all builtin functions for this target. */
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 3757523..6e831c7 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -4339,52 +4339,52 @@ c4x_init_builtins (void)
{
tree endlink = void_list_node;
- 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);
+ add_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);
+ add_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)
- 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);
+ add_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
{
- 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);
+ add_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);
+ add_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);
+ add_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 82b7cbf..d7e0613 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -8148,7 +8148,7 @@ frv_reorg (void)
}
#define def_builtin(name, type, code) \
- lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL)
+ add_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 d72120c..d3223a4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -14536,8 +14536,8 @@ enum ix86_builtins
do { \
if ((MASK) & target_flags \
&& (!((MASK) & MASK_64BIT) || TARGET_64BIT)) \
- lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
- NULL, NULL_TREE); \
+ add_builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
+ NULL, NULL_TREE); \
} while (0)
/* Bits for builtin_description.flag. */
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 8a98b24..418f9a1 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -9114,8 +9114,8 @@ ia64_init_builtins (void)
"__float128");
#define def_builtin(name, type, code) \
- lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, \
- NULL, NULL_TREE)
+ add_builtin_function ((name), (type), (code), BUILT_IN_MD, \
+ NULL, NULL_TREE)
def_builtin ("__builtin_ia64_bsp",
build_function_type (ptr_type_node, void_list_node),
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 4b1cb3e..42b7c176 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -2436,8 +2436,8 @@ iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p,
}
#define def_builtin(NAME, TYPE, CODE) \
- lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
- NULL, NULL_TREE)
+ add_builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
+ NULL, NULL_TREE)
static void
iq2000_init_builtins (void)
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 05498c2..ea5ec26 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -10603,9 +10603,9 @@ mips_init_builtins (void)
if (m->proc == PROCESSOR_MAX || (m->proc == mips_arch))
for (d = m->bdesc; d < &m->bdesc[m->size]; d++)
if ((d->target_flags & target_flags) == d->target_flags)
- lang_hooks.builtin_function (d->name, types[d->function_type],
- d - m->bdesc + offset,
- BUILT_IN_MD, NULL, NULL);
+ add_builtin_function (d->name, types[d->function_type],
+ d - m->bdesc + offset,
+ BUILT_IN_MD, NULL, NULL);
offset += m->size;
}
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d8d0db1..5d4b889 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -6053,8 +6053,8 @@ def_builtin (int mask, const char *name, tree type, int code)
abort ();
rs6000_builtin_decls[code] =
- lang_hooks.builtin_function (name, type, code, BUILT_IN_MD,
- NULL, NULL_TREE);
+ add_builtin_function (name, type, code, BUILT_IN_MD,
+ NULL, NULL_TREE);
}
}
@@ -8578,12 +8578,12 @@ altivec_init_builtins (void)
/* Initialize target builtin that implements
targetm.vectorize.builtin_mask_for_load. */
- decl = lang_hooks.builtin_function ("__builtin_altivec_mask_for_load",
- v16qi_ftype_long_pcvoid,
- ALTIVEC_BUILTIN_MASK_FOR_LOAD,
- BUILT_IN_MD, NULL,
- tree_cons (get_identifier ("const"),
- NULL_TREE, NULL_TREE));
+ decl = add_builtin_function ("__builtin_altivec_mask_for_load",
+ v16qi_ftype_long_pcvoid,
+ ALTIVEC_BUILTIN_MASK_FOR_LOAD,
+ BUILT_IN_MD, NULL,
+ tree_cons (get_identifier ("const"),
+ NULL_TREE, NULL_TREE));
/* Record the decl. Will be used by rs6000_builtin_mask_for_load. */
altivec_builtin_mask_for_load = decl;
}
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index b6aeee1..3fd3638 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -8169,14 +8169,14 @@ s390_init_builtins (void)
tree ftype;
ftype = build_function_type (ptr_type_node, void_list_node);
- lang_hooks.builtin_function ("__builtin_thread_pointer", ftype,
- S390_BUILTIN_THREAD_POINTER, BUILT_IN_MD,
- NULL, NULL_TREE);
+ add_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);
- lang_hooks.builtin_function ("__builtin_set_thread_pointer", ftype,
- S390_BUILTIN_SET_THREAD_POINTER, BUILT_IN_MD,
- NULL, NULL_TREE);
+ add_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 65b2daa1..30b8748 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -9476,8 +9476,8 @@ sh_media_init_builtins (void)
if (signature < SH_BLTIN_NUM_SHARED_SIGNATURES)
shared[signature] = type;
}
- lang_hooks.builtin_function (d->name, type, d - bdesc, BUILT_IN_MD,
- NULL, NULL_TREE);
+ add_builtin_function (d->name, type, d - bdesc, BUILT_IN_MD,
+ NULL, NULL_TREE);
}
}
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 692e46e..7ee5bcd 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -7868,8 +7868,8 @@ sparc_init_libfuncs (void)
}
#define def_builtin(NAME, CODE, TYPE) \
- lang_hooks.builtin_function((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, \
- NULL_TREE)
+ add_builtin_function((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, \
+ NULL_TREE)
/* Implement the TARGET_INIT_BUILTINS target hook.
Create builtin functions for special SPARC instructions. */
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 32513d2..04617f5 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -2334,9 +2334,9 @@ xstormy16_init_builtins (void)
else
args = tree_cons (NULL_TREE, arg, args);
}
- lang_hooks.builtin_function (s16builtins[i].name,
- build_function_type (ret_type, args),
- i, BUILT_IN_MD, NULL, NULL);
+ add_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 0e6314c..0ea7e09 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,18 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * decl.c (builtin_function_1): Move common code to
+ add_builtin_function.
+ (builtin_function): Rename to cxx_builtin_function.
+ Change the signature.
+ * call.c: Include langhooks.h.
+ (build_java_interface_fn_ref): Replace calls to
+ builtin_function with add_builtin_function.
+ * Make-lang.in (cp/call.o): Depend on langhooks.h.
+ * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as
+ cxx_builtin_function.
+ * cp-tree.h (builtin_function): Rename to cxx_builtin_function.
+ Change the signature.
+
2006-10-22 Nathan Sidwell <nathan@codesourcery.com>
PR c++/20647
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index c9ebbed..db095ce 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -250,7 +250,7 @@ cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \
cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \
$(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H)
cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \
- $(EXPR_H) $(DIAGNOSTIC_H) intl.h gt-cp-call.h convert.h $(TARGET_H)
+ $(EXPR_H) $(DIAGNOSTIC_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) toplev.h \
$(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 7a6646f..79a2c4a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -39,6 +39,7 @@ Boston, MA 02110-1301, USA. */
#include "intl.h"
#include "target.h"
#include "convert.h"
+#include "langhooks.h"
/* The various kinds of conversion. */
@@ -5065,9 +5066,9 @@ build_java_interface_fn_ref (tree fn, tree instance)
tree_cons (NULL_TREE, java_int_type_node,
endlink)));
java_iface_lookup_fn
- = builtin_function ("_Jv_LookupInterfaceMethodIdx",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_LookupInterfaceMethodIdx",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
}
/* Look up the pointer to the runtime java.lang.Class object for `instance'.
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index f420d93..5424d77 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -87,6 +87,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
#undef LANG_HOOKS_COMDAT_GROUP
#define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group
+#undef LANG_HOOKS_BUILTIN_FUNCTION
+#define LANG_HOOKS_BUILTIN_FUNCTION cxx_builtin_function
#undef LANG_HOOKS_FUNCTION_INIT
#define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 43b0202..a8fa8a7 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3942,11 +3942,7 @@ extern int nonstatic_local_decl_p (tree);
extern tree 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 *name, tree type,
- int code,
- enum built_in_class cl,
- const char *libname,
- tree attrs);
+extern tree cxx_builtin_function (tree decl);
extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
extern void warn_extern_redeclared_static (tree, tree);
extern const char *cxx_comdat_group (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a2a650d..17b209a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -64,10 +64,7 @@ static tree grok_reference_init (tree, tree, tree, tree *);
static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *,
int, int, tree);
static void record_unknown_type (tree, const char *);
-static tree builtin_function_1 (const char *, tree, tree,
- enum built_in_function code,
- enum built_in_class cl, const char *,
- tree);
+static tree builtin_function_1 (tree, tree);
static tree build_library_fn_1 (tree, enum tree_code, tree);
static int member_function_or_else (tree, tree, enum overload_flags);
static void bad_specifiers (tree, const char *, int, int, int, int,
@@ -3359,90 +3356,55 @@ cp_make_fname_decl (tree id, int type_dep)
return decl;
}
-/* Make a definition for a builtin function named NAME in the current
- namespace, whose data type is TYPE and whose context is CONTEXT.
- TYPE should be a function type with argument types.
+static tree
+builtin_function_1 (tree decl, tree context)
+{
+ tree id = DECL_NAME (decl);
+ const char *name = IDENTIFIER_POINTER (id);
- CLASS and CODE tell later passes how to compile calls to this function.
- See tree.h for possible values.
+ retrofit_lang_decl (decl);
- If LIBNAME 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. */
+ /* All nesting of C++ functions is lexical; there is never a "static
+ chain" in the sense of GNU C nested functions. */
+ DECL_NO_STATIC_CHAIN (decl) = 1;
+
+ DECL_ARTIFICIAL (decl) = 1;
+ SET_OVERLOADED_OPERATOR_CODE (decl, ERROR_MARK);
+ SET_DECL_LANGUAGE (decl, lang_c);
+ /* Runtime library routines are, by definition, available in an
+ external shared object. */
+ DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
+ DECL_VISIBILITY_SPECIFIED (decl) = 1;
-static tree
-builtin_function_1 (const char* name,
- tree type,
- tree context,
- enum built_in_function code,
- enum built_in_class class,
- const char* libname,
- tree attrs)
-{
- tree decl = build_library_fn_1 (get_identifier (name), ERROR_MARK, type);
- DECL_BUILT_IN_CLASS (decl) = class;
- DECL_FUNCTION_CODE (decl) = code;
DECL_CONTEXT (decl) = context;
pushdecl (decl);
- /* Since `pushdecl' relies on DECL_ASSEMBLER_NAME instead of DECL_NAME,
- we cannot change DECL_ASSEMBLER_NAME until we have installed this
- function in the namespace. */
- if (libname)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname));
-
/* A function in the user's namespace should have an explicit
declaration before it is used. Mark the built-in function as
anticipated but not actually declared. */
if (name[0] != '_' || name[1] != '_')
DECL_ANTICIPATED (decl) = 1;
- /* Possibly apply some default attributes to this built-in function. */
- if (attrs)
- decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
- else
- decl_attributes (&decl, NULL_TREE, 0);
-
return decl;
}
-/* Entry point for the benefit of c_common_nodes_and_builtins.
-
- Make a definition for a builtin function named NAME and whose data type
- is TYPE. TYPE should be a function type with argument types. This
- function places the anticipated declaration in the global namespace
- and additionally in the std namespace if appropriate.
-
- CLASS and CODE tell later passes how to compile calls to this function.
- See tree.h for possible values.
-
- If LIBNAME 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 code,
- enum built_in_class cl,
- const char* libname,
- tree attrs)
+cxx_builtin_function (tree decl)
{
+ tree id = DECL_NAME (decl);
+ const char *name = IDENTIFIER_POINTER (id);
+ tree decl2 = copy_node(decl);
/* All builtins that don't begin with an '_' should additionally
go in the 'std' namespace. */
if (name[0] != '_')
{
push_namespace (std_identifier);
- builtin_function_1 (name, type, std_node, code, cl, libname, attrs);
+ builtin_function_1 (decl, std_node);
pop_namespace ();
}
- return builtin_function_1 (name, type, NULL_TREE, code,
- cl, libname, attrs);
+ return builtin_function_1 (decl2, NULL_TREE);
}
/* Generate a FUNCTION_DECL with the typical flags for a runtime library
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 53b7b30..630ffe0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,15 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * Make-lang.in (f951$(exeext)): Depend on and link with attribs.o.
+ * trans.h (builtin_function): Rename to gfc_builtin_function.
+ Change the signature.
+ * 95-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.
+
2006-10-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/26025
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index cc38e69..f99f0be 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -102,9 +102,9 @@ gfortran-cross$(exeext): gfortran$(exeext)
# The compiler itself is called f951.
f951$(exeext): $(F95_OBJS) \
- $(BACKEND) $(LIBDEPS)
+ $(BACKEND) $(LIBDEPS) attribs.o
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(F95_OBJS) $(BACKEND) $(LIBS)
+ $(F95_OBJS) $(BACKEND) $(LIBS) attribs.o
gt-fortran-trans.h : s-gtype; @true
#
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index fb626f7..263d6ee 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -124,6 +124,7 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
#undef LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR
#undef LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE
#undef LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES
+#undef LANG_HOOKS_BUILTIN_FUNCTION
/* Define lang hooks. */
#define LANG_HOOKS_NAME "GNU F95"
@@ -150,6 +151,7 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
#define LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE gfc_omp_private_debug_clause
#define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES \
gfc_omp_firstprivatize_type_sizes
+#define LANG_HOOKS_BUILTIN_FUNCTION gfc_builtin_function
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -723,43 +725,11 @@ int ggc_p = 1;
/* Builtin function initialization. */
-/* 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)
+gfc_builtin_function (tree decl)
{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
make_decl_rtl (decl);
pushdecl (decl);
- DECL_BUILT_IN_CLASS (decl) = class;
- DECL_FUNCTION_CODE (decl) = function_code;
-
- /* Possibly apply some default attributes to this built-in function. */
- if (attrs)
- {
- /* FORNOW the only supported attribute is "const". If others need
- to be supported then see the more general solution in procedure
- builtin_function in c-decl.c */
- if (lookup_attribute ( "const", attrs ))
- TREE_READONLY (decl) = 1;
- }
-
return decl;
}
@@ -773,8 +743,8 @@ gfc_define_builtin (const char * name,
{
tree decl;
- decl = builtin_function (name, type, code, BUILT_IN_NORMAL,
- library_name, NULL_TREE);
+ decl = add_builtin_function (name, type, code, BUILT_IN_NORMAL,
+ library_name, NULL_TREE);
if (const_p)
TREE_READONLY (decl) = 1;
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index e8bb1d5..f471f09 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -446,8 +446,7 @@ 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);
+tree gfc_builtin_function (tree);
/* In trans-openmp.c */
bool gfc_omp_privatize_by_reference (tree);
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index fd245ed..d171343 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,13 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * decl.c: Include langhooks.h.
+ (builtin_function): Remove.
+ (java_init_decl_processing): Replace calls to builtin_function
+ with add_builtin_function.
+ * Make-lang.in (jc1$(exeext)): Depend on and link with attribs.o.
+ (java/decl.o): Depend on langhooks.h.
+ * java-tree.h (builtin_function): Remove.
+
2006-10-10 Brooks Moses <bmoses@stanford.edu>
* Make-lang.in: Added "java.pdf", "gcj.pdf" target support.
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index e773271..d054053 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -131,10 +131,10 @@ jvspec.o-warn = -Wno-error
java/parse-scan.o-warn = -Wno-error
java/parse.o-warn = -Wno-error
-jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS)
+jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS) attribs.o
rm -f $@
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBICONV) $(LIBS)
+ $(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBICONV) $(LIBS) attribs.o
gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS)
rm -f $@
@@ -310,7 +310,7 @@ java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
toplev.h $(FLAGS_H) $(SYSTEM_H) coretypes.h $(TM_H) $(FUNCTION_H) $(EXPR_H) \
libfuncs.h except.h java/java-except.h $(GGC_H) $(REAL_H) gt-java-decl.h \
- $(TARGET_H) $(CGRAPH_H)
+ $(TARGET_H) $(CGRAPH_H) langhooks.h
java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \
$(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(FUNCTION_H)
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 4fcc6c0..912f854 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -49,6 +49,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "target.h"
#include "version.h"
#include "tree-iterator.h"
+#include "langhooks.h"
#if defined (DEBUG_JAVA_BINDING_LEVELS)
extern void indent (void);
@@ -465,34 +466,6 @@ push_promoted_type (const char *name, tree actual_type)
return type;
}
-/* 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 cl,
- const char *library_name,
- tree ARG_UNUSED (attrs))
-{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
- pushdecl (decl);
- DECL_BUILT_IN_CLASS (decl) = cl;
- DECL_FUNCTION_CODE (decl) = function_code;
- return decl;
-}
-
/* Return tree that represents a vtable for a primitive array. */
static tree
create_primitive_vtable (const char *name)
@@ -942,50 +915,50 @@ java_init_decl_processing (void)
endlink = end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
t = tree_cons (NULL_TREE, class_ptr_type, endlink);
- alloc_object_node = builtin_function ("_Jv_AllocObject",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ alloc_object_node = add_builtin_function ("_Jv_AllocObject",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (alloc_object_node) = 1;
- alloc_no_finalizer_node =
- builtin_function ("_Jv_AllocObjectNoFinalizer",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ alloc_no_finalizer_node =
+ add_builtin_function ("_Jv_AllocObjectNoFinalizer",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (alloc_no_finalizer_node) = 1;
t = tree_cons (NULL_TREE, ptr_type_node, endlink);
- soft_initclass_node = builtin_function ("_Jv_InitClass",
- build_function_type (void_type_node,
- t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ soft_initclass_node = add_builtin_function ("_Jv_InitClass",
+ build_function_type (void_type_node,
+ t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, class_ptr_type,
tree_cons (NULL_TREE, int_type_node, endlink));
- soft_resolvepoolentry_node
- = builtin_function ("_Jv_ResolvePoolEntry",
- build_function_type (ptr_type_node, t),
- 0,NOT_BUILT_IN, NULL, NULL_TREE);
+ soft_resolvepoolentry_node
+ = add_builtin_function ("_Jv_ResolvePoolEntry",
+ build_function_type (ptr_type_node, t),
+ 0,NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_PURE (soft_resolvepoolentry_node) = 1;
- throw_node = builtin_function ("_Jv_Throw",
- build_function_type (void_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ throw_node = add_builtin_function ("_Jv_Throw",
+ build_function_type (void_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark throw_nodes as `noreturn' functions with side effects. */
TREE_THIS_VOLATILE (throw_node) = 1;
TREE_SIDE_EFFECTS (throw_node) = 1;
t = build_function_type (void_type_node, tree_cons (NULL_TREE, ptr_type_node,
endlink));
- soft_monitorenter_node
- = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- soft_monitorexit_node
- = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
-
- t = tree_cons (NULL_TREE, ptr_type_node,
+ soft_monitorenter_node
+ = add_builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ soft_monitorexit_node
+ = add_builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_newarray_node
- = builtin_function ("_Jv_NewPrimArray",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_NewPrimArray",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_newarray_node) = 1;
t = tree_cons (NULL_TREE, int_type_node,
@@ -993,9 +966,9 @@ java_init_decl_processing (void)
tree_cons (NULL_TREE, object_ptr_type_node,
endlink)));
soft_anewarray_node
- = builtin_function ("_Jv_NewObjectArray",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_NewObjectArray",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_anewarray_node) = 1;
/* There is no endlink here because _Jv_NewMultiArray is a varargs
@@ -1003,43 +976,43 @@ java_init_decl_processing (void)
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, int_type_node, NULL_TREE));
soft_multianewarray_node
- = builtin_function ("_Jv_NewMultiArray",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_NewMultiArray",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_MALLOC (soft_multianewarray_node) = 1;
t = build_function_type (void_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_badarrayindex_node
- = builtin_function ("_Jv_ThrowBadArrayIndex", t,
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_ThrowBadArrayIndex", t,
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_badarrayindex_node as a `noreturn' function with side
effects. */
TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1;
TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1;
soft_nullpointer_node
- = builtin_function ("_Jv_ThrowNullPointerException",
- build_function_type (void_type_node, endlink),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_ThrowNullPointerException",
+ build_function_type (void_type_node, endlink),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_nullpointer_node as a `noreturn' function with side
effects. */
TREE_THIS_VOLATILE (soft_nullpointer_node) = 1;
TREE_SIDE_EFFECTS (soft_nullpointer_node) = 1;
soft_abstractmethod_node
- = builtin_function ("_Jv_ThrowAbstractMethodError",
- build_function_type (void_type_node, endlink),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_ThrowAbstractMethodError",
+ build_function_type (void_type_node, endlink),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_abstractmethod_node as a `noreturn' function with side
effects. */
TREE_THIS_VOLATILE (soft_abstractmethod_node) = 1;
TREE_SIDE_EFFECTS (soft_abstractmethod_node) = 1;
soft_nosuchfield_node
- = builtin_function ("_Jv_ThrowNoSuchFieldError",
- build_function_type (void_type_node, endlink),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_ThrowNoSuchFieldError",
+ build_function_type (void_type_node, endlink),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Mark soft_nosuchfield_node as a `noreturn' function with side
effects. */
TREE_THIS_VOLATILE (soft_nosuchfield_node) = 1;
@@ -1048,85 +1021,85 @@ java_init_decl_processing (void)
t = tree_cons (NULL_TREE, class_ptr_type,
tree_cons (NULL_TREE, object_ptr_type_node, endlink));
soft_checkcast_node
- = builtin_function ("_Jv_CheckCast",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_CheckCast",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node,
tree_cons (NULL_TREE, class_ptr_type, endlink));
soft_instanceof_node
- = builtin_function ("_Jv_IsInstanceOf",
- build_function_type (boolean_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_IsInstanceOf",
+ build_function_type (boolean_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_PURE (soft_instanceof_node) = 1;
t = tree_cons (NULL_TREE, object_ptr_type_node,
tree_cons (NULL_TREE, object_ptr_type_node, endlink));
soft_checkarraystore_node
- = builtin_function ("_Jv_CheckArrayStore",
- build_function_type (void_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_CheckArrayStore",
+ build_function_type (void_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, int_type_node, endlink)));
- soft_lookupinterfacemethod_node
- = builtin_function ("_Jv_LookupInterfaceMethodIdx",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ soft_lookupinterfacemethod_node
+ = add_builtin_function ("_Jv_LookupInterfaceMethodIdx",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
DECL_IS_PURE (soft_lookupinterfacemethod_node) = 1;
t = tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink)));
- soft_lookupinterfacemethodbyname_node
- = builtin_function ("_Jv_LookupInterfaceMethod",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ soft_lookupinterfacemethodbyname_node
+ = add_builtin_function ("_Jv_LookupInterfaceMethod",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE, int_type_node,
endlink))));
soft_lookupjnimethod_node
- = builtin_function ("_Jv_LookupJNIMethod",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_LookupJNIMethod",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, ptr_type_node, endlink);
soft_getjnienvnewframe_node
- = builtin_function ("_Jv_GetJNIEnvNewFrame",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_GetJNIEnvNewFrame",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
soft_jnipopsystemframe_node
- = builtin_function ("_Jv_JNI_PopSystemFrame",
- build_function_type (void_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_JNI_PopSystemFrame",
+ build_function_type (void_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, object_ptr_type_node, endlink);
soft_unwrapjni_node
- = builtin_function ("_Jv_UnwrapJNIweakReference",
- build_function_type (object_ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_UnwrapJNIweakReference",
+ build_function_type (object_ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, int_type_node,
tree_cons (NULL_TREE, int_type_node, endlink));
soft_idiv_node
- = builtin_function ("_Jv_divI",
- build_function_type (int_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_divI",
+ build_function_type (int_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
soft_irem_node
- = builtin_function ("_Jv_remI",
- build_function_type (int_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_remI",
+ build_function_type (int_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
t = tree_cons (NULL_TREE, long_type_node,
tree_cons (NULL_TREE, long_type_node, endlink));
soft_ldiv_node
- = builtin_function ("_Jv_divJ",
- build_function_type (long_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_divJ",
+ build_function_type (long_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
soft_lrem_node
- = builtin_function ("_Jv_remJ",
- build_function_type (long_type_node, t),
- 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function ("_Jv_remJ",
+ build_function_type (long_type_node, t),
+ 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* Initialize variables for except.c. */
eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index f347869..a064ab0 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1402,9 +1402,6 @@ 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)
/* Access flags etc for a method (a FUNCTION_DECL): */
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index eae7c92..73b716a 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -71,6 +71,7 @@ extern tree lhd_expr_size (tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
extern tree lhd_expr_to_decl (tree, bool *, bool *, bool *);
+extern tree lhd_builtin_function (tree decl);
/* Declarations of default tree inlining hooks. */
extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
@@ -130,7 +131,7 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#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_BUILTIN_FUNCTION lhd_builtin_function
#define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl
#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset
#define LANG_HOOKS_INIT_TS lhd_do_nothing
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 4c736d0..4f61d11 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -588,3 +588,41 @@ lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED,
tree t ATTRIBUTE_UNUSED)
{
}
+
+tree
+add_builtin_function (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs)
+{
+ tree id = get_identifier (name);
+ tree decl = build_decl (FUNCTION_DECL, id, type);
+
+ TREE_PUBLIC (decl) = 1;
+ DECL_EXTERNAL (decl) = 1;
+ DECL_BUILT_IN_CLASS (decl) = cl;
+ DECL_FUNCTION_CODE (decl) = function_code;
+
+ if (library_name) {
+ tree libname = get_identifier (library_name);
+ SET_DECL_ASSEMBLER_NAME (decl, libname);
+ }
+
+ /* Possibly apply some default attributes to this built-in function. */
+ if (attrs)
+ decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
+ else
+ decl_attributes (&decl, NULL_TREE, 0);
+
+ return lang_hooks.builtin_function (decl);
+
+}
+
+tree
+lhd_builtin_function (tree decl)
+{
+ lang_hooks.decls.pushdecl (decl);
+ return decl;
+}
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index e614893..4f789f1 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -443,17 +443,8 @@ 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 bt_class,
- const char *library_name, tree attrs);
+ /* Do language specific processing in the builtin function DECL */
+ tree (*builtin_function) (tree decl);
/* Used to set up the tree_contains_structure array for a frontend. */
void (*init_ts) (void);
@@ -470,5 +461,9 @@ struct lang_hooks
/* Each front end provides its own. */
extern const struct lang_hooks lang_hooks;
+extern tree add_builtin_function (const char *name, tree type,
+ int function_code, enum built_in_class cl,
+ const char *library_name,
+ tree attrs);
#endif /* GCC_LANG_HOOKS_H */
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 76c56fb..c0605d0 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * 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.
+
2006-10-10 Brooks Moses <bmoses@stanford.edu>
* Make-lang.in: Added empty "objc.pdf" target.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 1d3513b..ab0f34a 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1616,18 +1616,18 @@ synth_module_prologue (void)
tree_cons (NULL_TREE, objc_object_type,
tree_cons (NULL_TREE, objc_selector_type,
NULL_TREE)));
- umsg_decl = builtin_function (TAG_MSGSEND,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_nonnil_decl = builtin_function (TAG_MSGSEND_NONNIL,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_stret_decl = builtin_function (TAG_MSGSEND_STRET,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_nonnil_stret_decl = builtin_function (TAG_MSGSEND_NONNIL_STRET,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ umsg_decl = add_builtin_function (TAG_MSGSEND,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ umsg_nonnil_decl = add_builtin_function (TAG_MSGSEND_NONNIL,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ umsg_stret_decl = add_builtin_function (TAG_MSGSEND_STRET,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ umsg_nonnil_stret_decl = add_builtin_function (TAG_MSGSEND_NONNIL_STRET,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
/* These can throw, because the function that gets called can throw
in Obj-C++, or could itself call something that can throw even
@@ -1640,9 +1640,9 @@ synth_module_prologue (void)
/* id objc_msgSend_Fast (id, SEL, ...)
__attribute__ ((hard_coded_address (OFFS_MSGSEND_FAST))); */
#ifdef OFFS_MSGSEND_FAST
- umsg_fast_decl = builtin_function (TAG_MSGSEND_FAST,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ umsg_fast_decl = add_builtin_function (TAG_MSGSEND_FAST,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
TREE_NOTHROW (umsg_fast_decl) = 0;
DECL_ATTRIBUTES (umsg_fast_decl)
= tree_cons (get_identifier ("hard_coded_address"),
@@ -1660,12 +1660,12 @@ synth_module_prologue (void)
tree_cons (NULL_TREE, objc_super_type,
tree_cons (NULL_TREE, objc_selector_type,
NULL_TREE)));
- umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_super_stret_decl = builtin_function (TAG_MSGSENDSUPER_STRET,
- type, 0, NOT_BUILT_IN, 0,
- NULL_TREE);
+ umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ umsg_super_stret_decl = add_builtin_function (TAG_MSGSENDSUPER_STRET,
+ type, 0, NOT_BUILT_IN, 0,
+ NULL_TREE);
TREE_NOTHROW (umsg_super_decl) = 0;
TREE_NOTHROW (umsg_super_stret_decl) = 0;
}
@@ -1687,9 +1687,9 @@ synth_module_prologue (void)
tree_cons (NULL_TREE, objc_object_type,
tree_cons (NULL_TREE, objc_selector_type,
OBJC_VOID_AT_END)));
- umsg_decl = builtin_function (TAG_MSGSEND,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ umsg_decl = add_builtin_function (TAG_MSGSEND,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
TREE_NOTHROW (umsg_decl) = 0;
/* IMP objc_msg_lookup_super (struct objc_super *, SEL); */
@@ -1698,9 +1698,9 @@ synth_module_prologue (void)
tree_cons (NULL_TREE, objc_super_type,
tree_cons (NULL_TREE, objc_selector_type,
OBJC_VOID_AT_END)));
- umsg_super_decl = builtin_function (TAG_MSGSENDSUPER,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
TREE_NOTHROW (umsg_super_decl) = 0;
/* The following GNU runtime entry point is called to initialize
@@ -1711,9 +1711,9 @@ synth_module_prologue (void)
= build_function_type (void_type_node,
tree_cons (NULL_TREE, ptr_type_node,
OBJC_VOID_AT_END));
- execclass_decl = builtin_function (TAG_EXECCLASS,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ execclass_decl = add_builtin_function (TAG_EXECCLASS,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
}
/* id objc_getClass (const char *); */
@@ -1724,13 +1724,13 @@ synth_module_prologue (void)
OBJC_VOID_AT_END));
objc_get_class_decl
- = builtin_function (TAG_GETCLASS, type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ = add_builtin_function (TAG_GETCLASS, type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
/* id objc_getMetaClass (const char *); */
objc_get_meta_class_decl
- = builtin_function (TAG_GETMETACLASS, type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_GETMETACLASS, type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
build_class_template ();
build_super_template ();
@@ -3994,7 +3994,7 @@ build_next_objc_exception_stuff (void)
'int _setjmp(jmp_buf);' */
temp_type = build_function_type (integer_type_node, NULL_TREE);
objc_setjmp_decl
- = builtin_function (TAG_SETJMP, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_SETJMP, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
/* id objc_exception_extract(struct _objc_exception_data *); */
temp_type
@@ -4003,7 +4003,8 @@ build_next_objc_exception_stuff (void)
build_pointer_type (objc_exception_data_template),
OBJC_VOID_AT_END));
objc_exception_extract_decl
- = builtin_function (TAG_EXCEPTIONEXTRACT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_EXCEPTIONEXTRACT, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
/* void objc_exception_try_enter(struct _objc_exception_data *); */
/* void objc_exception_try_exit(struct _objc_exception_data *); */
temp_type
@@ -4012,9 +4013,11 @@ build_next_objc_exception_stuff (void)
build_pointer_type (objc_exception_data_template),
OBJC_VOID_AT_END));
objc_exception_try_enter_decl
- = builtin_function (TAG_EXCEPTIONTRYENTER, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_EXCEPTIONTRYENTER, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
objc_exception_try_exit_decl
- = builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
/* int objc_exception_match(id, id); */
temp_type
@@ -4023,7 +4026,8 @@ build_next_objc_exception_stuff (void)
tree_cons (NULL_TREE, objc_object_type,
OBJC_VOID_AT_END)));
objc_exception_match_decl
- = builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
/* id objc_assign_ivar (id, id, unsigned int); */
/* id objc_assign_ivar_Fast (id, id, unsigned int)
@@ -4037,12 +4041,12 @@ build_next_objc_exception_stuff (void)
unsigned_type_node,
OBJC_VOID_AT_END))));
objc_assign_ivar_decl
- = builtin_function (TAG_ASSIGNIVAR, temp_type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
+ = add_builtin_function (TAG_ASSIGNIVAR, temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
#ifdef OFFS_ASSIGNIVAR_FAST
objc_assign_ivar_fast_decl
- = builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0,
- NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0,
+ NOT_BUILT_IN, NULL, NULL_TREE);
DECL_ATTRIBUTES (objc_assign_ivar_fast_decl)
= tree_cons (get_identifier ("hard_coded_address"),
build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST),
@@ -4059,9 +4063,11 @@ build_next_objc_exception_stuff (void)
tree_cons (NULL_TREE, build_pointer_type (objc_object_type),
OBJC_VOID_AT_END)));
objc_assign_global_decl
- = builtin_function (TAG_ASSIGNGLOBAL, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_ASSIGNGLOBAL, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
objc_assign_strong_cast_decl
- = builtin_function (TAG_ASSIGNSTRONGCAST, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ = add_builtin_function (TAG_ASSIGNSTRONGCAST, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
}
static void
@@ -4079,14 +4085,14 @@ build_objc_exception_stuff (void)
tree_cons (NULL_TREE, objc_object_type,
OBJC_VOID_AT_END));
objc_exception_throw_decl
- = builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL,
- noreturn_list);
+ = add_builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL,
+ noreturn_list);
objc_sync_enter_decl
- = builtin_function (TAG_SYNCENTER, temp_type, 0, NOT_BUILT_IN,
- NULL, nothrow_list);
+ = add_builtin_function (TAG_SYNCENTER, temp_type, 0, NOT_BUILT_IN,
+ NULL, nothrow_list);
objc_sync_exit_decl
- = builtin_function (TAG_SYNCEXIT, temp_type, 0, NOT_BUILT_IN,
- NULL, nothrow_list);
+ = add_builtin_function (TAG_SYNCEXIT, temp_type, 0, NOT_BUILT_IN,
+ NULL, nothrow_list);
}
/* Construct a C struct corresponding to ObjC class CLASS, with the same
diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog
index b0c8452..86a0600 100644
--- a/gcc/objcp/ChangeLog
+++ b/gcc/objcp/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * objcp-decl.h (objcp_builtin_function): Remove.
+
2006-10-10 Brooks Moses <bmoses@stanford.edu>
* Make-lang.in: Added empty "obj-c++.pdf" target.
diff --git a/gcc/objcp/objcp-decl.h b/gcc/objcp/objcp-decl.h
index 2882179..dd32ccc 100644
--- a/gcc/objcp/objcp-decl.h
+++ b/gcc/objcp/objcp-decl.h
@@ -29,8 +29,6 @@ extern void objcp_finish_function (void);
extern tree objcp_build_function_call (tree, tree);
extern tree objcp_xref_tag (enum tree_code, tree);
extern int objcp_comptypes (tree, tree);
-extern tree objcp_builtin_function (const char *, tree, int,
- enum built_in_class, const char *, tree);
extern tree objcp_begin_compound_stmt (int);
extern tree objcp_end_compound_stmt (tree, int);
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index f9fe2d30..30d7dce 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -1034,9 +1034,9 @@ tree_ssa_prefetch_arrays (struct loops *loops)
tree_cons (NULL_TREE,
const_ptr_type_node,
NULL_TREE));
- tree decl = lang_hooks.builtin_function ("__builtin_prefetch", type,
- BUILT_IN_PREFETCH, BUILT_IN_NORMAL,
- NULL, NULL_TREE);
+ tree decl = add_builtin_function ("__builtin_prefetch", type,
+ BUILT_IN_PREFETCH, BUILT_IN_NORMAL,
+ NULL, NULL_TREE);
DECL_IS_NOVOPS (decl) = true;
built_in_decls[BUILT_IN_PREFETCH] = decl;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 916d058..8f869fa 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6635,8 +6635,8 @@ local_define_builtin (const char *name, tree type, enum built_in_function code,
{
tree decl;
- decl = lang_hooks.builtin_function (name, type, code, BUILT_IN_NORMAL,
- library_name, NULL_TREE);
+ decl = add_builtin_function (name, type, code, BUILT_IN_NORMAL,
+ library_name, NULL_TREE);
if (ecf_flags & ECF_CONST)
TREE_READONLY (decl) = 1;
if (ecf_flags & ECF_PURE)
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index bc17fb4..1b4a941 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
+
+ * treetree.c (builtin_function): Remove.
+
2006-10-10 Brooks Moses <bmoses@stanford.edu>
* Make-lang.in: Added "treelang.pdf" target support.
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index 98c3694..aade17c 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -138,10 +138,6 @@ static tree pushdecl (tree decl);
static tree* getstmtlist (void);
/* Langhooks. */
-static tree builtin_function (const char *name, tree type, int function_code,
- enum built_in_class class,
- const char *library_name,
- tree attrs);
extern const struct attribute_spec treelang_attribute_table[];
static tree getdecls (void);
static int global_bindings_p (void);
@@ -1224,41 +1220,6 @@ const struct attribute_spec treelang_attribute_table[] =
{ NULL, 0, 0, false, false, false, NULL },
};
-/* 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.
-
- copied from gcc/c-decl.c
-*/
-
-static tree
-builtin_function (const char *name, tree type, int function_code,
- enum built_in_class class, const char *library_name,
- tree attrs)
-{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
- pushdecl (decl);
- DECL_BUILT_IN_CLASS (decl) = class;
- DECL_FUNCTION_CODE (decl) = function_code;
-
- /* Possibly apply some default attributes to this built-in function. */
- if (attrs)
- decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
- else
- decl_attributes (&decl, NULL_TREE, 0);
-
- return decl;
-}
-
/* Treelang expand function langhook. */
static void