+2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * 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.
+
2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
* class.c (build_vtbl_initializer): Use ssize_int.
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 */
{
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);
{
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);
/* 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);
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))
*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)
{
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. */
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))
{
{
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;
}
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,
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))
/* 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. */
binfo = TYPE_BINFO (binfo);
}
- my_friendly_assert (binfo != NULL_TREE, 20020712);
+ gcc_assert (binfo != NULL_TREE);
class_type = BINFO_TYPE (binfo);
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
}
}
- my_friendly_assert (instance != NULL_TREE, 20020712);
+ gcc_assert (instance != NULL_TREE);
fns = lookup_fnfields (binfo, name, 1);
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));
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)
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))
{
/* 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,
}
}
- my_friendly_assert (!winner, 20010121);
+ gcc_assert (!winner);
return 0;
}
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;
if (want_pointer)
probe = TYPE_MAIN_VARIANT (TREE_TYPE (probe));
- my_friendly_assert (code == MINUS_EXPR
- ? same_type_p (BINFO_TYPE (binfo), probe)
- : code == PLUS_EXPR
- ? same_type_p (BINFO_TYPE (d_binfo), probe)
- : false, 20010723);
+ gcc_assert (code == MINUS_EXPR
+ ? same_type_p (BINFO_TYPE (binfo), probe)
+ : code == PLUS_EXPR
+ ? same_type_p (BINFO_TYPE (d_binfo), probe)
+ : false);
if (binfo == d_binfo)
/* Nothing to do. */
}
else
{
- my_friendly_assert (TREE_TYPE (decl) == vtbl_type_node, 20000118);
+ gcc_assert (TREE_TYPE (decl) == vtbl_type_node);
virtuals = NULL_TREE;
}
if (!DECL_LANG_SPECIFIC (fdecl))
retrofit_lang_decl (fdecl);
- my_friendly_assert (!DECL_DISCRIMINATOR_P (fdecl), 20030624);
+ gcc_assert (!DECL_DISCRIMINATOR_P (fdecl));
elem = purpose_member (t, DECL_ACCESS (fdecl));
if (elem)
{
tree basetype = TREE_TYPE (base_binfo);
- my_friendly_assert (COMPLETE_TYPE_P (basetype), 20040714);
+ gcc_assert (COMPLETE_TYPE_P (basetype));
/* Effective C++ rule 14. We only need to check TYPE_POLYMORPHIC_P
here because the case of virtual functions but non-virtual
calling FN through BINFO. */
for (b = binfo; ; b = get_primary_binfo (b))
{
- my_friendly_assert (b, 20021227);
+ gcc_assert (b);
if (look_for_overrides_here (BINFO_TYPE (b), target_fn))
break;
if (DECL_THUNK_P (fn))
{
- my_friendly_assert (DECL_RESULT_THUNK_P (fn), 20031211);
+ gcc_assert (DECL_RESULT_THUNK_P (fn));
fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn));
virtual_offset = THUNK_VIRTUAL_OFFSET (fn);
}
fixed_offset, virtual_offset);
}
else
- my_friendly_assert (!DECL_THUNK_P (fn), 20021231);
+ gcc_assert (!DECL_THUNK_P (fn));
/* Assume that we will produce a thunk that convert all the way to
the final overrider, and not to an intermediate virtual base. */
bool atend = false;
/* This routine should only be used for empty classes. */
- my_friendly_assert (is_empty_class (basetype), 20000321);
+ gcc_assert (is_empty_class (basetype));
alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype));
if (!integer_zerop (BINFO_OFFSET (binfo)))
}
else
{
- my_friendly_assert (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn), 20000411);
+ gcc_assert (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn));
/* For each destructor, we need three variants: an in-charge
version, a not-in-charge version, and an in-charge deleting
decl_parms = TREE_CHAIN (decl_parms),
clone_parms = TREE_CHAIN (clone_parms))
{
- my_friendly_assert (same_type_p (TREE_TYPE (decl_parms),
- TREE_TYPE (clone_parms)), 20010424);
+ gcc_assert (same_type_p (TREE_TYPE (decl_parms),
+ TREE_TYPE (clone_parms)));
if (TREE_PURPOSE (decl_parms) && !TREE_PURPOSE (clone_parms))
{
break;
}
}
- my_friendly_assert (!clone_parms, 20010424);
+ gcc_assert (!clone_parms);
}
}
tree fns;
bool has_two_argument_delete_p = false;
- my_friendly_assert (CLASS_TYPE_P (type), 20010712);
+ gcc_assert (CLASS_TYPE_P (type));
/* If there's a non-trivial destructor, we need a cookie. In order
to iterate through the array calling the destructor for each
rli->bitpos = round_down (rli->bitpos, BITS_PER_UNIT);
else
/* The size should have been rounded to a whole byte. */
- my_friendly_assert (tree_int_cst_equal (rli->bitpos,
- round_down (rli->bitpos,
- BITS_PER_UNIT)),
- 20030903);
+ gcc_assert (tree_int_cst_equal
+ (rli->bitpos, round_down (rli->bitpos, BITS_PER_UNIT)));
rli->bitpos
= size_binop (PLUS_EXPR,
rli->bitpos,
{
tree primary = CLASSTYPE_PRIMARY_BINFO (t);
- my_friendly_assert (same_type_p (DECL_FIELD_CONTEXT (vfield),
- BINFO_TYPE (primary)),
- 20010726);
+ gcc_assert (same_type_p (DECL_FIELD_CONTEXT (vfield),
+ BINFO_TYPE (primary)));
/* The vtable better be at the start. */
- my_friendly_assert (integer_zerop (DECL_FIELD_OFFSET (vfield)),
- 20010726);
- my_friendly_assert (integer_zerop (BINFO_OFFSET (primary)),
- 20010726);
+ gcc_assert (integer_zerop (DECL_FIELD_OFFSET (vfield)));
+ gcc_assert (integer_zerop (BINFO_OFFSET (primary)));
vfield = copy_decl (vfield);
DECL_FIELD_CONTEXT (vfield) = t;
TYPE_VFIELD (t) = vfield;
}
else
- my_friendly_assert (!vfield || DECL_FIELD_CONTEXT (vfield) == t, 20010726);
+ gcc_assert (!vfield || DECL_FIELD_CONTEXT (vfield) == t);
virtuals = modify_all_vtables (t, nreverse (virtuals));
tree fn;
if (BINFO_VTABLE (TYPE_BINFO (t)))
- my_friendly_assert (DECL_VIRTUAL_P (BINFO_VTABLE (TYPE_BINFO (t))),
- 20000116);
+ gcc_assert (DECL_VIRTUAL_P (BINFO_VTABLE (TYPE_BINFO (t))));
if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
- my_friendly_assert (BINFO_VIRTUALS (TYPE_BINFO (t)) == NULL_TREE,
- 20000116);
+ gcc_assert (BINFO_VIRTUALS (TYPE_BINFO (t)) == NULL_TREE);
/* Add entries for virtual functions introduced by this class. */
BINFO_VIRTUALS (TYPE_BINFO (t))
/* By the time we get here, we should be seeing only real
pointer-to-member types, not the internal POINTER_TYPE to
METHOD_TYPE representation. */
- my_friendly_assert (!(TREE_CODE (target_type) == POINTER_TYPE
- && (TREE_CODE (TREE_TYPE (target_type))
- == METHOD_TYPE)), 0);
+ gcc_assert (TREE_CODE (target_type) != POINTER_TYPE
+ || TREE_CODE (TREE_TYPE (target_type)) != METHOD_TYPE);
- my_friendly_assert (is_overloaded_fn (overload), 20030910);
+ gcc_assert (is_overloaded_fn (overload));
/* Check that the TARGET_TYPE is reasonable. */
if (TYPE_PTRFN_P (target_type))
/* This can happen if we are forming a pointer-to-member for a
member template. */
- my_friendly_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR, 0);
+ gcc_assert (TREE_CODE (rhs) == TEMPLATE_ID_EXPR);
/* Fall through. */
case TREE_LIST:
/* Now we should have a baselink. */
- my_friendly_assert (BASELINK_P (rhs), 990412);
+ gcc_assert (BASELINK_P (rhs));
return instantiate_type (lhstype, BASELINK_FUNCTIONS (rhs), flags);
decl = BINFO_VTABLE (binfo);
if (decl && TREE_CODE (decl) == PLUS_EXPR)
{
- my_friendly_assert (TREE_CODE (TREE_OPERAND (decl, 0)) == ADDR_EXPR,
- 2000403);
+ gcc_assert (TREE_CODE (TREE_OPERAND (decl, 0)) == ADDR_EXPR);
decl = TREE_OPERAND (TREE_OPERAND (decl, 0), 0);
}
if (decl)
- my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 20000403);
+ gcc_assert (TREE_CODE (decl) == VAR_DECL);
return decl;
}
inits = &TREE_CHAIN (*inits);
if (top_level_p)
{
- my_friendly_assert (!BINFO_VPTR_INDEX (binfo), 20010129);
+ gcc_assert (!BINFO_VPTR_INDEX (binfo));
BINFO_VPTR_INDEX (binfo) = *index;
}
*index = size_binop (PLUS_EXPR, *index, TYPE_SIZE_UNIT (ptr_type_node));
{
*inits = nreverse (secondary_vptrs);
inits = &TREE_CHAIN (secondary_vptrs);
- my_friendly_assert (*inits == NULL_TREE, 20000517);
+ gcc_assert (*inits == NULL_TREE);
}
/* Add the secondary VTTs for virtual bases. */
index = TREE_TYPE (l);
if (top_level_p)
{
- my_friendly_assert (!BINFO_VPTR_INDEX (binfo), 20010129);
+ gcc_assert (!BINFO_VPTR_INDEX (binfo));
BINFO_VPTR_INDEX (binfo) = index;
}
TREE_TYPE (l) = size_binop (PLUS_EXPR, index,
if (IDENTIFIER_GLOBAL_VALUE (id))
return;
- my_friendly_assert (!same_type_p (BINFO_TYPE (binfo), t), 20010124);
+ gcc_assert (!same_type_p (BINFO_TYPE (binfo), t));
/* Build a version of VTBL (with the wrong type) for use in
constructing the addresses of secondary vtables in the
construction vtable group. */
tree base_binfo;
int ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t);
- my_friendly_assert (same_type_p (BINFO_TYPE (binfo),
- BINFO_TYPE (orig_binfo)),
- 20000517);
+ gcc_assert (same_type_p (BINFO_TYPE (binfo), BINFO_TYPE (orig_binfo)));
/* If it doesn't have a vptr, we don't do anything. */
if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
delta = BV_DELTA (v);
vcall_index = BV_VCALL_INDEX (v);
- my_friendly_assert (TREE_CODE (delta) == INTEGER_CST, 19990727);
- my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 19990727);
+ gcc_assert (TREE_CODE (delta) == INTEGER_CST);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
/* You can't call an abstract virtual function; it's abstract.
So, we replace these functions with __pure_virtual. */
BINFO_VPTR_FIELD (b) = delta;
if (binfo != TYPE_BINFO (t))
- {
- /* The vbase offset had better be the same. */
- my_friendly_assert (tree_int_cst_equal (delta,
- BINFO_VPTR_FIELD (vbase)),
- 20030202);
- }
+ /* The vbase offset had better be the same. */
+ gcc_assert (tree_int_cst_equal (delta, BINFO_VPTR_FIELD (vbase)));
/* The next vbase will come at a more negative offset. */
vid->index = size_binop (MINUS_EXPR, vid->index,
tree primary_base;
primary_base = get_primary_binfo (b);
- my_friendly_assert (BINFO_PRIMARY_BASE_OF (primary_base) == b, 20010127);
+ gcc_assert (BINFO_PRIMARY_BASE_OF (primary_base) == b);
b = primary_base;
}
offset = size_diffop (BINFO_OFFSET (vid->rtti_binfo), BINFO_OFFSET (b));
tree argtype = TREE_TYPE (arg);
tree target_type = TREE_TYPE (type);
- my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 187);
+ gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg))
{
intype = TREE_TYPE (expr);
- my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364);
+ gcc_assert (TREE_CODE (intype) != REFERENCE_TYPE);
intype = TYPE_MAIN_VARIANT (intype);
block = NULL_TREE;
- my_friendly_assert (current_binding_level->kind != sk_class, 19990916);
+ gcc_assert (current_binding_level->kind != sk_class);
real_functionbody = (current_binding_level->kind == sk_cleanup
? ((functionbody = 0), tmp) : functionbody);
subblocks = functionbody >= 0 ? current_binding_level->blocks : 0;
- my_friendly_assert (VEC_length(cp_class_binding,
- current_binding_level->class_shadowed) == 0,
- 19990414);
+ gcc_assert (!VEC_length(cp_class_binding,
+ current_binding_level->class_shadowed));
/* We used to use KEEP == 2 to indicate that the new block should go
at the beginning of the list of blocks at this binding level,
rather than the end. This hack is no longer used. */
- my_friendly_assert (keep == 0 || keep == 1, 0);
+ gcc_assert (keep == 0 || keep == 1);
if (current_binding_level->keep)
keep = 1;
/* If newdecl is not a specialization, then it is not a
template-related function at all. And that means that we
should have exited above, returning 0. */
- my_friendly_assert (DECL_TEMPLATE_SPECIALIZATION (newdecl),
- 0);
+ gcc_assert (DECL_TEMPLATE_SPECIALIZATION (newdecl));
if (TREE_USED (olddecl))
/* From [temp.expl.spec]:
error ("`%D' used without template parameters", name);
return error_mark_node;
}
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (TREE_CODE (context) == NAMESPACE_DECL)
{
current_function_decl = NULL_TREE;
current_binding_level = NULL;
/* Enter the global namespace. */
- my_friendly_assert (global_namespace == NULL_TREE, 375);
+ gcc_assert (global_namespace == NULL_TREE);
global_namespace = build_lang_decl (NAMESPACE_DECL, global_scope_name,
void_type_node);
begin_scope (sk_namespace, global_namespace);
old_init_value = (TREE_CODE (*initp) == TREE_LIST
? TREE_VALUE (*initp) : old_init);
- my_friendly_assert (old_init_value, 20030723);
+ gcc_assert (old_init_value);
/* If the initializer is brace-enclosed, pull initializers from the
enclosed elements. Advance past the brace-enclosed initializer
if (TREE_CODE (decl) == CONST_DECL)
{
- my_friendly_assert (TREE_CODE (decl) != REFERENCE_TYPE, 148);
+ gcc_assert (TREE_CODE (decl) != REFERENCE_TYPE);
DECL_INITIAL (decl) = init;
- my_friendly_assert (init != NULL_TREE, 149);
+ gcc_assert (init != NULL_TREE);
init = NULL_TREE;
}
else if (!DECL_EXTERNAL (decl) && TREE_CODE (type) == REFERENCE_TYPE)
member. */
if (DECL_LANG_SPECIFIC (decl) && DECL_IN_AGGR_P (decl))
{
- my_friendly_assert (TREE_STATIC (decl), 19990828);
+ gcc_assert (TREE_STATIC (decl));
/* An in-class declaration of a static data member should be
external; it is only a declaration, and not a definition. */
if (init == NULL_TREE)
- my_friendly_assert (DECL_EXTERNAL (decl), 20000723);
+ gcc_assert (DECL_EXTERNAL (decl));
}
/* We don't create any RTL for local variables. */
tree type = TREE_TYPE (decl);
tree cleanup;
- my_friendly_assert (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == RESULT_DECL,
- 20021010);
- my_friendly_assert (!TREE_STATIC (decl), 20021010);
+ gcc_assert (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == RESULT_DECL);
+ gcc_assert (!TREE_STATIC (decl));
if (DECL_SIZE (decl) == NULL_TREE)
{
{
int saved_stmts_are_full_exprs_p;
- my_friendly_assert (building_stmt_tree (), 20000906);
+ gcc_assert (building_stmt_tree ());
saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
finish_expr_stmt (init);
return;
}
- my_friendly_assert (TREE_CODE (decl) != RESULT_DECL, 20030619);
+ gcc_assert (TREE_CODE (decl) != RESULT_DECL);
/* Assume no cleanup is required. */
cleanup = NULL_TREE;
}
/* Parameters are handled by store_parm_decls, not cp_finish_decl. */
- my_friendly_assert (TREE_CODE (decl) != PARM_DECL, 19990828);
+ gcc_assert (TREE_CODE (decl) != PARM_DECL);
/* Take care of TYPE_DECLs up front. */
if (TREE_CODE (decl) == TYPE_DECL)
static void
expand_static_init (tree decl, tree init)
{
- my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 20021010);
- my_friendly_assert (TREE_STATIC (decl), 20021010);
+ gcc_assert (TREE_CODE (decl) == VAR_DECL);
+ gcc_assert (TREE_STATIC (decl));
/* Some variables require no initialization. */
if (!init
(see template_id in parse.y). If the current class contains
such a name, we'll get a COMPONENT_REF here. Undo that. */
- my_friendly_assert (TREE_TYPE (TREE_OPERAND (fns, 0))
- == current_class_type, 20001120);
+ gcc_assert (TREE_TYPE (TREE_OPERAND (fns, 0))
+ == current_class_type);
fns = TREE_OPERAND (fns, 1);
}
- my_friendly_assert (TREE_CODE (fns) == IDENTIFIER_NODE
- || TREE_CODE (fns) == OVERLOAD, 20001120);
+ gcc_assert (TREE_CODE (fns) == IDENTIFIER_NODE
+ || TREE_CODE (fns) == OVERLOAD);
DECL_TEMPLATE_INFO (decl) = tree_cons (fns, args, NULL_TREE);
if (has_default_arg)
{
tree decl;
- my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE,
- 20020808);
+ gcc_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE);
/* Compute the scope in which to place the variable. */
if (!scope)
}
else
{
- my_friendly_assert (TREE_CODE (member_type) != FUNCTION_TYPE,
- 20030716);
+ gcc_assert (TREE_CODE (member_type) != FUNCTION_TYPE);
return build_offset_type (class_type, member_type);
}
}
dname = TREE_OPERAND (dname, 1);
if (TREE_CODE (dname) != IDENTIFIER_NODE)
{
- my_friendly_assert (is_overloaded_fn (dname),
- 19990331);
+ gcc_assert (is_overloaded_fn (dname));
dname = DECL_NAME (get_first_fn (dname));
}
}
name = IDENTIFIER_POINTER (dname);
else
{
- my_friendly_assert (flags == NO_SPECIAL, 154);
+ gcc_assert (flags == NO_SPECIAL);
flags = TYPENAME_FLAG;
ctor_return_type = TREE_TYPE (dname);
sfk = sfk_conversion;
tree arg_type;
int result = 1;
- my_friendly_assert (DECL_FUNCTION_MEMBER_P (d), 20011208);
+ gcc_assert (DECL_FUNCTION_MEMBER_P (d));
if (DECL_TEMPLATE_INFO (d) && is_member_template (DECL_TI_TEMPLATE (d)))
/* Instantiations of template member functions are never copy
abort ();
}
while (0);
- my_friendly_assert (operator_code != LAST_CPLUS_TREE_CODE, 20000526);
+ gcc_assert (operator_code != LAST_CPLUS_TREE_CODE);
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
if (! friendp)
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
switch (tag_code)
{
/* The binfo slot should be empty, unless this is an (ill-formed)
redefinition. */
- my_friendly_assert (!TYPE_BINFO (ref) || TYPE_SIZE (ref), 20040706);
- my_friendly_assert (TYPE_MAIN_VARIANT (ref) == ref, 20040712);
+ gcc_assert (!TYPE_BINFO (ref) || TYPE_SIZE (ref));
+ gcc_assert (TYPE_MAIN_VARIANT (ref) == ref);
binfo = make_tree_binfo (max_bases);
tree current_function_parms;
/* Sanity check. */
- my_friendly_assert (TREE_CODE (TREE_VALUE (void_list_node)) == VOID_TYPE, 160);
- my_friendly_assert (TREE_CHAIN (void_list_node) == NULL_TREE, 161);
+ gcc_assert (TREE_CODE (TREE_VALUE (void_list_node)) == VOID_TYPE);
+ gcc_assert (TREE_CHAIN (void_list_node) == NULL_TREE);
fntype = TREE_TYPE (decl1);
if (TREE_CODE (fntype) == METHOD_TYPE)
between `current_class_type' and `current_class_ptr'. */
tree t = DECL_ARGUMENTS (decl1);
- my_friendly_assert (t != NULL_TREE && TREE_CODE (t) == PARM_DECL,
- 162);
- my_friendly_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE,
- 19990811);
+ gcc_assert (t != NULL_TREE && TREE_CODE (t) == PARM_DECL);
+ gcc_assert (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE);
cp_function_chain->x_current_class_ref
= build_indirect_ref (t, NULL);
/* Save the language-specific per-function data so that we can
get it back when we really expand this function. */
- my_friendly_assert (!DECL_PENDING_INLINE_P (decl),
- 19990908);
+ gcc_assert (!DECL_PENDING_INLINE_P (decl));
/* Make a copy. */
f = GGC_NEW (struct language_function);
This caused &foo to be of type ptr-to-const-function
which then got a warning when stored in a ptr-to-function variable. */
- my_friendly_assert (building_stmt_tree (), 20000911);
+ gcc_assert (building_stmt_tree ());
/* For a cloned function, we've already got all the code we need;
there's no need to add any extra bits. */
/* Statements should always be full-expressions at the outermost set
of curly braces for a function. */
- my_friendly_assert (stmts_are_full_exprs_p (), 19990831);
+ gcc_assert (stmts_are_full_exprs_p ());
/* Set up the named return value optimization, if we can. Candidate
variables are selected in check_return_value. */
{
if (DECL_NAME (link) != NULL_TREE)
pop_binding (DECL_NAME (link), link);
- my_friendly_assert (TREE_CODE (link) != FUNCTION_DECL, 163);
+ gcc_assert (TREE_CODE (link) != FUNCTION_DECL);
DECL_CONTEXT (link) = NULL_TREE;
}
void
maybe_register_incomplete_var (tree var)
{
- my_friendly_assert (TREE_CODE (var) == VAR_DECL, 20020406);
+ gcc_assert (TREE_CODE (var) == VAR_DECL);
/* Keep track of variables with incomplete types. */
if (!processing_template_decl && TREE_TYPE (var) != error_mark_node
{
tree *list = &incomplete_vars;
- my_friendly_assert (CLASS_TYPE_P (type), 20020406);
+ gcc_assert (CLASS_TYPE_P (type));
while (*list)
{
if (same_type_p (type, TREE_PURPOSE (*list)))
}
type = TREE_TYPE (array_expr);
- my_friendly_assert (type, 20030626);
+ gcc_assert (type);
type = non_reference (type);
/* If they have an `operator[]', use that. */
{
tree decl;
- my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
+ gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
decl = DECL_TEMPLATE_RESULT (tmpl);
if (TREE_CODE (decl) == FUNCTION_DECL
either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */
if (TREE_CODE (function) == TEMPLATE_DECL)
{
- my_friendly_assert (!template_parms
- || comp_template_parms
- (template_parms,
- DECL_TEMPLATE_PARMS (function)),
- 20040303);
+ gcc_assert (!template_parms
+ || comp_template_parms (template_parms,
+ DECL_TEMPLATE_PARMS (function)));
template_parms = DECL_TEMPLATE_PARMS (function);
}
finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
int flags)
{
- my_friendly_assert (TREE_PUBLIC (decl), 0);
+ gcc_assert (TREE_PUBLIC (decl));
DECL_CONTEXT (decl) = current_class_type;
int e = 0;
tree args = TYPE_ARG_TYPES (type);
- my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
+ gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
e = 1, error ("`operator new' must return type `%T'", ptr_type_node);
int e = 0;
tree args = TYPE_ARG_TYPES (type);
- my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
+ gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
if (!same_type_p (TREE_TYPE (type), void_type_node))
e = 1, error ("`operator delete' must return type `%T'", void_type_node);
non-abstract virtual member function has been defined in this
translation unit. But, we can't possibly know that until we've
seen the entire translation unit. */
- my_friendly_assert (at_eof, 20000226);
+ gcc_assert (at_eof);
if (CLASSTYPE_INTERFACE_KNOWN (ctype))
return;
bool
decl_needed_p (tree decl)
{
- my_friendly_assert (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == FUNCTION_DECL,
- 20040726);
+ gcc_assert (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL);
/* This function should only be called at the end of the translation
unit. We cannot be sure of whether or not something will be
COMDAT until that point. */
- my_friendly_assert (at_eof, 20040726);
+ gcc_assert (at_eof);
/* All entities with external linkage that are not COMDAT should be
emitted; they may be referred to from other object files. */
/* Cloned constructors and destructors get the same visibility as
the underlying function. That should be set up in
maybe_clone_body. */
- my_friendly_assert (!DECL_CLONED_FUNCTION_P (decl), 20040804);
+ gcc_assert (!DECL_CLONED_FUNCTION_P (decl));
/* Give the common code a chance to make a determination. */
if (c_determine_visibility (decl))
{
/* Virtual tables have DECL_CONTEXT set to their associated class,
so they are automatically handled above. */
- my_friendly_assert (!(TREE_CODE (decl) == VAR_DECL
- && DECL_VTABLE_OR_VTT_P (decl)), 20040803);
+ gcc_assert (TREE_CODE (decl) != VAR_DECL
+ || !DECL_VTABLE_OR_VTT_P (decl));
/* Entities not associated with any class just get the
visibility specified by their attributes. */
return;
"-frepo" it would be incorrect to make decisions about what
entities to emit when building the PCH; those decisions must be
delayed until the repository information has been processed. */
- my_friendly_assert (at_eof, 20040727);
+ gcc_assert (at_eof);
/* Object file linkage for explicit instantiations is handled in
mark_decl_instantiated. For static variables in functions with
vague linkage, maybe_commonize_var is used.
definition available in this translation unit.
The following assertions check these conditions. */
- my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == VAR_DECL,
- 2004725);
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == VAR_DECL);
/* Any code that creates entities with TREE_PUBLIC cleared should
also set DECL_INTERFACE_KNOWN. */
- my_friendly_assert (TREE_PUBLIC (decl), 20040725);
+ gcc_assert (TREE_PUBLIC (decl));
if (TREE_CODE (decl) == FUNCTION_DECL)
- my_friendly_assert (DECL_IMPLICIT_INSTANTIATION (decl)
- || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
- || DECL_DECLARED_INLINE_P (decl),
- 20040725);
+ gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
+ || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
+ || DECL_DECLARED_INLINE_P (decl));
else
- my_friendly_assert (DECL_IMPLICIT_INSTANTIATION (decl)
- || DECL_VTABLE_OR_VTT_P (decl)
- || DECL_TINFO_P (decl),
- 20040725);
+ gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
+ || DECL_VTABLE_OR_VTT_P (decl)
+ || DECL_TINFO_P (decl));
/* Check that a definition of DECL is available in this translation
unit. */
- my_friendly_assert (!DECL_REALLY_EXTERN (decl), 20040725);
+ gcc_assert (!DECL_REALLY_EXTERN (decl));
/* Assume that DECL will not have COMDAT linkage. */
comdat_p = false;
/* This function should only be called for declarations that really
require cleanups. */
- my_friendly_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type), 20030106);
+ gcc_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type));
/* Treat all objects with destructors as used; the destructor may do
something substantive. */
{
/* When using __cxa_atexit, we never try to destroy
anything from a static destructor. */
- my_friendly_assert (initp, 20000629);
+ gcc_assert (initp);
guard_cond = get_guard_cond (guard);
}
/* If we don't have __cxa_atexit, then we will be running
/* If we're using __cxa_atexit, then destructors are registered
immediately after objects are initialized. */
- my_friendly_assert (!flag_use_cxa_atexit, 20000121);
+ gcc_assert (!flag_use_cxa_atexit);
/* If we don't need a destructor, there's nothing to do. */
if (TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
}
/* The only things that can be initialized are variables. */
- my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 19990420);
+ gcc_assert (TREE_CODE (decl) == VAR_DECL);
/* If this object is not defined, we don't need to do anything
here. */
if (processing_template_decl)
{
- my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR
- || TREE_CODE (fn) == MEMBER_REF,
- 20030708);
+ gcc_assert (TREE_CODE (fn) == DOTSTAR_EXPR
+ || TREE_CODE (fn) == MEMBER_REF);
if (type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (args))
return build_min_nt (CALL_EXPR, fn, args, NULL_TREE);
if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
{
pp_string (cxx_pp, "vtable for ");
- my_friendly_assert (TYPE_P (DECL_CONTEXT (t)), 20010720);
+ gcc_assert (TYPE_P (DECL_CONTEXT (t)));
dump_type (DECL_CONTEXT (t), flags);
break;
}
if (TREE_HAS_CONSTRUCTOR (t))
{
t = TREE_OPERAND (t, 0);
- my_friendly_assert (TREE_CODE (t) == CALL_EXPR, 237);
+ gcc_assert (TREE_CODE (t) == CALL_EXPR);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
pp_cxx_left_paren (cxx_pp);
dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1)), flags);
pp_cxx_identifier (cxx_pp, "sizeof");
else
{
- my_friendly_assert (TREE_CODE (t) == ALIGNOF_EXPR, 0);
+ gcc_assert (TREE_CODE (t) == ALIGNOF_EXPR);
pp_cxx_identifier (cxx_pp, "__alignof__");
}
pp_cxx_whitespace (cxx_pp);
stmt_expr = finish_stmt_expr (stmt_expr, true);
- my_friendly_assert (!building_stmt_tree () == is_global, 20030726);
+ gcc_assert (!building_stmt_tree () == is_global);
return stmt_expr;
}
-- if T is a reference type, no initialization is performed. */
- my_friendly_assert (nelts == NULL_TREE || TREE_CODE (nelts) == INTEGER_CST,
- 20030618);
+ gcc_assert (nelts == NULL_TREE || TREE_CODE (nelts) == INTEGER_CST);
if (type == error_mark_node)
;
/* Iterate over the array elements, building initializations. */
inits = NULL_TREE;
max_index = nelts ? nelts : array_type_nelts (type);
- my_friendly_assert (TREE_CODE (max_index) == INTEGER_CST, 20030618);
+ gcc_assert (TREE_CODE (max_index) == INTEGER_CST);
/* A zero-sized array, which is accepted as an extension, will
have an upper bound of -1. */
/* Compute the location of the vtpr. */
vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL),
TREE_TYPE (binfo));
- my_friendly_assert (vtbl_ptr != error_mark_node, 20010730);
+ gcc_assert (vtbl_ptr != error_mark_node);
/* Assign the vtable to the vptr. */
vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0);
else if (BRACE_ENCLOSED_INITIALIZER_P (init))
{
/* A brace-enclosed initializer for an aggregate. */
- my_friendly_assert (CP_AGGREGATE_TYPE_P (type), 20021016);
+ gcc_assert (CP_AGGREGATE_TYPE_P (type));
init = digest_init (type, init, (tree *)NULL);
}
else
{
tree type = TREE_TYPE (exp);
- my_friendly_assert (init != error_mark_node && type != error_mark_node, 211);
- my_friendly_assert (building_stmt_tree (), 20021010);
+ gcc_assert (init != error_mark_node && type != error_mark_node);
+ gcc_assert (building_stmt_tree ());
/* Use a function returning the desired type to initialize EXP for us.
If the function is a constructor, and its first argument is
name = DECL_NAME (OVL_CURRENT (name));
}
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
}
if (type == NULL_TREE)
while (TREE_CODE (alloc_call) == COMPOUND_EXPR)
alloc_call = TREE_OPERAND (alloc_call, 1);
alloc_fn = get_callee_fndecl (alloc_call);
- my_friendly_assert (alloc_fn != NULL_TREE, 20020325);
+ gcc_assert (alloc_fn != NULL_TREE);
/* Now, check to see if this function is actually a placement
allocation function. This can happen even when PLACEMENT is NULL
addr = convert_force (build_pointer_type (type), addr, 0);
}
- my_friendly_assert (IS_AGGR_TYPE (type), 220);
+ gcc_assert (IS_AGGR_TYPE (type));
if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
{
tree do_delete = NULL_TREE;
tree ifexp;
- my_friendly_assert (TYPE_HAS_DESTRUCTOR (type), 20011213);
+ gcc_assert (TYPE_HAS_DESTRUCTOR (type));
/* For `::delete x', we must not use the deleting destructor
since then we would not be sure to get the global `operator
VEC (tree) *vbases;
tree addr = build_unary_op (ADDR_EXPR, decl, 0);
- my_friendly_assert (addr != error_mark_node, 222);
+ gcc_assert (addr != error_mark_node);
result = convert_to_void (integer_zero_node, NULL);
for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0;
fixed-length. */
varargs_p = 0;
/* A void type better be the last one. */
- my_friendly_assert (TREE_CHAIN (parm_types) == NULL, 20000523);
+ gcc_assert (TREE_CHAIN (parm_types) == NULL);
}
else
write_type (parm);
write_char ('I');
- my_friendly_assert (length > 0, 20000422);
+ gcc_assert (length > 0);
if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
{
template_id = TREE_OPERAND (expr, 1);
name = TREE_OPERAND (template_id, 0);
/* FIXME: What about operators? */
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE,
- 20030707);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
write_source_name (TREE_OPERAND (template_id, 0));
write_template_args (TREE_OPERAND (template_id, 1));
}
/* Template parameters can be of reference type. To maintain
internal consistency, such arguments use a conversion from
address of object to reference type. */
- my_friendly_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR,
- 20031215);
+ gcc_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR);
if (abi_version_at_least (2))
node = TREE_OPERAND (TREE_OPERAND (node, 0), 0);
else
HOST_WIDE_INT d;
tree thunk;
- my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 20021025);
+ gcc_assert (TREE_CODE (function) == FUNCTION_DECL);
/* We can have this thunks to covariant thunks, but not vice versa. */
- my_friendly_assert (!DECL_THIS_THUNK_P (function), 20021127);
- my_friendly_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting,
- 20031123);
+ gcc_assert (!DECL_THIS_THUNK_P (function));
+ gcc_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting);
/* Scale the VIRTUAL_OFFSET to be in terms of bytes. */
if (this_adjusting && virtual_offset)
/* All thunks must be created before FUNCTION is actually emitted;
the ABI requires that all thunks be emitted together with the
function to which they transfer control. */
- my_friendly_assert (!TREE_ASM_WRITTEN (function), 20021025);
+ gcc_assert (!TREE_ASM_WRITTEN (function));
/* Likewise, we can only be adding thunks to a function declared in
the class currently being laid out. */
- my_friendly_assert (TYPE_SIZE (DECL_CONTEXT (function))
- && TYPE_BEING_DEFINED (DECL_CONTEXT (function)),
- 20031211);
+ gcc_assert (TYPE_SIZE (DECL_CONTEXT (function))
+ && TYPE_BEING_DEFINED (DECL_CONTEXT (function)));
thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function));
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
tree fixed_offset = ssize_int (THUNK_FIXED_OFFSET (thunk));
tree virtual_offset = THUNK_VIRTUAL_OFFSET (thunk);
- my_friendly_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk), 20021127);
+ gcc_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk));
if (virtual_offset && DECL_RESULT_THUNK_P (thunk))
virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
function = THUNK_TARGET (thunk);
cov_probe; cov_probe = TREE_CHAIN (cov_probe))
if (DECL_NAME (cov_probe) == name)
{
- my_friendly_assert (!DECL_THUNKS (thunk), 20031023);
+ gcc_assert (!DECL_THUNKS (thunk));
THUNK_ALIAS (thunk) = (THUNK_ALIAS (cov_probe)
? THUNK_ALIAS (cov_probe) : cov_probe);
break;
bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl);
/* We should have called finish_thunk to give it a name. */
- my_friendly_assert (DECL_NAME (thunk_fndecl), 20021127);
+ gcc_assert (DECL_NAME (thunk_fndecl));
/* We should never be using an alias, always refer to the
aliased thunk. */
- my_friendly_assert (!THUNK_ALIAS (thunk_fndecl), 20031023);
+ gcc_assert (!THUNK_ALIAS (thunk_fndecl));
if (TREE_ASM_WRITTEN (thunk_fndecl))
return;
if (!this_adjusting)
virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
virtual_value = tree_low_cst (virtual_offset, /*pos=*/0);
- my_friendly_assert (virtual_value, 20021026);
+ gcc_assert (virtual_value);
}
else
virtual_value = 0;
binding = IDENTIFIER_BINDING (id);
/* The name should be bound. */
- my_friendly_assert (binding != NULL, 0);
+ gcc_assert (binding != NULL);
/* The DECL will be either the ordinary binding or the type
binding for this identifier. Remove that binding. */
default:
/* Should not happen. */
- my_friendly_assert (false, 20030922);
+ gcc_unreachable ();
break;
}
scope->kind = kind;
/* We cannot leave a scope, if there are none left. */
if (NAMESPACE_LEVEL (global_namespace))
- my_friendly_assert (!global_scope_p (scope), 20030527);
+ gcc_assert (!global_scope_p (scope));
if (ENABLE_SCOPE_CHECKING)
{
scope->type_decls = NULL;
else
binding_table_free (scope->type_decls);
- my_friendly_assert (!ENABLE_SCOPE_CHECKING
- || scope->binding_depth == binding_depth,
- 20030529);
+ gcc_assert (!ENABLE_SCOPE_CHECKING
+ || scope->binding_depth == binding_depth);
free_binding_level = scope;
}
{
/* Resuming binding levels is meant only for namespaces,
and those cannot nest into classes. */
- my_friendly_assert(!class_binding_level, 386);
+ gcc_assert (!class_binding_level);
/* Also, resuming a non-directly nested namespace is a no-no. */
- my_friendly_assert(b->level_chain == current_binding_level, 386);
+ gcc_assert (b->level_chain == current_binding_level);
current_binding_level = b;
if (ENABLE_SCOPE_CHECKING)
{
tree decl;
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (TREE_CODE (scope) == NAMESPACE_DECL, 383);
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 384);
+ gcc_assert (TREE_CODE (scope) == NAMESPACE_DECL);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl))
if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name)
break;
if (is_overloaded_fn (decl))
decl = get_first_fn (decl);
- my_friendly_assert (DECL_P (decl), 20020908);
+ gcc_assert (DECL_P (decl));
/* Make a USING_DECL. */
return push_using_decl (scope, name);
bool
is_ancestor (tree root, tree child)
{
- my_friendly_assert ((TREE_CODE (root) == NAMESPACE_DECL
- || TREE_CODE (root) == FUNCTION_DECL
- || CLASS_TYPE_P (root)), 20030307);
- my_friendly_assert ((TREE_CODE (child) == NAMESPACE_DECL
- || CLASS_TYPE_P (child)),
- 20030307);
+ gcc_assert ((TREE_CODE (root) == NAMESPACE_DECL
+ || TREE_CODE (root) == FUNCTION_DECL
+ || CLASS_TYPE_P (root)));
+ gcc_assert ((TREE_CODE (child) == NAMESPACE_DECL
+ || CLASS_TYPE_P (child)));
/* The global namespace encloses everything. */
if (root == global_namespace)
tree shadowed;
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (level != 0, 354);
+ gcc_assert (level != 0);
/* If we're leaving a toplevel class, cache its binding level. */
if (current_class_depth == 1)
context = CP_DECL_CONTEXT (OVL_CURRENT (decl));
else
{
- my_friendly_assert (DECL_P (decl), 0);
+ gcc_assert (DECL_P (decl));
context = context_for_name_lookup (decl);
}
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
/* Check for invalid member names. */
- my_friendly_assert (TYPE_BEING_DEFINED (current_class_type), 20040713);
+ gcc_assert (TYPE_BEING_DEFINED (current_class_type));
/* We could have been passed a tree list if this is an ambiguous
declaration. If so, pull the declaration out because
check_template_shadow will not handle a TREE_LIST. */
name = DECL_NAME (get_first_fn (fns));
}
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
/* Dependent using decls have a NULL type, non-dependent ones have a
void type. */
/* We should not get here if the global_namespace is not yet constructed
nor if NAME designates the global namespace: The global scope is
constructed elsewhere. */
- my_friendly_assert (global_namespace != NULL && name != global_scope_name,
- 20030531);
+ gcc_assert (global_namespace != NULL && name != global_scope_name);
if (anon)
{
void
pop_namespace (void)
{
- my_friendly_assert (current_namespace != global_namespace, 20010801);
+ gcc_assert (current_namespace != global_namespace);
current_namespace = CP_DECL_CONTEXT (current_namespace);
/* The binding level is not popped, as it might be re-opened later. */
leave_scope ();
timevar_pop (TV_NAME_LOOKUP);
return;
}
- my_friendly_assert (TREE_CODE (user) == NAMESPACE_DECL, 380);
- my_friendly_assert (TREE_CODE (used) == NAMESPACE_DECL, 380);
+ gcc_assert (TREE_CODE (user) == NAMESPACE_DECL);
+ gcc_assert (TREE_CODE (used) == NAMESPACE_DECL);
/* Check if we already have this. */
t = purpose_member (used, DECL_NAMESPACE_USING (user));
if (t != NULL_TREE)
int flags)
{
tree val, type;
- my_friendly_assert (old != NULL, 393);
+ gcc_assert (old != NULL);
/* Copy the value. */
val = new->value;
if (val)
struct scope_binding binding = EMPTY_SCOPE_BINDING;
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 370);
+ gcc_assert (TREE_CODE (namespace) == NAMESPACE_DECL);
if (TREE_CODE (name) == NAMESPACE_DECL)
/* This happens for A::B<int> when B is a namespace. */
name = DECL_NAME (name);
}
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 373);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (!qualified_lookup_using_namespace (name, namespace, &binding, 0))
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
- my_friendly_assert (current_binding_level->kind != sk_namespace,
- 980716);
+ gcc_assert (current_binding_level->kind != sk_namespace);
if (REAL_IDENTIFIER_TYPE_VALUE (name) != NULL_TREE
&& REAL_IDENTIFIER_TYPE_VALUE (name) != global_type_node)
{
maybe_check_template_type (type);
- my_friendly_assert (IS_AGGR_TYPE (type)
- || TREE_CODE (type) == ENUMERAL_TYPE, 0);
-
+ gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE);
if (processing_template_decl)
{
cp_token *token;
/* N is 1-based, not zero-based. */
- my_friendly_assert (n > 0, 20000224);
+ gcc_assert (n > 0);
/* Skip ahead from NEXT_TOKEN, reading more tokens as necessary. */
token = lexer->next_token;
/* If we got here, this cannot be a valid variable declaration, thus
the cp_parser_id_expression must have resolved to a plain identifier
node (not a TYPE_DECL or TEMPLATE_ID_EXPR). */
- my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 20030203);
+ gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
/* Emit a diagnostic for the invalid type. */
cp_parser_diagnose_invalid_type_name (parser, parser->scope, id);
/* Skip to the end of the declaration; there's no point in
}
/* Make sure the declarator obstack was fully cleaned up. */
- my_friendly_assert (obstack_next_free (&declarator_obstack) ==
- declarator_obstack_base,
- 20040621);
+ gcc_assert (obstack_next_free (&declarator_obstack)
+ == declarator_obstack_base);
/* All went well. */
return success;
{
/* If it's not a class-template or a template-template, it should be
a function-template. */
- my_friendly_assert ((DECL_FUNCTION_TEMPLATE_P (template)
- || TREE_CODE (template) == OVERLOAD
- || BASELINK_P (template)),
- 20010716);
+ gcc_assert ((DECL_FUNCTION_TEMPLATE_P (template)
+ || TREE_CODE (template) == OVERLOAD
+ || BASELINK_P (template)));
template_id = lookup_template_function (template, arguments);
}
return name;
if (BASELINK_P (name))
{
- my_friendly_assert ((TREE_CODE (BASELINK_FUNCTIONS (name))
- == TEMPLATE_ID_EXPR),
- 20020909);
+ gcc_assert (TREE_CODE (BASELINK_FUNCTIONS (name))
+ == TEMPLATE_ID_EXPR);
return name;
}
/* By this point, the NAME should be an ordinary identifier. If
the id-expression was a qualified name, the qualifying scope is
stored in PARSER->SCOPE at this point. */
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE,
- 20000619);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
/* Perform the lookup. */
if (parser->scope)
return error_mark_node;
}
- my_friendly_assert (DECL_P (decl)
- || TREE_CODE (decl) == OVERLOAD
- || TREE_CODE (decl) == SCOPE_REF
- || TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
- || BASELINK_P (decl),
- 20000619);
+ gcc_assert (DECL_P (decl)
+ || TREE_CODE (decl) == OVERLOAD
+ || TREE_CODE (decl) == SCOPE_REF
+ || TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
+ || BASELINK_P (decl));
/* If we have resolved the name of a member declaration, check to
see if the declaration is accessible. When the name resolves to
/* There should not be any class definitions in progress at this
point; the bodies of members are only parsed outside of all class
definitions. */
- my_friendly_assert (parser->num_classes_being_defined == 0, 20010816);
+ gcc_assert (parser->num_classes_being_defined == 0);
/* While we're parsing the member functions we might encounter more
classes. We want to handle them right away, but we don't want
them getting mixed up with functions that are currently in the
static void
push_access_scope (tree t)
{
- my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL
- || TREE_CODE (t) == VAR_DECL,
- 0);
+ gcc_assert (TREE_CODE (t) == FUNCTION_DECL
+ || TREE_CODE (t) == VAR_DECL);
if (DECL_CLASS_SCOPE_P (t))
push_nested_class (DECL_CONTEXT (t));
if (decl == error_mark_node)
return error_mark_node;
- my_friendly_assert (DECL_P (decl), 20020812);
+ gcc_assert (DECL_P (decl));
if (TREE_CODE (decl) == TYPE_DECL)
{
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
- my_friendly_assert (DECL_P (parm), 0);
+ gcc_assert (DECL_P (parm));
switch (TREE_CODE (parm))
{
/* If there are more levels of EXTRA_ARGS than there are ARGS,
something very fishy is going on. */
- my_friendly_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args),
- 0);
+ gcc_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args));
/* If *all* the new arguments will be the EXTRA_ARGS, just return
them. */
int extra_levels;
int i;
- my_friendly_assert (n >= 0, 20000603);
+ gcc_assert (n >= 0);
/* If N is 1, just return the innermost set of template arguments. */
if (n == 1)
/* If we're not removing anything, just return the arguments we were
given. */
extra_levels = TMPL_ARGS_DEPTH (args) - n;
- my_friendly_assert (extra_levels >= 0, 20000603);
+ gcc_assert (extra_levels >= 0);
if (extra_levels == 0)
return args;
void
begin_explicit_instantiation (void)
{
- my_friendly_assert (!processing_explicit_instantiation, 20020913);
+ gcc_assert (!processing_explicit_instantiation);
processing_explicit_instantiation = true;
}
void
end_explicit_instantiation (void)
{
- my_friendly_assert(processing_explicit_instantiation, 20020913);
+ gcc_assert (processing_explicit_instantiation);
processing_explicit_instantiation = false;
}
{
tree s;
- my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
+ gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
/* There should be as many levels of arguments as there are
levels of parameters. */
- my_friendly_assert (TMPL_ARGS_DEPTH (args)
- == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)),
- 0);
+ gcc_assert (TMPL_ARGS_DEPTH (args)
+ == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)));
for (s = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
s != NULL_TREE;
}
else
{
- my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 0);
+ gcc_assert (TREE_CODE (decl) == TYPE_DECL);
for (t = TREE_TYPE (decl);
t != NULL_TREE;
bool need_template = true;
int template_depth;
- my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL, 0);
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
/* For [temp.friend/6] when FRIEND is an ordinary member function
of a template class, we want to check if DECL is a specialization
{
tree s;
- my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
+ gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
if (TREE_CODE (spec) == FUNCTION_DECL
&& uses_template_parms (DECL_TI_ARGS (spec)))
/* There should be as many levels of arguments as there are
levels of parameters. */
- my_friendly_assert (TMPL_ARGS_DEPTH (args)
- == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)),
- 0);
+ gcc_assert (TMPL_ARGS_DEPTH (args)
+ == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)));
for (s = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
s != NULL_TREE;
{
tree fns;
- my_friendly_assert (TREE_CODE (declarator) == IDENTIFIER_NODE, 0);
+ gcc_assert (TREE_CODE (declarator) == IDENTIFIER_NODE);
if (ctype)
fns = dname;
else
{
/* If there is no class context, the explicit instantiation
must be at namespace scope. */
- my_friendly_assert (DECL_NAMESPACE_SCOPE_P (decl), 20030625);
+ gcc_assert (DECL_NAMESPACE_SCOPE_P (decl));
/* Find the namespace binding, using the declaration
context. */
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
-int comp_template_parms (tree parms1, tree parms2)
+int
+comp_template_parms (tree parms1, tree parms2)
{
tree p1;
tree p2;
tree t2 = TREE_VALUE (p2);
int i;
- my_friendly_assert (TREE_CODE (t1) == TREE_VEC, 0);
- my_friendly_assert (TREE_CODE (t2) == TREE_VEC, 0);
+ gcc_assert (TREE_CODE (t1) == TREE_VEC);
+ gcc_assert (TREE_CODE (t2) == TREE_VEC);
if (TREE_VEC_LENGTH (t1) != TREE_VEC_LENGTH (t2))
return 0;
int idx;
parm = next;
- my_friendly_assert (TREE_CODE (parm) == TREE_LIST, 259);
+ gcc_assert (TREE_CODE (parm) == TREE_LIST);
defval = TREE_PURPOSE (parm);
if (list)
The type of a template parameter corresponding to a specialized
non-type argument shall not be dependent on a parameter of the
specialization. */
- my_friendly_assert (nargs == DECL_NTPARMS (maintmpl), 0);
+ gcc_assert (nargs == DECL_NTPARMS (maintmpl));
tpd2.parms = 0;
for (i = 0; i < nargs; ++i)
{
expr = build_unary_op (ADDR_EXPR, fn, 0);
- my_friendly_assert (same_type_p (type, TREE_TYPE (expr)),
- 0);
+ gcc_assert (same_type_p (type, TREE_TYPE (expr)));
return expr;
}
else
if (TREE_CODE (expr) == NOP_EXPR
&& TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
STRIP_NOPS (expr);
- my_friendly_assert (TREE_CODE (expr) == ADDR_EXPR, 20000604);
+ gcc_assert (TREE_CODE (expr) == ADDR_EXPR);
expr = TREE_OPERAND (expr, 0);
expr_type = TREE_TYPE (expr);
}
goto bad_argument;
}
- my_friendly_assert (same_type_p (type_referred_to,
- TREE_TYPE (fn)),
- 0);
-
+ gcc_assert (same_type_p (type_referred_to, TREE_TYPE (fn)));
expr = fn;
}
else
case RECORD_TYPE:
{
- my_friendly_assert (TYPE_PTRMEMFUNC_P (type), 20010112);
+ gcc_assert (TYPE_PTRMEMFUNC_P (type));
/* For a non-type template-parameter of type pointer to member
function, no conversions apply. If the template-argument
int nparms, nargs, i;
tree parm, arg;
- my_friendly_assert (TREE_CODE (parm_parms) == TREE_VEC, 0);
- my_friendly_assert (TREE_CODE (arg_parms) == TREE_VEC, 0);
+ gcc_assert (TREE_CODE (parm_parms) == TREE_VEC);
+ gcc_assert (TREE_CODE (arg_parms) == TREE_VEC);
nparms = TREE_VEC_LENGTH (parm_parms);
nargs = TREE_VEC_LENGTH (arg_parms);
else
break;
- my_friendly_assert (arg, 20030727);
+ gcc_assert (arg);
if (arg == error_mark_node)
error ("template argument %d is invalid", i + 1);
else
ccat ('<');
nparms = TREE_VEC_LENGTH (parms);
arglist = INNERMOST_TEMPLATE_ARGS (arglist);
- my_friendly_assert (nparms == TREE_VEC_LENGTH (arglist), 268);
+ gcc_assert (nparms == TREE_VEC_LENGTH (arglist));
for (i = 0; i < nparms; i++)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
{
/* The template may be defined in a namespace, or
may be a member template. */
- my_friendly_assert (TREE_CODE (context) == NAMESPACE_DECL
- || CLASS_TYPE_P (context),
- 980422);
- cat(decl_as_string (DECL_CONTEXT (arg), TFF_PLAIN_IDENTIFIER));
- cat("::");
+ gcc_assert (TREE_CODE (context) == NAMESPACE_DECL
+ || CLASS_TYPE_P (context));
+ cat (decl_as_string (DECL_CONTEXT (arg),
+ TFF_PLAIN_IDENTIFIER));
+ cat ("::");
}
cat (IDENTIFIER_POINTER (DECL_NAME (arg)));
}
continue;
}
else
- my_friendly_assert (TREE_CODE (parm) == PARM_DECL, 269);
+ gcc_assert (TREE_CODE (parm) == PARM_DECL);
/* No need to check arglist against parmlist here; we did that
in coerce_template_parms, called from lookup_template_class. */
if (fns == error_mark_node || arglist == error_mark_node)
return error_mark_node;
- my_friendly_assert (!arglist || TREE_CODE (arglist) == TREE_VEC, 20030726);
+ gcc_assert (!arglist || TREE_CODE (arglist) == TREE_VEC);
if (fns == NULL_TREE
|| TREE_CODE (fns) == FUNCTION_DECL)
{
return error_mark_node;
}
- my_friendly_assert (TREE_CODE (fns) == TEMPLATE_DECL
- || TREE_CODE (fns) == OVERLOAD
- || BASELINK_P (fns)
- || TREE_CODE (fns) == IDENTIFIER_NODE,
- 20020730);
+ gcc_assert (TREE_CODE (fns) == TEMPLATE_DECL
+ || TREE_CODE (fns) == OVERLOAD
+ || BASELINK_P (fns)
+ || TREE_CODE (fns) == IDENTIFIER_NODE);
if (BASELINK_P (fns))
{
}
/* Now we should have enough arguments. */
- my_friendly_assert (parm_depth == arg_depth, 0);
+ gcc_assert (parm_depth == arg_depth);
/* From here on, we're only interested in the most general
template. */
/* Figure out which template is being instantiated. */
template = most_general_template (CLASSTYPE_TI_TEMPLATE (type));
- my_friendly_assert (TREE_CODE (template) == TEMPLATE_DECL, 279);
+ gcc_assert (TREE_CODE (template) == TEMPLATE_DECL);
/* Figure out which arguments are being used to do the
instantiation. */
/* tsubst_template_args doesn't copy the vector if
nothing changed. But, *something* should have
changed. */
- my_friendly_assert (full_args != tmpl_args, 0);
+ gcc_assert (full_args != tmpl_args);
spec = retrieve_specialization (t, full_args);
if (spec != NULL_TREE)
like the old one, but points to this new template, rather
than the old one. */
r = copy_decl (t);
- my_friendly_assert (DECL_LANG_SPECIFIC (r) != 0, 0);
+ gcc_assert (DECL_LANG_SPECIFIC (r) != 0);
TREE_CHAIN (r) = NULL_TREE;
if (is_template_template_parm)
int parms_depth;
/* Nobody should be tsubst'ing into non-template functions. */
- my_friendly_assert (DECL_TEMPLATE_INFO (t) != NULL_TREE, 0);
+ gcc_assert (DECL_TEMPLATE_INFO (t) != NULL_TREE);
if (TREE_CODE (DECL_TI_TEMPLATE (t)) == TEMPLATE_DECL)
{
tree fntype;
/* The TYPE_CONTEXT is not used for function/method types. */
- my_friendly_assert (TYPE_CONTEXT (t) == NULL_TREE, 0);
+ gcc_assert (TYPE_CONTEXT (t) == NULL_TREE);
/* Substitute the return type. */
return_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
else
type = TREE_TYPE (t);
- my_friendly_assert (type != unknown_type_node, 20030716);
+ gcc_assert (type != unknown_type_node);
if (type && TREE_CODE (t) != FUNCTION_DECL
&& TREE_CODE (t) != TYPENAME_TYPE
{
if (TREE_CODE (t) == TEMPLATE_TYPE_PARM)
{
- my_friendly_assert (TYPE_P (arg), 0);
+ gcc_assert (TYPE_P (arg));
return cp_build_qualified_type_real
(arg, cp_type_quals (arg) | cp_type_quals (t),
complain | tf_ignore_bad_quals);
case TREE_VEC:
/* A vector of template arguments. */
- my_friendly_assert (!type, 20040628);
+ gcc_assert (!type);
return tsubst_template_args (t, args, complain, in_decl);
case POINTER_TYPE:
return error_mark_node;
}
- my_friendly_assert (TREE_CODE (type) != METHOD_TYPE, 20011231);
+ gcc_assert (TREE_CODE (type) != METHOD_TYPE);
if (TREE_CODE (type) == FUNCTION_TYPE)
{
/* This is really a method type. The cv qualifiers of the
bool is_template;
tree template_args;
- my_friendly_assert (TREE_CODE (qualified_id) == SCOPE_REF, 20030706);
+ gcc_assert (TREE_CODE (qualified_id) == SCOPE_REF);
/* Figure out what name to look up. */
name = TREE_OPERAND (qualified_id, 1);
{
case PARM_DECL:
r = retrieve_local_specialization (t);
- my_friendly_assert (r != NULL, 20020903);
+ gcc_assert (r != NULL);
mark_used (r);
return r;
if (tmpl == error_mark_node)
return error_mark_node;
- my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 283);
+ gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
/* If this function is a clone, handle it specially. */
if (DECL_CLONED_FUNCTION_P (tmpl))
tree fntype;
int result;
- my_friendly_assert (TREE_CODE (fn) == TEMPLATE_DECL, 0);
+ gcc_assert (TREE_CODE (fn) == TEMPLATE_DECL);
fntype = TREE_TYPE (fn);
if (explicit_targs)
tree parms, args;
int len;
- my_friendly_assert (TREE_CODE (tparms) == TREE_VEC, 289);
- my_friendly_assert (xparms == NULL_TREE
- || TREE_CODE (xparms) == TREE_LIST, 290);
- my_friendly_assert (!xargs || TREE_CODE (xargs) == TREE_LIST, 291);
- my_friendly_assert (ntparms > 0, 292);
+ gcc_assert (TREE_CODE (tparms) == TREE_VEC);
+ gcc_assert (xparms == NULL_TREE || TREE_CODE (xparms) == TREE_LIST);
+ gcc_assert (!xargs || TREE_CODE (xargs) == TREE_LIST);
+ gcc_assert (ntparms > 0);
switch (strict)
{
if (!TYPE_P (arg))
{
- my_friendly_assert (TREE_TYPE (arg) != NULL_TREE, 293);
+ gcc_assert (TREE_TYPE (arg) != NULL_TREE);
if (type_unknown_p (arg))
{
/* [temp.deduct.type] A template-argument can be deduced from
tree rval;
tree arg_binfo;
- my_friendly_assert (IS_AGGR_TYPE_CODE (TREE_CODE (arg)), 92);
+ gcc_assert (IS_AGGR_TYPE_CODE (TREE_CODE (arg)));
arg_binfo = TYPE_BINFO (complete_type (arg));
if (!arg_binfo)
/* If the DECL was not unregistered then something peculiar is
happening: we created a specialization but did not call
register_specialization for it. */
- my_friendly_assert (unregistered, 0);
+ gcc_assert (unregistered);
/* Make sure that we can see identifiers, and compute access
correctly. */
cannot restructure the loop to just keep going until we find
a template with a definition, since that might go too far if
a specialization was declared, but not defined. */
- my_friendly_assert (!(TREE_CODE (decl) == VAR_DECL
- && !DECL_IN_AGGR_P (DECL_TEMPLATE_RESULT (tmpl))),
- 0);
+ gcc_assert (TREE_CODE (decl) != VAR_DECL
+ || DECL_IN_AGGR_P (DECL_TEMPLATE_RESULT (tmpl)));
/* Fetch the more general template. */
tmpl = DECL_TI_TEMPLATE (tmpl);
/* This function should only be used to instantiate templates for
functions and static member variables. */
- my_friendly_assert (TREE_CODE (d) == FUNCTION_DECL
- || TREE_CODE (d) == VAR_DECL, 0);
+ gcc_assert (TREE_CODE (d) == FUNCTION_DECL
+ || TREE_CODE (d) == VAR_DECL);
/* Variables are never deferred; if instantiation is required, they
are instantiated right away. That allows for better code in the
/* We should have set up DECL_INITIAL in instantiate_class_template
for in-class definitions of static data members. */
- my_friendly_assert (!(TREE_CODE (d) == VAR_DECL
- && DECL_INITIALIZED_IN_CLASS_P (d)
- && DECL_INITIAL (d) == NULL_TREE),
- 20040726);
+ gcc_assert (!(TREE_CODE (d) == VAR_DECL
+ && DECL_INITIALIZED_IN_CLASS_P (d)
+ && DECL_INITIAL (d) == NULL_TREE));
/* Do not instantiate templates that we know will be defined
elsewhere. */
tmpl_parm = TREE_CHAIN (tmpl_parm);
spec_parm = TREE_CHAIN (spec_parm);
}
- my_friendly_assert (!spec_parm, 20020813);
+ gcc_assert (!spec_parm);
/* Substitute into the body of the function. */
tsubst_expr (DECL_SAVED_TREE (code_pattern), args,
/* There should be as many levels of arguments as there are levels
of parameters. */
- my_friendly_assert (parm_depth == TMPL_ARGS_DEPTH (targs), 0);
+ gcc_assert (parm_depth == TMPL_ARGS_DEPTH (targs));
fn_type = TREE_TYPE (tmpl);
tree scope;
tree name;
- my_friendly_assert (TREE_CODE (expression) == SCOPE_REF, 20030714);
+ gcc_assert (TREE_CODE (expression) == SCOPE_REF);
if (!TYPE_P (TREE_OPERAND (expression, 0)))
return true;
/* If there are no operands, it must be an expression such
as "int()". This should not happen for aggregate types
because it would form non-constant expressions. */
- my_friendly_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type),
- 20040318);
+ gcc_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type));
return false;
}
int quals;
bool pop_p;
- my_friendly_assert (TREE_CODE (type) == TYPENAME_TYPE,
- 20010702);
+ gcc_assert (TREE_CODE (type) == TYPENAME_TYPE);
scope = TYPE_CONTEXT (type);
name = TYPE_IDENTIFIER (type);
int
repo_emit_p (tree decl)
{
- my_friendly_assert (TREE_PUBLIC (decl), 20040725);
- my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == VAR_DECL,
- 20040725);
- my_friendly_assert (!DECL_REALLY_EXTERN (decl), 20040725);
+ gcc_assert (TREE_PUBLIC (decl));
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == VAR_DECL);
+ gcc_assert (!DECL_REALLY_EXTERN (decl));
/* When not using the repository, emit everything. */
if (!flag_use_repository)
tree offset;
tree index;
- my_friendly_assert (TREE_CODE (type) == POINTER_TYPE, 20000112);
+ gcc_assert (TREE_CODE (type) == POINTER_TYPE);
type = TREE_TYPE (type);
if (!TYPE_POLYMORPHIC_P (type))
pushdecl_top_level_and_finish (d, NULL_TREE);
/* Add decl to the global array of tinfo decls. */
- my_friendly_assert (unemitted_tinfo_decls != 0, 20030312);
+ gcc_assert (unemitted_tinfo_decls != 0);
VARRAY_PUSH_TREE (unemitted_tinfo_decls, d);
}
static tree
get_pseudo_ti_init (tree type, tree var_desc)
{
- my_friendly_assert (at_eof, 20021120);
+ gcc_assert (at_eof);
switch (TREE_CODE (type))
{
case OFFSET_TYPE:
static void
create_tinfo_types (void)
{
- my_friendly_assert (!ti_desc_type_node, 20020609);
+ gcc_assert (!ti_desc_type_node);
push_nested_namespace (abi_node);
int in_library = typeinfo_in_lib_p (type);
tree var_desc, var_init;
- my_friendly_assert (DECL_TINFO_P (decl), 20030307);
+ gcc_assert (DECL_TINFO_P (decl));
if (in_library)
{
bk = bk_proper_base;
/* Fall through. */
case bk_proper_base:
- my_friendly_assert (found == bk_not_base, 20010723);
+ gcc_assert (found == bk_not_base);
found = bk;
break;
*kind_ptr = bk_not_base;
return error_mark_node;
}
- my_friendly_assert (TYPE_P (base), 20011127);
+ gcc_assert (TYPE_P (base));
if (!TYPE_P (t))
{
#ifdef GATHER_STATISTICS
n_fields_searched++;
#endif /* GATHER_STATISTICS */
- my_friendly_assert (DECL_P (field), 0);
+ gcc_assert (DECL_P (field));
if (DECL_NAME (field) == NULL_TREE
&& ANON_AGGR_TYPE_P (TREE_TYPE (field)))
{
else if (decl_access == access_private_node)
access = ak_private;
else
- my_friendly_assert (false, 20030217);
+ gcc_unreachable ();
}
}
{
tree baselink;
- my_friendly_assert (TREE_CODE (functions) == FUNCTION_DECL
- || TREE_CODE (functions) == TEMPLATE_DECL
- || TREE_CODE (functions) == TEMPLATE_ID_EXPR
- || TREE_CODE (functions) == OVERLOAD,
- 20020730);
- my_friendly_assert (!optype || TYPE_P (optype), 20020730);
- my_friendly_assert (TREE_TYPE (functions), 20020805);
+ gcc_assert (TREE_CODE (functions) == FUNCTION_DECL
+ || TREE_CODE (functions) == TEMPLATE_DECL
+ || TREE_CODE (functions) == TEMPLATE_ID_EXPR
+ || TREE_CODE (functions) == OVERLOAD);
+ gcc_assert (!optype || TYPE_P (optype));
+ gcc_assert (TREE_TYPE (functions));
baselink = make_node (BASELINK);
TREE_TYPE (baselink) = TREE_TYPE (functions);
const char *errstr = 0;
- my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030624);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (TREE_CODE (xbasetype) == TREE_BINFO)
{
}
else
{
- my_friendly_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)), 20030624);
+ gcc_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)));
type = xbasetype;
xbasetype = NULL_TREE;
}
{
tree base;
- my_friendly_assert (CLASS_TYPE_P (context_class), 20020808);
+ gcc_assert (CLASS_TYPE_P (context_class));
/* Look for the QUALIFYING_SCOPE as a base of the CONTEXT_CLASS.
Because we do not yet know which function will be chosen by
}
else
{
- my_friendly_assert (BINFO_TYPE (here) == BINFO_TYPE (binfo), 20030202);
+ gcc_assert (BINFO_TYPE (here) == BINFO_TYPE (binfo));
result = here;
}
- my_friendly_assert (result, 20030202);
+ gcc_assert (result);
return result;
}
if (deferred_access_no_check)
return;
- my_friendly_assert (TREE_CODE (binfo) == TREE_BINFO, 20030623);
+ gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
ptr = VEC_last (deferred_access, deferred_access_stack);
tree
finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
{
- my_friendly_assert (TREE_CODE (decl) == FIELD_DECL, 20020909);
+ gcc_assert (TREE_CODE (decl) == FIELD_DECL);
if (!object)
{
build_tree_list (NULL_TREE, expr),
type, LOOKUP_NORMAL);
expr = build_cplus_new (type, expr);
- my_friendly_assert (TREE_CODE (expr) == TARGET_EXPR, 20030729);
+ gcc_assert (TREE_CODE (expr) == TARGET_EXPR);
}
}
the statement expression itself as the target's init
expr. Finally, return the target expression. */
tree init, target_expr = EXPR_STMT_EXPR (result_stmt);
- my_friendly_assert (TREE_CODE (target_expr) == TARGET_EXPR, 20030729);
+ gcc_assert (TREE_CODE (target_expr) == TARGET_EXPR);
/* The initializer will be void if the initialization is done by
AGGR_INIT_EXPR; propagate that out to the statement-expression as
return error_mark_node;
/* ARGS should be a list of arguments. */
- my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST,
- 20020712);
+ gcc_assert (!args || TREE_CODE (args) == TREE_LIST);
orig_fn = fn;
orig_args = args;
if (destructor == error_mark_node)
return error_mark_node;
- my_friendly_assert (TYPE_P (destructor), 20010905);
+ gcc_assert (TYPE_P (destructor));
if (!processing_template_decl)
{
DECL_ARTIFICIAL (decl) = 1;
end_template_decl ();
- my_friendly_assert (DECL_TEMPLATE_PARMS (tmpl), 20010110);
+ gcc_assert (DECL_TEMPLATE_PARMS (tmpl));
return finish_template_type_parm (aggr, tmpl);
}
return;
/* We should see only one DECL at a time. */
- my_friendly_assert (TREE_CHAIN (decl) == NULL_TREE, 0);
+ gcc_assert (TREE_CHAIN (decl) == NULL_TREE);
/* Set up access control for DECL. */
TREE_PRIVATE (decl)
}
}
else
- my_friendly_assert (!DECL_THUNKS (thunk), 20031023);
+ gcc_assert (!DECL_THUNKS (thunk));
}
}
}
{
tree slot;
- my_friendly_assert (!VOID_TYPE_P (type), 20040130);
+ gcc_assert (!VOID_TYPE_P (type));
if (TREE_CODE (init) == TARGET_EXPR)
return init;
{
tree slot;
- my_friendly_assert (!VOID_TYPE_P (type), 20040130);
+ gcc_assert (!VOID_TYPE_P (type));
slot = build_local_temp (type);
return build_target_expr (slot, init);
int ix;
tree base_binfo;
- my_friendly_assert (!BINFO_DEPENDENT_BASE_P (binfo), 20040712);
- my_friendly_assert (type == BINFO_TYPE (binfo), 20040714);
+ gcc_assert (!BINFO_DEPENDENT_BASE_P (binfo));
+ gcc_assert (type == BINFO_TYPE (binfo));
BINFO_OFFSET (new_binfo) = BINFO_OFFSET (binfo);
BINFO_VIRTUALS (new_binfo) = BINFO_VIRTUALS (binfo);
{
tree new_base_binfo;
- my_friendly_assert (!BINFO_DEPENDENT_BASE_P (base_binfo), 20040713);
+ gcc_assert (!BINFO_DEPENDENT_BASE_P (base_binfo));
new_base_binfo = copy_binfo (base_binfo, BINFO_TYPE (base_binfo),
t, igo_prev,
BINFO_VIRTUAL_P (base_binfo));
tree
get_first_fn (tree from)
{
- my_friendly_assert (is_overloaded_fn (from), 9);
+ gcc_assert (is_overloaded_fn (from));
/* A baselink is also considered an overloaded function. */
if (BASELINK_P (from))
from = BASELINK_FUNCTIONS (from);
return same_type_p (t1, t2);
}
- my_friendly_assert (0, 20030617);
+ gcc_unreachable ();
return false;
}
tree attributes;
/* FIXME: Attributes. */
- my_friendly_assert (ARITHMETIC_TYPE_P (t1)
- || TREE_CODE (t1) == COMPLEX_TYPE
- || TREE_CODE (t1) == ENUMERAL_TYPE,
- 19990725);
- my_friendly_assert (ARITHMETIC_TYPE_P (t2)
- || TREE_CODE (t2) == COMPLEX_TYPE
- || TREE_CODE (t2) == ENUMERAL_TYPE,
- 19990725);
+ gcc_assert (ARITHMETIC_TYPE_P (t1)
+ || TREE_CODE (t1) == COMPLEX_TYPE
+ || TREE_CODE (t1) == ENUMERAL_TYPE);
+ gcc_assert (ARITHMETIC_TYPE_P (t2)
+ || TREE_CODE (t2) == COMPLEX_TYPE
+ || TREE_CODE (t2) == ENUMERAL_TYPE);
/* In what follows, we slightly generalize the rules given in [expr] so
as to deal with `long long' and `complex'. First, merge the
if (t1 == error_mark_node || t2 == error_mark_node)
return false;
- my_friendly_assert (TYPE_P (t1) && TYPE_P (t2), 20030623);
+ gcc_assert (TYPE_P (t1) && TYPE_P (t2));
/* TYPENAME_TYPEs should be resolved if the qualifying scope is the
current instantiation. */
tree value;
const char *op_name;
- my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720);
+ gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR);
if (type == error_mark_node)
return error_mark_node;
tree promoted_type;
type = TREE_TYPE (expr);
- my_friendly_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type), 20030703);
+ gcc_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type));
promoted_type = type_promotes_to (type);
if (type != promoted_type)
expr = cp_convert (promoted_type, expr);
if (TREE_CODE (member) == PSEUDO_DTOR_EXPR)
return member;
- my_friendly_assert (DECL_P (member) || BASELINK_P (member),
- 20020801);
+ gcc_assert (DECL_P (member) || BASELINK_P (member));
/* [expr.ref]
/*nonnull=*/1);
/* If we found the base successfully then we should be able
to convert to it successfully. */
- my_friendly_assert (object != error_mark_node,
- 20020801);
+ gcc_assert (object != error_mark_node);
}
/* Complain about other invalid uses of offsetof, even though they will
if (BASELINK_P (name))
{
/* A member function that has already been looked up. */
- my_friendly_assert ((TREE_CODE (BASELINK_FUNCTIONS (name))
- == TEMPLATE_ID_EXPR),
- 20020805);
+ gcc_assert (TREE_CODE (BASELINK_FUNCTIONS (name)) == TEMPLATE_ID_EXPR);
member = name;
}
else
or a BIT_NOT_EXPR. */
scope = TREE_OPERAND (name, 0);
name = TREE_OPERAND (name, 1);
- my_friendly_assert ((CLASS_TYPE_P (scope)
- || TREE_CODE (scope) == NAMESPACE_DECL),
- 20020804);
- my_friendly_assert ((TREE_CODE (name) == IDENTIFIER_NODE
- || TREE_CODE (name) == BIT_NOT_EXPR),
- 20020804);
+ gcc_assert (CLASS_TYPE_P (scope)
+ || TREE_CODE (scope) == NAMESPACE_DECL);
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE
+ || TREE_CODE (name) == BIT_NOT_EXPR);
/* If SCOPE is a namespace, then the qualified name does not
name a member of OBJECT_TYPE. */
routine directly because it expects the object to be of class
type. */
ptrmem_type = TREE_TYPE (ptrmem);
- my_friendly_assert (TYPE_PTRMEMFUNC_P (ptrmem_type), 20020804);
+ gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type));
member = lookup_member (ptrmem_type, member_name, /*protect=*/0,
/*want_type=*/false);
member_type = cp_build_qualified_type (TREE_TYPE (member),
/* We can only get here with a single static member
function. */
- my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL
- && DECL_STATIC_FUNCTION_P (fn),
- 20030906);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
+ && DECL_STATIC_FUNCTION_P (fn));
mark_used (fn);
addr = build_address (fn);
if (TREE_SIDE_EFFECTS (TREE_OPERAND (arg, 0)))
{
tree t;
- my_friendly_assert (TREE_CODE (arg) != SCOPE_REF, 313);
+ gcc_assert (TREE_CODE (arg) != SCOPE_REF);
if (TREE_CODE (arg) != OFFSET_REF)
return 0;
case VAR_DECL:
/* Caller should not be trying to mark initialized
constant fields addressable. */
- my_friendly_assert (DECL_LANG_SPECIFIC (x) == 0
- || DECL_IN_AGGR_P (x) == 0
- || TREE_STATIC (x)
- || DECL_EXTERNAL (x), 314);
+ gcc_assert (DECL_LANG_SPECIFIC (x) == 0
+ || DECL_IN_AGGR_P (x) == 0
+ || TREE_STATIC (x)
+ || DECL_EXTERNAL (x));
/* Fall through. */
case CONST_DECL:
value with the RHS producing the value we should actually
store into the LHS. */
- my_friendly_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE),
- 978652);
+ gcc_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE));
lhs = stabilize_reference (lhs);
newrhs = cp_build_binary_op (modifycode, lhs, rhs);
if (newrhs == error_mark_node)
/* Now it looks like a plain assignment. */
modifycode = NOP_EXPR;
}
- my_friendly_assert (TREE_CODE (lhstype) != REFERENCE_TYPE, 20011220);
- my_friendly_assert (TREE_CODE (TREE_TYPE (newrhs)) != REFERENCE_TYPE,
- 20011220);
+ gcc_assert (TREE_CODE (lhstype) != REFERENCE_TYPE);
+ gcc_assert (TREE_CODE (TREE_TYPE (newrhs)) != REFERENCE_TYPE);
}
/* The left-hand side must be an lvalue. */
}
/* Just adjust the DELTA field. */
- my_friendly_assert
- (same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (delta),
- ptrdiff_type_node),
- 20030727);
+ gcc_assert (same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (delta), ptrdiff_type_node));
if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
delta = cp_build_binary_op (PLUS_EXPR, delta, n);
return instantiate_type (type, pfn, tf_error | tf_warning);
fn = TREE_OPERAND (pfn, 0);
- my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 0);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
return make_ptrmem_cst (to_type, fn);
}
tree fn = PTRMEM_CST_MEMBER (cst);
tree ptr_class, fn_class;
- my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 0);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
/* The class that the function belongs to. */
fn_class = DECL_CONTEXT (fn);
return value, the named return value is used. */
result = DECL_RESULT (current_function_decl);
valtype = TREE_TYPE (result);
- my_friendly_assert (valtype != NULL_TREE, 19990924);
+ gcc_assert (valtype != NULL_TREE);
fn_returns_value_p = !VOID_TYPE_P (valtype);
if (!retval && DECL_NAME (result) && fn_returns_value_p)
retval = result;
struct pending_abstract_type *pat;
location_t cur_loc = input_location;
- my_friendly_assert (COMPLETE_TYPE_P (type), 20040620_3);
+ gcc_assert (COMPLETE_TYPE_P (type));
if (!abstract_pending_vars)
return;
if (!slot)
return;
pat = (struct pending_abstract_type*)*slot;
- my_friendly_assert (pat, 20040620_2);
+ gcc_assert (pat);
/* If the type is not abstract, do not do anything. */
if (CLASSTYPE_PURE_VIRTUALS (type))
element: it will issue a diagostic if the type is abstract. */
while (pat)
{
- my_friendly_assert (type == pat->type, 20040620_4);
+ gcc_assert (type == pat->type);
/* Tweak input_location so that the diagnostic appears at the correct
location. Notice that this is only needed if the decl is an
void **slot;
struct pending_abstract_type *pat;
- my_friendly_assert (!decl || (DECL_P (decl)
- || TREE_CODE (decl) == IDENTIFIER_NODE),
- 20040620_1);
+ gcc_assert (!decl || DECL_P (decl)
+ || TREE_CODE (decl) == IDENTIFIER_NODE);
if (!abstract_pending_vars)
abstract_pending_vars = htab_create_ggc (31, &pat_calc_hash,
TREE_VALUE (tail), &tail1);
if (next1 == error_mark_node)
return next1;
- my_friendly_assert
- (same_type_ignoring_top_level_qualifiers_p
- (TREE_TYPE (type), TREE_TYPE (next1)),
- 981123);
- my_friendly_assert (tail1 == 0
- || TREE_CODE (tail1) == TREE_LIST, 319);
+ gcc_assert (same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (type), TREE_TYPE (next1)));
+ gcc_assert (!tail1 || TREE_CODE (tail1) == TREE_LIST);
if (tail == tail1 && len < 0)
{
error ("non-empty initializer for array of empty elements");
next1 = digest_init (TREE_TYPE (field),
TREE_VALUE (tail), &tail1);
- my_friendly_assert (tail1 == 0
- || TREE_CODE (tail1) == TREE_LIST, 320);
+ gcc_assert (!tail1 || TREE_CODE (tail1) == TREE_LIST);
tail = tail1;
}
else
if (spec == error_mark_node)
return list;
- my_friendly_assert (spec && (!list || TREE_VALUE (list)), 19990317);
+ gcc_assert (spec && (!list || TREE_VALUE (list)));
/* [except.spec] 1, type in an exception specifier shall not be
incomplete, or pointer or ref to incomplete other than pointer