diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 00:22:25 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 00:22:25 +0000 |
commit | 9cfddb70e5959f3c656f6eb99cb737a63dc2a0c8 (patch) | |
tree | 4ed79a7176ee65e1fb619e14384a1bc2dd57d091 /gcc/ada | |
parent | 451528dcdf7cb40350106f4a010bf68bc6d83118 (diff) | |
download | gcc-9cfddb70e5959f3c656f6eb99cb737a63dc2a0c8.tar.gz |
* builtins.c (DEF_BUILTIN): Add COND argument.
* tree.h (DEF_BUILTIN): Likewise.
* builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN, DEF_EXT_LIB_BUILTIN,
DEF_C94_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN): Update to
match.
(DEF_BUILTIN_STUB): New.
(BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE, BUILT_IN_INIT_TRAMPOLINE,
BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO,
BUILT_IN_PROFILE_FUNC_ENTER, BUILT_IN_PROFILE_FUNC_EXIT): Use it.
* c-common.c (DEF_BUILTIN): Add COND argument.
* tree.c (local_define_builtin): New.
(build_common_builtin_nodes): New.
ada/
* utils.c (gnat_define_builtin): Remove.
(gnat_install_builtins): Use build_common_builtin_nodes.
fortran/
* f95-lang.c (gfc_init_builtin_functions): Call
build_common_builtin_nodes; do not define any functions handled
by it.
java/
* builtins.c (initialize_builtins): Call build_common_builtin_nodes.
* decl.c (java_init_decl_processing): Initialize const_ptr_type_node.
treelang/
* treetree.c (treelang_init_decl_processing): Call
build_common_builtin_nodes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94785 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/utils.c | 102 |
2 files changed, 7 insertions, 100 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a4adba5fda6..f6b7f6891ab 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2005-02-09 Richard Henderson <rth@redhat.com> + + * utils.c (gnat_define_builtin): Remove. + (gnat_install_builtins): Use build_common_builtin_nodes. + 2005-02-09 Arnaud Charlet <charlet@adacore.com> * a-rbtgso.adb, a-crbtgo.ads, a-crbtgo.adb, a-crbtgk.ads, diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index b92fe4bd7c6..4d4fad4ecad 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -118,7 +118,6 @@ struct language_function GTY(()) int unused; }; -static void gnat_define_builtin (const char *, tree, int, const char *, bool); static void gnat_install_builtins (void); static tree merge_sizes (tree, tree, tree, bool, bool); static tree compute_related_constant (tree, tree); @@ -405,110 +404,13 @@ gnat_init_decl_processing (void) gnat_install_builtins (); } -/* Define a builtin function. This is temporary and is just being done - to initialize *_built_in_decls for the middle-end. We'll want - to do full builtin processing soon. */ - -static void -gnat_define_builtin (const char *name, tree type, - int function_code, const char *library_name, bool const_p) -{ - 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); - gnat_pushdecl (decl, Empty); - DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL; - DECL_FUNCTION_CODE (decl) = function_code; - TREE_READONLY (decl) = const_p; - - implicit_built_in_decls[function_code] = decl; - built_in_decls[function_code] = decl; -} - /* Install the builtin functions the middle-end needs. */ static void gnat_install_builtins () { - tree ftype; - tree tmp; - - tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node); - tmp = tree_cons (NULL_TREE, long_integer_type_node, tmp); - ftype = build_function_type (long_integer_type_node, tmp); - gnat_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT, - "__builtin_expect", true); - - tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - ftype = build_function_type (ptr_void_type_node, tmp); - gnat_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY, - "memcpy", false); - - tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - ftype = build_function_type (integer_type_node, tmp); - gnat_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP, - "memcmp", false); - - tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); - tmp = tree_cons (NULL_TREE, integer_type_node, tmp); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - ftype = build_function_type (integer_type_node, tmp); - gnat_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET, - "memset", false); - - tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node); - ftype = build_function_type (integer_type_node, tmp); - gnat_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ, "clz", true); - - tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node); - ftype = build_function_type (integer_type_node, tmp); - gnat_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL, "clzl", true); - - tmp = tree_cons (NULL_TREE, long_long_integer_type_node, void_list_node); - ftype = build_function_type (integer_type_node, tmp); - gnat_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL, "clzll", - true); - - /* The init_trampoline and adjust_trampoline builtins aren't used directly. - They are inserted during lowering of nested functions. */ - - tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp); - ftype = build_function_type (void_type_node, tmp); - gnat_define_builtin ("__builtin_init_trampoline", ftype, - BUILT_IN_INIT_TRAMPOLINE, "init_trampoline", false); - - tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node); - ftype = build_function_type (ptr_void_type_node, tmp); - gnat_define_builtin ("__builtin_adjust_trampoline", ftype, - BUILT_IN_ADJUST_TRAMPOLINE, "adjust_trampoline", true); - - /* The stack_save, stack_restore, and alloca builtins aren't used directly. - They are inserted during gimplification to implement variable sized stack - allocation. */ - - ftype = build_function_type (ptr_void_type_node, void_list_node); - gnat_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE, - "stack_save", false); - - tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node); - ftype = build_function_type (void_type_node, tmp); - gnat_define_builtin ("__builtin_stack_restore", ftype, - BUILT_IN_STACK_RESTORE, "stack_restore", false); - - tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); - ftype = build_function_type (ptr_void_type_node, tmp); - gnat_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA, - "alloca", false); + /* Builtins used by generic optimizers. */ + build_common_builtin_nodes (); /* Target specific builtins, such as the AltiVec family on ppc. */ targetm.init_builtins (); |