diff options
| author | Nathan Sidwell <nathan@codesourcery.com> | 2004-08-30 16:03:48 +0000 |
|---|---|---|
| committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-30 16:03:48 +0000 |
| commit | 315fb5dbc92056fd5404e810acebbb2832b81ef8 (patch) | |
| tree | 5bef1416b58d33002abdc3fef59a0c970f5aaccc /gcc/cp/tree.c | |
| parent | e044819338009d646f06a398aba9a3ec920fecc7 (diff) | |
| download | gcc-315fb5dbc92056fd5404e810acebbb2832b81ef8.zip gcc-315fb5dbc92056fd5404e810acebbb2832b81ef8.tar.gz gcc-315fb5dbc92056fd5404e810acebbb2832b81ef8.tar.bz2 | |
name-lookup.c (pop_binding, [...]): Replace abort with gcc_assert or gcc_unreachable.
* name-lookup.c (pop_binding, pushdecl,
set_identifier_type_value_with_scope, push_overloaded_decl,
arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
* parser.c (cp_parser_diagnose_invalid_type_name,
cp_parser_postfix_expression, cp_parser_unary_expression,
cp_parser_check_declarator_template_para): Likewise.
* pt.c (push_inline_template_parms_recursive,
check_explicit_specialization, convert_nontype_argument,
coerce_template_template_parms, uses_template_parms,
instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
tsubst_expr, instantiate_template,
maybe_adjust_types_for_deduction, type_unification_real,
resolve_overloaded_unification, template_decl_level,
type_dependent_expression_p): Likewise.
* search.c (lookup_base_r): Likewise.
* semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
* tree.c (lvalue_p_1, count_functions, cxx_printable_name,
verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
* typeck.c (common_type, get_member_function_from_ptrfunc,
build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
* typeck2.c (cxx_incomplete_type_diagnostic,
split_nonconstant_init_1, store_init_value,
process_init_constructor): Likewise.
From-SVN: r86782
Diffstat (limited to 'gcc/cp/tree.c')
| -rw-r--r-- | gcc/cp/tree.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index ec5a749..2038b05 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -126,7 +126,7 @@ lvalue_p_1 (tree ref, /* A currently unresolved scope ref. */ case SCOPE_REF: - abort (); + gcc_unreachable (); case MAX_EXPR: case MIN_EXPR: op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 0), @@ -796,17 +796,14 @@ int count_functions (tree t) { int i; + if (TREE_CODE (t) == FUNCTION_DECL) return 1; - else if (TREE_CODE (t) == OVERLOAD) - { - for (i = 0; t; t = OVL_CHAIN (t)) - i++; - return i; - } - - abort (); - return 0; + gcc_assert (TREE_CODE (t) == OVERLOAD); + + for (i = 0; t; t = OVL_CHAIN (t)) + i++; + return i; } int @@ -915,8 +912,7 @@ cxx_printable_name (tree decl, int v) ring_counter += 1; if (ring_counter == PRINT_RING_SIZE) ring_counter = 0; - if (decl_ring[ring_counter] == current_function_decl) - abort (); + gcc_assert (decl_ring[ring_counter] != current_function_decl); } if (print_ring[ring_counter]) @@ -1016,8 +1012,7 @@ verify_stmt_tree_r (tree* tp, /* If this statement is already present in the hash table, then there is a circularity in the statement tree. */ - if (htab_find (*statements, t)) - abort (); + gcc_assert (!htab_find (*statements, t)); slot = htab_find_slot (*statements, t, INSERT); *slot = t; @@ -1371,13 +1366,8 @@ get_type_decl (tree t) return t; if (TYPE_P (t)) return TYPE_STUB_DECL (t); - if (t == error_mark_node) - return t; - - abort (); - - /* Stop compiler from complaining control reaches end of non-void function. */ - return 0; + gcc_assert (t == error_mark_node); + return t; } /* Returns the namespace that contains DECL, whether directly or @@ -2279,9 +2269,8 @@ stabilize_call (tree call, tree *initp) if (call == error_mark_node) return; - if (TREE_CODE (call) != CALL_EXPR - && TREE_CODE (call) != AGGR_INIT_EXPR) - abort (); + gcc_assert (TREE_CODE (call) == CALL_EXPR + || TREE_CODE (call) == AGGR_INIT_EXPR); for (t = TREE_OPERAND (call, 1); t; t = TREE_CHAIN (t)) if (TREE_SIDE_EFFECTS (TREE_VALUE (t))) |
