summaryrefslogtreecommitdiffstats
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-27 17:59:33 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-27 17:59:33 +0000
commitb4df430b603946f5cbb26e59231df8cf2bab711a (patch)
tree799c8fedd2cb98c51cb9c5f72999b3cc368ee8ca /gcc/cp/call.c
parent0f999733f8eb93c315f4a61664066a28bb9252a0 (diff)
downloadppe42-gcc-b4df430b603946f5cbb26e59231df8cf2bab711a.tar.gz
ppe42-gcc-b4df430b603946f5cbb26e59231df8cf2bab711a.zip
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable. (direct_reference_binding, merge_conversion_sequences, build_user_type_conversion_1, perform_overload_resolution, build_op_delete_call, enforce_access, call_builtin_trap, build_over_call, build_special_member_call, build_new_method_call, initialize_reference): Likewise. * class.c (build_base_path, build_primary_vtable, alter_access, check_bases, update_vtable_entry_for_fn, layout_empty_base, clone_function_decl, adjust_clone_args, type_requires_array_cookie, include_empty_classes, finish_struct_1, resolve_address_of_overloaded_function, instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, accumulate_vtbl_inits, build_vtbl_initializer, build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise. * cvt.c (build_up_reference, convert_to_reference): Likewise. * decl.c (poplevel, duplicate_decls, make_typename_type, cxx_init_decl_processing, reshape_init, check_initializer, make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl, expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type, grokdeclarator, copy_fn_p, grok_op_properties, xref_tag, xref_basetypes, start_preparsed_function, save_function_data, finish_function, finish_method, maybe_register_incomplete_var, complete_vars): Likewise. * decl2.c (grok_array_decl, check_member_template, check_classfn, finish_static_data_member_decl, coerce_new_type, coerce_delete_type, import_export_class, decl_needed_p, determine_visibility, import_export_decl, build_cleanup, start_static_initialization_or_destructi, do_static_destruction, prune_vars_needing_no_initialization, build_offset_ref_call_from_tree): Likewise. * error.c (dump_decl, dump_expr): Likewise. * init.c (finish_init_stmts, build_zero_init, expand_virtual_init, expand_default_init, expand_aggr_init_1, build_offset_ref, build_new_1, build_delete, build_vbase_delete): Likewise. * mangle.c (write_method_parms, write_template_args, write_expression, write_template_arg): Likewise. * method.c (make_thunk, finish_thunk, use_thunk): Likewise. * name-lookup.c (pop_binding, begin_scope, leave_scope, resume_scope, push_using_decl, validate_nonmember_using_decl, is_ancestor, poplevel_class, set_inherited_value_binding_p, push_class_level_binding, do_class_using_decl, push_namespace, pop_namespace, add_using_namespace, ambiguous_decl, lookup_namespace_name, lookup_type_current_level, maybe_process_template_type_declaration): Likewise. * parser.c (cp_lexer_peek_nth_token, cp_parser_parse_and_diagnose_invalid_typ, cp_parser_translation_unit, cp_parser_template_id, cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise. * pt.c (push_access_scope, finish_member_template_decl, push_inline_template_parms_recursive, add_outermost_template_args, get_innermost_template_args, begin_explicit_instantiation, end_explicit_instantiation, retrieve_specialization, is_specialization_of, is_specialization_of_friend, register_specialization, check_explicit_specialization, comp_template_parms, process_template_parm, process_partial_specialization, convert_nontype_argument, coerce_template_template_parms, coerce_template_parms, mangle_class_name_for_template, lookup_template_function, lookup_template_class, instantiate_class_template, tsubst_decl, tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy, instantiate_template, fn_type_unification, type_unification_real, get_template_base, regenerate_decl_from_template, template_for_substitution, instantiate_decl, get_mostly_instantiated_function_type, dependent_scope_ref_p, value_dependent_expression_p, resolve_typename_type): Likewise. * repo.c (repo_emit_p): Likewise. * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init, create_tinfo_types, emit_tinfo_decl): Likewise. * search.c (lookup_base_r, lookup_base, lookup_field_1, dfs_access_in_type, build_baselink, lookup_member, adjust_result_of_qualified_name_lookup, copied_binfo): Likewise. * semantics.c (perform_or_defer_access_check, finish_non_static_data_member, finish_stmt_expr_expr, finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr, finish_template_template_parm, finish_member_declaration, emit_associated_thunks): Likewise. * tree.c (build_target_expr_with_type, force_target_expr, copy_binfo, get_first_fn, cp_tree_equal): Likewise. * typeck.c (type_after_usual_arithmetic_conversions, comptypes, cxx_sizeof_or_alignof_type, perform_integral_promotions, build_class_member_access_expr, finish_class_member_access_expr, build_ptrmemfunc_access_expr, build_unary_op, unary_complex_lvalue, cxx_mark_addressable, build_modify_expr, build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr * typeck2.c (complete_type_check_abstract, abstract_virtuals_error, process_init_constructor, add_exception_specifier): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86669 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c82
1 files changed, 38 insertions, 44 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 6ebe9e24e23..07aea66308b 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -497,9 +497,8 @@ void
validate_conversion_obstack (void)
{
if (conversion_obstack_initialized)
- my_friendly_assert ((obstack_next_free (&conversion_obstack)
- == obstack_base (&conversion_obstack)),
- 20040208);
+ gcc_assert ((obstack_next_free (&conversion_obstack)
+ == obstack_base (&conversion_obstack)));
}
#endif /* ENABLE_CHECKING */
@@ -1033,8 +1032,8 @@ direct_reference_binding (tree type, conversion *conv)
{
tree t;
- my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 20030306);
- my_friendly_assert (TREE_CODE (conv->type) != REFERENCE_TYPE, 20030306);
+ gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
+ gcc_assert (TREE_CODE (conv->type) != REFERENCE_TYPE);
t = TREE_TYPE (type);
@@ -2464,7 +2463,7 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq)
{
conversion **t;
- my_friendly_assert (user_seq->kind == ck_user, 20030306);
+ gcc_assert (user_seq->kind == ck_user);
/* Find the end of the second conversion sequence. */
t = &(std_seq);
@@ -2501,8 +2500,8 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
/* We represent conversion within a hierarchy using RVALUE_CONV and
BASE_CONV, as specified by [over.best.ics]; these become plain
constructor calls, as specified in [dcl.init]. */
- my_friendly_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
- || !DERIVED_FROM_P (totype, fromtype), 20011226);
+ gcc_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
+ || !DERIVED_FROM_P (totype, fromtype));
if (IS_AGGR_TYPE (totype))
ctors = lookup_fnfields (totype, complete_ctor_identifier, 0);
@@ -2523,9 +2522,8 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
args = build_tree_list (NULL_TREE, expr);
/* We should never try to call the abstract or base constructor
from here. */
- my_friendly_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
- && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)),
- 20011226);
+ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
+ && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)));
args = tree_cons (NULL_TREE, t, args);
}
for (; ctors; ctors = OVL_NEXT (ctors))
@@ -2718,13 +2716,11 @@ perform_overload_resolution (tree fn,
*any_viable_p = true;
/* Check FN and ARGS. */
- my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL
- || TREE_CODE (fn) == TEMPLATE_DECL
- || TREE_CODE (fn) == OVERLOAD
- || TREE_CODE (fn) == TEMPLATE_ID_EXPR,
- 20020712);
- my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST,
- 20020712);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
+ || TREE_CODE (fn) == TEMPLATE_DECL
+ || TREE_CODE (fn) == OVERLOAD
+ || TREE_CODE (fn) == TEMPLATE_ID_EXPR);
+ gcc_assert (!args || TREE_CODE (args) == TREE_LIST);
if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
{
@@ -3960,7 +3956,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
call_expr = placement;
/* Extract the function. */
alloc_fn = get_callee_fndecl (call_expr);
- my_friendly_assert (alloc_fn != NULL_TREE, 20020327);
+ gcc_assert (alloc_fn != NULL_TREE);
/* Then the second parm type. */
argtypes = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (alloc_fn)));
/* Also the second argument. */
@@ -4068,7 +4064,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
bool
enforce_access (tree basetype_path, tree decl)
{
- my_friendly_assert (TREE_CODE (basetype_path) == TREE_BINFO, 20030624);
+ gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO);
if (!accessible_p (basetype_path, decl))
{
@@ -4356,7 +4352,7 @@ call_builtin_trap (void)
{
tree fn = implicit_built_in_decls[BUILT_IN_TRAP];
- my_friendly_assert (fn != NULL, 20030927);
+ gcc_assert (fn != NULL);
fn = build_call (fn, NULL_TREE);
return fn;
}
@@ -4682,9 +4678,9 @@ build_over_call (struct z_candidate *cand, int flags)
So we can assume that anything passed as 'this' is non-null, and
optimize accordingly. */
- my_friendly_assert (TREE_CODE (parmtype) == POINTER_TYPE, 19990811);
+ gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE);
/* Convert to the base in which the function was declared. */
- my_friendly_assert (cand->conversion_path != NULL_TREE, 20020730);
+ gcc_assert (cand->conversion_path != NULL_TREE);
converted_arg = build_base_path (PLUS_EXPR,
TREE_VALUE (arg),
cand->conversion_path,
@@ -4851,7 +4847,7 @@ build_over_call (struct z_candidate *cand, int flags)
tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (*p)),
DECL_CONTEXT (fn),
ba_any, NULL);
- my_friendly_assert (binfo && binfo != error_mark_node, 20010730);
+ gcc_assert (binfo && binfo != error_mark_node);
*p = build_base_path (PLUS_EXPR, *p, binfo, 1);
if (TREE_SIDE_EFFECTS (*p))
@@ -5012,13 +5008,12 @@ build_special_member_call (tree instance, tree name, tree args,
/* The type of the subobject to be constructed or destroyed. */
tree class_type;
- my_friendly_assert (name == complete_ctor_identifier
- || name == base_ctor_identifier
- || name == complete_dtor_identifier
- || name == base_dtor_identifier
- || name == deleting_dtor_identifier
- || name == ansi_assopname (NOP_EXPR),
- 20020712);
+ gcc_assert (name == complete_ctor_identifier
+ || name == base_ctor_identifier
+ || name == complete_dtor_identifier
+ || name == base_dtor_identifier
+ || name == deleting_dtor_identifier
+ || name == ansi_assopname (NOP_EXPR));
if (TYPE_P (binfo))
{
/* Resolve the name. */
@@ -5028,7 +5023,7 @@ build_special_member_call (tree instance, tree name, tree args,
binfo = TYPE_BINFO (binfo);
}
- my_friendly_assert (binfo != NULL_TREE, 20020712);
+ gcc_assert (binfo != NULL_TREE);
class_type = BINFO_TYPE (binfo);
@@ -5043,7 +5038,7 @@ build_special_member_call (tree instance, tree name, tree args,
if (name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier)
- my_friendly_assert (args == NULL_TREE, 20020712);
+ gcc_assert (args == NULL_TREE);
/* Convert to the base class, if necessary. */
if (!same_type_ignoring_top_level_qualifiers_p
@@ -5064,7 +5059,7 @@ build_special_member_call (tree instance, tree name, tree args,
}
}
- my_friendly_assert (instance != NULL_TREE, 20020712);
+ gcc_assert (instance != NULL_TREE);
fns = lookup_fnfields (binfo, name, 1);
@@ -5088,7 +5083,7 @@ build_special_member_call (tree instance, tree name, tree args,
current_in_charge_parm, integer_zero_node),
current_vtt_parm,
vtt);
- my_friendly_assert (BINFO_SUBVTT_INDEX (binfo), 20010110);
+ gcc_assert (BINFO_SUBVTT_INDEX (binfo));
sub_vtt = build2 (PLUS_EXPR, TREE_TYPE (vtt), vtt,
BINFO_SUBVTT_INDEX (binfo));
@@ -5169,7 +5164,7 @@ build_new_method_call (tree instance, tree fns, tree args,
tree orig_args;
void *p;
- my_friendly_assert (instance != NULL_TREE, 20020729);
+ gcc_assert (instance != NULL_TREE);
if (error_operand_p (instance)
|| error_operand_p (fns)
@@ -5220,10 +5215,9 @@ build_new_method_call (tree instance, tree fns, tree args,
template_only = 1;
}
- my_friendly_assert (TREE_CODE (fns) == FUNCTION_DECL
- || TREE_CODE (fns) == TEMPLATE_DECL
- || TREE_CODE (fns) == OVERLOAD,
- 20020712);
+ gcc_assert (TREE_CODE (fns) == FUNCTION_DECL
+ || TREE_CODE (fns) == TEMPLATE_DECL
+ || TREE_CODE (fns) == OVERLOAD);
/* XXX this should be handled before we get here. */
if (! IS_AGGR_TYPE (basetype))
@@ -5242,9 +5236,9 @@ build_new_method_call (tree instance, tree fns, tree args,
{
/* Callers should explicitly indicate whether they want to construct
the complete object or just the part without virtual bases. */
- my_friendly_assert (name != ctor_identifier, 20000408);
+ gcc_assert (name != ctor_identifier);
/* Similarly for destructors. */
- my_friendly_assert (name != dtor_identifier, 20000408);
+ gcc_assert (name != dtor_identifier);
}
/* It's OK to call destructors on cv-qualified objects. Therefore,
@@ -6147,7 +6141,7 @@ the worst conversion for the second:");
}
}
- my_friendly_assert (!winner, 20010121);
+ gcc_assert (!winner);
return 0;
}
@@ -6443,7 +6437,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
we can extend the lifetime of the return value of the conversion
operator. */
- my_friendly_assert (conv->kind == ck_ref_bind, 20030302);
+ gcc_assert (conv->kind == ck_ref_bind);
if (decl)
{
tree var;
OpenPOWER on IntegriCloud