diff options
author | Jason Merrill <jason@casey.cygnus.com> | 2000-03-10 09:25:45 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-03-10 04:25:45 -0500 |
commit | 0c11ada67b89f4103c6c4abf680149bc3dee0959 (patch) | |
tree | 2abf6c15ae84cc0615afb845f3b88512998cf097 /gcc/cp/call.c | |
parent | c3ab7a40d76cac8bca2e4b9592321156557c7278 (diff) | |
download | gcc-0c11ada67b89f4103c6c4abf680149bc3dee0959.zip gcc-0c11ada67b89f4103c6c4abf680149bc3dee0959.tar.gz gcc-0c11ada67b89f4103c6c4abf680149bc3dee0959.tar.bz2 |
decl.c (push_overloaded_decl_1, [...]): Lose.
* decl.c (push_overloaded_decl_1, auto_function,
define_function): Lose.
(build_library_fn_1): New static fn.
(builtin_function): Use it.
(get_atexit_node): Use build_library_fn_ptr.
(build_library_fn, build_cp_library_fn, build_library_fn_ptr,
build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn,
push_void_library_fn, push_throw_library_fn): New fns.
* cp-tree.h: Declare them.
(cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID.
(throw_bad_cast_node, throw_bad_typeid_node): Lose.
* except.c (init_exception_processing, call_eh_info, do_pop_exception,
(expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns.
* rtti.c (build_runtime_decl): Lose.
(throw_bad_cast, throw_bad_typeid, get_tinfo_decl,
build_dynamic_cast_1, expand_si_desc, expand_class_desc,
expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns.
* call.c (build_call): Remove result_type parm.
Call mark_used on unused artificial fns.
* init.c, method.c, typeck.c, except.c, rtti.c: Adjust.
From-SVN: r32468
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e15d4f0..40cd43d 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -364,13 +364,14 @@ build_addr_func (function) (TYPE_PTRMEMFUNC_P) must be handled by our callers. */ tree -build_call (function, result_type, parms) - tree function, result_type, parms; +build_call (function, parms) + tree function, parms; { int is_constructor = 0; int nothrow; tree tmp; tree decl; + tree result_type; function = build_addr_func (function); @@ -380,6 +381,8 @@ build_call (function, result_type, parms) return error_mark_node; } + result_type = TREE_TYPE (TREE_TYPE (TREE_TYPE (function))); + if (TREE_CODE (function) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL) decl = TREE_OPERAND (function, 0); @@ -394,8 +397,14 @@ build_call (function, result_type, parms) if (decl && DECL_CONSTRUCTOR_P (decl)) is_constructor = 1; - if (decl) - my_friendly_assert (TREE_USED (decl), 990125); + if (decl && ! TREE_USED (decl)) + { + /* We invoke build_call directly for several library functions. */ + if (DECL_ARTIFICIAL (decl)) + mark_used (decl); + else + my_friendly_abort (990125); + } /* Don't pass empty class objects by value. This is useful for tags in STL, which are used to control overload resolution. @@ -4157,7 +4166,7 @@ build_over_call (cand, args, flags) return exp; } - fn = build_call (fn, TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))), converted_args); + fn = build_call (fn, converted_args); if (TREE_CODE (TREE_TYPE (fn)) == VOID_TYPE) return fn; fn = require_complete_type (fn); |