diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-27 17:59:33 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-27 17:59:33 +0000 |
commit | b4df430b603946f5cbb26e59231df8cf2bab711a (patch) | |
tree | 799c8fedd2cb98c51cb9c5f72999b3cc368ee8ca /gcc/cp/decl2.c | |
parent | 0f999733f8eb93c315f4a61664066a28bb9252a0 (diff) | |
download | gcc-b4df430b603946f5cbb26e59231df8cf2bab711a.tar.gz |
* 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/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index cb9628ca5d7..5da240f6075 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -338,7 +338,7 @@ grok_array_decl (tree array_expr, tree index_exp) } type = TREE_TYPE (array_expr); - my_friendly_assert (type, 20030626); + gcc_assert (type); type = non_reference (type); /* If they have an `operator[]', use that. */ @@ -473,7 +473,7 @@ check_member_template (tree tmpl) { 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 @@ -612,11 +612,9 @@ check_classfn (tree ctype, tree function, tree template_parms) 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); } @@ -765,7 +763,7 @@ void 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; @@ -1238,7 +1236,7 @@ coerce_new_type (tree 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); @@ -1272,7 +1270,7 @@ coerce_delete_type (tree 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), void_type_node)) e = 1, error ("`operator delete' must return type `%T'", void_type_node); @@ -1435,7 +1433,7 @@ import_export_class (tree ctype) 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; @@ -1520,13 +1518,12 @@ mark_needed (tree decl) 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. */ @@ -1622,7 +1619,7 @@ determine_visibility (tree decl) /* 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)) @@ -1640,8 +1637,8 @@ determine_visibility (tree 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; @@ -1705,7 +1702,7 @@ import_export_decl (tree decl) "-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. @@ -1728,25 +1725,22 @@ import_export_decl (tree decl) 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; @@ -1923,7 +1917,7 @@ build_cleanup (tree decl) /* 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. */ @@ -2378,7 +2372,7 @@ start_static_initialization_or_destruction (tree decl, int initp) { /* 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 @@ -2470,7 +2464,7 @@ do_static_destruction (tree decl) /* 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))) @@ -2511,7 +2505,7 @@ prune_vars_needing_no_initialization (tree *vars) } /* 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. */ @@ -3120,9 +3114,8 @@ build_offset_ref_call_from_tree (tree fn, tree args) 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); |