+2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (check_dtor_name): Replace abort with gcc_assert or
+ gcc_unreachable.
+ (build_call, add_builtin_candidate, build_new_op,
+ convert_like_real, build_over_call, in_charge_arg_for_name,
+ source_type, joust): Likewise.
+ * class.c (build_simple_base_path, get_vcall_index,
+ finish_struct_1, instantiate_type, get_enclosing_class,
+ add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
+ * cp-gimplify.c (cp_genericize): Likewise.
+ * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
+ * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
+ * decl.c (poplevel, make_unbound_class_template, reshape_init,
+ check_special_function_return_type, grokdeclarator,
+ grok_op_properties, tag_name, xref_tag, start_preparsed_function,
+ finish_function): Likewise.
+ * decl2.c (grokfield, maybe_emit_vtables):Likewise.
+ * error.c (dump_global_iord, dump_decl, dump_template_decl,
+ language_to_string): Likewise.
+ * except.c (choose_personality_routine): Likewise.
+ * friend.c (do_friend): Likewise.
+ * g++spec.c (lang_specific_driver): Likewise.
+ * init.c (build_zero_init, expand_default_init, build_new_1,
+ build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
+ * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
+ * mangle.c (add_substitution, write_unscoped_name,
+ write_template_prefix, write_identifier,
+ write_special_name_destructor, write_type, write_builtin_type,
+ write_expression, write_template_param,
+ write_java_integer_type_codes): Likewise.
+ * method.c (implicitly_declare_fn): Likewise.
+
2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
else
name = get_type_value (name);
}
- /* In the case of:
-
- template <class T> struct S { ~S(); };
- int i;
- i.~S();
-
- NAME will be a class template. */
- else if (DECL_CLASS_TEMPLATE_P (name))
- return false;
else
- abort ();
+ {
+ /* In the case of:
+
+ template <class T> struct S { ~S(); };
+ int i;
+ i.~S();
+
+ NAME will be a class template. */
+ gcc_assert (DECL_CLASS_TEMPLATE_P (name));
+ return false;
+ }
if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name))
return true;
/* We invoke build_call directly for several library functions.
These may have been declared normally if we're building libgcc,
so we can't just check DECL_ARTIFICIAL. */
- if (DECL_ARTIFICIAL (decl)
- || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2))
- mark_used (decl);
- else
- abort ();
+ gcc_assert (DECL_ARTIFICIAL (decl)
+ || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
+ "__", 2));
+ mark_used (decl);
}
/* Don't pass empty class objects by value. This is useful
return;
default:
- abort ();
+ gcc_unreachable ();
}
type1 = build_reference_type (type1);
break;
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* If we're dealing with two pointer types or two enumeral types,
case VEC_DELETE_EXPR:
case DELETE_EXPR:
/* Use build_op_new_call and build_op_delete_call instead. */
- abort ();
+ gcc_unreachable ();
case CALL_EXPR:
return build_object_call (arg1, arg2);
if (result || result_valid_p)
return result;
-builtin:
+ builtin:
switch (code)
{
case MODIFY_EXPR:
return NULL_TREE;
default:
- abort ();
- return NULL_TREE;
+ gcc_unreachable ();
}
+ return NULL_TREE;
}
/* Build a call to operator delete. This has to be handled very specially,
0);
args = build_tree_list (NULL_TREE, expr);
- if (DECL_HAS_IN_CHARGE_PARM_P (convfn)
- || DECL_HAS_VTT_PARM_P (convfn))
- /* We should never try to call the abstract or base constructor
- from here. */
- abort ();
+ /* We should never try to call the abstract or base constructor
+ from here. */
+ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (convfn)
+ && !DECL_HAS_VTT_PARM_P (convfn));
args = tree_cons (NULL_TREE, t, args);
}
else
converted_args = tree_cons (NULL_TREE, TREE_VALUE (arg), converted_args);
arg = TREE_CHAIN (arg);
parm = TREE_CHAIN (parm);
- if (DECL_HAS_IN_CHARGE_PARM_P (fn))
- /* We should never try to call the abstract constructor. */
- abort ();
+ /* We should never try to call the abstract constructor. */
+ gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (fn));
+
if (DECL_HAS_VTT_PARM_P (fn))
{
converted_args = tree_cons
}
/* Returns the value to use for the in-charge parameter when making a
- call to a function with the indicated NAME. */
+ call to a function with the indicated NAME.
+
+ FIXME:Can't we find a neater way to do this mapping? */
tree
in_charge_arg_for_name (tree name)
{
- if (name == base_ctor_identifier
+ if (name == base_ctor_identifier
|| name == base_dtor_identifier)
return integer_zero_node;
else if (name == complete_ctor_identifier)
/* This function should only be called with one of the names listed
above. */
- abort ();
+ gcc_unreachable ();
return NULL_TREE;
}
|| t->kind == ck_identity)
return t->type;
}
- abort ();
+ gcc_unreachable ();
}
/* Note a warning about preferring WINNER to LOSER. We do this by storing
len = cand1->num_convs;
if (len != cand2->num_convs)
{
- if (DECL_STATIC_FUNCTION_P (cand1->fn)
- && ! DECL_STATIC_FUNCTION_P (cand2->fn))
+ int static_1 = DECL_STATIC_FUNCTION_P (cand1->fn);
+ int static_2 = DECL_STATIC_FUNCTION_P (cand2->fn);
+
+ gcc_assert (static_1 != static_2);
+
+ if (static_1)
off2 = 1;
- else if (! DECL_STATIC_FUNCTION_P (cand1->fn)
- && DECL_STATIC_FUNCTION_P (cand2->fn))
+ else
{
off1 = 1;
--len;
}
- else
- abort ();
}
for (i = 0; i < len; ++i)
if (d_binfo == NULL_TREE)
{
- if (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) != type)
- abort ();
+ gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type);
return expr;
}
NULL_TREE, false);
/* Didn't find the base field?!? */
- abort ();
+ gcc_unreachable ();
}
/* Convert OBJECT to the base TYPE. If CHECK_ACCESS is true, an error
return p->value;
/* There should always be an appropriate index. */
- abort ();
-
- return NULL_TREE;
+ gcc_unreachable ();
}
/* Update an entry in the vtable for BINFO, which is in the hierarchy
if (COMPLETE_TYPE_P (t))
{
- if (IS_AGGR_TYPE (t))
- error ("redefinition of `%#T'", t);
- else
- abort ();
+ gcc_assert (IS_AGGR_TYPE (t));
+ error ("redefinition of `%#T'", t);
popclass ();
return;
}
case CONVERT_EXPR:
case SAVE_EXPR:
case CONSTRUCTOR:
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
case INDIRECT_REF:
case ARRAY_REF:
case CALL_EXPR:
/* This is too hard for now. */
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
case PLUS_EXPR:
case MINUS_EXPR:
return error_mark_node;
default:
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
}
+ return error_mark_node;
}
\f
/* Return the name of the virtual function pointer field
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
return NULL_TREE;
might be a lost primary, so just skip down to vid->binfo. */
if (BINFO_VIRTUAL_P (non_primary_binfo))
{
- if (non_primary_binfo != vid->vbase)
- abort ();
+ gcc_assert (non_primary_binfo == vid->vbase);
non_primary_binfo = vid->binfo;
break;
}
fndecl = BV_FN (v);
#ifdef ENABLE_CHECKING
- if (!tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref), DECL_VINDEX (fndecl)))
- abort ();
+ gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref),
+ DECL_VINDEX (fndecl)));
#endif
return build_address (fndecl);
/* Fix up the types of parms passed by invisible reference. */
for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t))
{
- if (DECL_BY_REFERENCE (t))
- abort ();
+ gcc_assert (!DECL_BY_REFERENCE (t));
if (TREE_ADDRESSABLE (TREE_TYPE (t)))
{
- if (DECL_ARG_TYPE (t) == TREE_TYPE (t))
- abort ();
+ gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t));
TREE_TYPE (t) = DECL_ARG_TYPE (t);
DECL_BY_REFERENCE (t) = 1;
TREE_ADDRESSABLE (t) = 0;
/* The backend should not be interested in the size of an expression
of a type with both of these set; all copies of such types must go
through a constructor or assignment op. */
- if (TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (exp))
- && TYPE_HAS_COMPLEX_ASSIGN_REF (TREE_TYPE (exp))
- /* But storing a CONSTRUCTOR isn't a copy. */
- && TREE_CODE (exp) != CONSTRUCTOR)
- abort ();
+ gcc_assert (!TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (exp))
+ || !TYPE_HAS_COMPLEX_ASSIGN_REF (TREE_TYPE (exp))
+ /* But storing a CONSTRUCTOR isn't a copy. */
+ || TREE_CODE (exp) == CONSTRUCTOR);
+
/* This would be wrong for a type with virtual bases, but they are
- caught by the abort above. */
+ caught by the assert above. */
return (is_empty_class (TREE_TYPE (exp))
? size_zero_node
: CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)));
case DEFAULT_ARG: return sizeof (struct tree_default_arg);
case OVERLOAD: return sizeof (struct tree_overload);
default:
- abort ();
+ gcc_unreachable ();
}
/* NOTREACHED */
}
if (TYPE_PRECISION (intype) == POINTER_SIZE)
return build1 (CONVERT_EXPR, type, expr);
expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
- /* Modes may be different but sizes should be the same. */
- if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
- != GET_MODE_SIZE (TYPE_MODE (type)))
- /* There is supposed to be some integral type
- that is the same width as a pointer. */
- abort ();
+ /* Modes may be different but sizes should be the same. There
+ is supposed to be some integral type that is the same width
+ as a pointer. */
+ gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
+ == GET_MODE_SIZE (TYPE_MODE (type)));
+
return convert_to_pointer (type, expr);
}
/* Don't build a NOP_EXPR of class type. Instead, change the
type of the temporary. Only allow this for cv-qual changes,
though. */
- if (!same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
- TYPE_MAIN_VARIANT (type)))
- abort ();
+ gcc_assert (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
+ TYPE_MAIN_VARIANT (type)));
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e;
}
- else if (TREE_ADDRESSABLE (type))
- /* We shouldn't be treating objects of ADDRESSABLE type as rvalues. */
- abort ();
else
- return fold (build1 (NOP_EXPR, type, e));
+ {
+ /* We shouldn't be treating objects of ADDRESSABLE type as
+ rvalues. */
+ gcc_assert (!TREE_ADDRESSABLE (type));
+ return fold (build1 (NOP_EXPR, type, e));
+ }
}
if (code == VOID_TYPE && (convtype & CONV_STATIC))
}
else
{
+ tree name;
+
/* Remove the binding. */
decl = link;
if (TREE_CODE (decl) == TREE_LIST)
decl = TREE_VALUE (decl);
+ name = decl;
+
+ if (TREE_CODE (name) == OVERLOAD)
+ name = OVL_FUNCTION (name);
- if (DECL_P (decl))
- pop_binding (DECL_NAME (decl), decl);
- else if (TREE_CODE (decl) == OVERLOAD)
- pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl);
- else
- abort ();
+ gcc_assert (DECL_P (name));
+ pop_binding (DECL_NAME (name), decl);
}
}
name = TYPE_IDENTIFIER (name);
else if (DECL_P (name))
name = DECL_NAME (name);
- if (TREE_CODE (name) != IDENTIFIER_NODE)
- abort ();
+ gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (!dependent_type_p (context)
|| currently_open_class (context))
}
}
else
- abort ();
+ gcc_unreachable ();
/* The initializers were placed in reverse order in the
CONSTRUCTOR. */
break;
default:
- abort ();
- break;
+ gcc_unreachable ();
}
return type;
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
if (id_declarator->kind == cdk_id)
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
error ("unnamed variable or field declared void");
else if (TREE_CODE (unqualified_id) == IDENTIFIER_NODE)
{
- if (IDENTIFIER_OPNAME_P (unqualified_id))
- abort ();
- else
- error ("variable or field `%s' declared void", name);
+ gcc_assert (!IDENTIFIER_OPNAME_P (unqualified_id));
+ error ("variable or field `%s' declared void", name);
}
else
error ("variable or field declared void");
#include "operators.def"
#undef DEF_OPERATOR
- abort ();
+ gcc_unreachable ();
}
while (0);
gcc_assert (operator_code != LAST_CPLUS_TREE_CODE);
break;
default:
- abort ();
+ gcc_unreachable ();
}
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
case enum_type:
return "enum";
default:
- abort ();
+ gcc_unreachable ();
}
}
code = ENUMERAL_TYPE;
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (! globalize)
}
if (DECL_HAS_VTT_PARM_P (decl1))
{
- if (DECL_NAME (t) != vtt_parm_identifier)
- abort ();
+ gcc_assert (DECL_NAME (t) == vtt_parm_identifier);
current_vtt_parm = t;
}
}
if (current_binding_level->kind != sk_function_parms)
{
/* Make sure we have already experienced errors. */
- if (errorcount == 0)
- abort ();
+ gcc_assert (errorcount);
/* Throw away the broken statement tree and extra binding
levels. */
if (attrlist)
cplus_decl_attributes (&value, attrlist, 0);
- if (TREE_CODE (value) == VAR_DECL)
+ switch (TREE_CODE (value))
{
+ case VAR_DECL:
finish_static_data_member_decl (value, init, asmspec_tree,
flags);
return value;
- }
- if (TREE_CODE (value) == FIELD_DECL)
- {
+
+ case FIELD_DECL:
if (asmspec)
error ("`asm' specifiers are not permitted on non-static data members");
if (DECL_INITIAL (value) == error_mark_node)
DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1;
return value;
- }
- if (TREE_CODE (value) == FUNCTION_DECL)
- {
+
+ case FUNCTION_DECL:
if (asmspec)
set_user_assembler_name (value, asmspec);
if (!DECL_FRIEND_P (value))
DECL_IN_AGGR_P (value) = 1;
return value;
+
+ default:
+ gcc_unreachable ();
}
- abort ();
- /* NOTREACHED */
return NULL_TREE;
}
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
{
+ tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl));
+
/* It had better be all done at compile-time. */
- if (store_init_value (vtbl, DECL_INITIAL (vtbl)))
- abort ();
+ gcc_assert (!expr);
}
/* Write it out. */
else if (DECL_GLOBAL_DTOR_P (t))
p = "destructors";
else
- abort ();
+ gcc_unreachable ();
pp_printf (pp_base (cxx_pp), "(static %s for %s)", p, input_filename);
}
break;
case TYPE_EXPR:
- abort ();
+ gcc_unreachable ();
break;
/* These special cases are duplicated here so that other functions
| (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0)));
else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL)
dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME);
- else if (TREE_TYPE (t) == NULL_TREE)
- abort ();
else
- switch (NEXT_CODE (t))
{
- case METHOD_TYPE:
- case FUNCTION_TYPE:
- dump_function_decl (t, flags | TFF_TEMPLATE_NAME);
- break;
- default:
- /* This case can occur with some invalid code. */
- dump_type (TREE_TYPE (t),
- (flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME
- | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0));
+ gcc_assert (TREE_TYPE (t));
+ switch (NEXT_CODE (t))
+ {
+ case METHOD_TYPE:
+ case FUNCTION_TYPE:
+ dump_function_decl (t, flags | TFF_TEMPLATE_NAME);
+ break;
+ default:
+ /* This case can occur with some invalid code. */
+ dump_type (TREE_TYPE (t),
+ (flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME
+ | (flags & TFF_DECL_SPECIFIERS
+ ? TFF_CLASS_KEY_OR_ENUM : 0));
+ }
}
}
return "Java";
default:
- abort ();
- return 0;
+ gcc_unreachable ();
}
+ return 0;
}
/* Return the proper printed version of a parameter to a C++ function. */
break;
default:
- abort ();
+ gcc_unreachable ();
}
return;
declarator = DECL_NAME (get_first_fn (declarator));
}
- if (TREE_CODE (decl) != FUNCTION_DECL)
- abort ();
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
if (ctype)
{
arglist[j++] = "-xc++-header";
break;
default:
- abort ();
+ gcc_unreachable ();
}
arglist[j++] = argv[i];
arglist[j] = "-xnone";
inits);
CONSTRUCTOR_ELTS (init) = nreverse (inits);
}
- else if (TREE_CODE (type) == REFERENCE_TYPE)
- ;
else
- abort ();
+ gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
/* In all cases, the initializer is a constant. */
if (init)
&& (flags & LOOKUP_ONLYCONVERTING))
{
/* Base subobjects should only get direct-initialization. */
- if (true_exp != exp)
- abort ();
+ gcc_assert (true_exp == exp);
if (flags & DIRECT_BIND)
/* Do nothing. We hit this in two cases: Reference initialization,
if (TREE_CODE (init) == TREE_LIST)
init = build_x_compound_expr_from_list (init, "new initializer");
- else if (TREE_CODE (init) == CONSTRUCTOR
- && TREE_TYPE (init) == NULL_TREE)
- abort ();
+ else
+ gcc_assert (TREE_CODE (init) != CONSTRUCTOR
+ || TREE_TYPE (init) != NULL_TREE);
init_expr = build_modify_expr (init_expr, INIT_EXPR, init);
stable = stabilize_init (init_expr, &init_preeval_expr);
tree controller = NULL_TREE;
/* We should only have 1-D arrays here. */
- if (TREE_CODE (type) == ARRAY_TYPE)
- abort ();
+ gcc_assert (TREE_CODE (type) != ARRAY_TYPE);
if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
goto no_destructor;
else if (from)
elt_init = build_modify_expr (to, NOP_EXPR, from);
else
- abort ();
+ gcc_unreachable ();
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
break;
default:
- abort ();
+ gcc_unreachable ();
}
exp = convert_from_reference (exp);
SET_DECL_LANGUAGE (t, lang_c);
else if (current_lang_name == lang_name_java)
SET_DECL_LANGUAGE (t, lang_java);
- else abort ();
+ else
+ gcc_unreachable ();
#ifdef GATHER_STATISTICS
tree_node_counts[(int)lang_decl] += 1;
else if (rid == ridpointers[(int) RID_RESTRICT])
return TYPE_QUAL_RESTRICT;
- abort ();
+ gcc_unreachable ();
return TYPE_UNQUALIFIED;
}
for (i = VARRAY_ACTIVE_SIZE (G.substitutions); --i >= 0; )
{
const tree candidate = VARRAY_TREE (G.substitutions, i);
- if ((DECL_P (node)
- && node == candidate)
- || (TYPE_P (node)
- && TYPE_P (candidate)
- && same_type_p (node, candidate)))
- abort ();
+
+ gcc_assert (!(DECL_P (node) && node == candidate));
+ gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
+ && same_type_p (node, candidate)));
}
}
#endif /* ENABLE_CHECKING */
write_string ("St");
write_unqualified_name (decl);
}
- /* If not, it should be either in the global namespace, or directly
- in a local function scope. */
- else if (context == global_namespace
- || context == NULL
- || TREE_CODE (context) == FUNCTION_DECL)
- write_unqualified_name (decl);
- else
- abort ();
+ else
+ {
+ /* If not, it should be either in the global namespace, or directly
+ in a local function scope. */
+ gcc_assert (context == global_namespace
+ || context == NULL
+ || TREE_CODE (context) == FUNCTION_DECL);
+
+ write_unqualified_name (decl);
+ }
}
/* <unscoped-template-name> ::= <unscoped-name>
/* Find the template decl. */
if (decl_is_template_id (decl, &template_info))
template = TI_TEMPLATE (template_info);
- else if (CLASSTYPE_TEMPLATE_ID_P (type))
- template = TYPE_TI_TEMPLATE (type);
else
- /* Oops, not a template. */
- abort ();
+ {
+ gcc_assert (CLASSTYPE_TEMPLATE_ID_P (type));
+
+ template = TYPE_TI_TEMPLATE (type);
+ }
/* For a member template, though, the template name for the
innermost name must have all the outer template levels
static void
write_special_name_constructor (const tree ctor)
{
- if (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
- /* Even though we don't ever emit a definition of the
- old-style destructor, we still have to consider entities
- (like static variables) nested inside it. */
- || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor))
- write_string ("C1");
- else if (DECL_BASE_CONSTRUCTOR_P (ctor))
+ if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2");
else
- abort ();
+ {
+ gcc_assert (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
+ /* Even though we don't ever emit a definition of
+ the old-style destructor, we still have to
+ consider entities (like static variables) nested
+ inside it. */
+ || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor));
+ write_string ("C1");
+ }
}
/* Handle destructor productions of non-terminal <special-name>.
{
if (DECL_DELETING_DESTRUCTOR_P (dtor))
write_string ("D0");
- else if (DECL_COMPLETE_DESTRUCTOR_P (dtor)
- /* Even though we don't ever emit a definition of the
- old-style destructor, we still have to consider entities
- (like static variables) nested inside it. */
- || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor))
- write_string ("D1");
else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2");
else
- abort ();
+ {
+ gcc_assert (DECL_COMPLETE_DESTRUCTOR_P (dtor)
+ /* Even though we don't ever emit a definition of
+ the old-style destructor, we still have to
+ consider entities (like static variables) nested
+ inside it. */
+ || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor));
+ write_string ("D1");
+ }
}
/* Return the discriminator for ENTITY appearing inside
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
TYPE_UNSIGNED (type));
if (type == t)
{
- if (TYPE_PRECISION (type) == 128)
- write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
- else
- /* Couldn't find this type. */
- abort ();
+ gcc_assert (TYPE_PRECISION (type) == 128);
+ write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
}
else
{
else if (type == long_double_type_node)
write_char ('e');
else
- abort ();
+ gcc_unreachable ();
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
static void
write_template_arg_literal (const tree value)
{
- tree type = TREE_TYPE (value);
write_char ('L');
- write_type (type);
+ write_type (TREE_TYPE (value));
- if (TREE_CODE (value) == CONST_DECL)
- write_integer_cst (DECL_INITIAL (value));
- else if (TREE_CODE (value) == INTEGER_CST)
+ switch (TREE_CODE (value))
{
- if (same_type_p (type, boolean_type_node))
- {
- if (integer_zerop (value))
- write_unsigned_number (0);
- else if (integer_onep (value))
- write_unsigned_number (1);
- else
- abort ();
- }
- else
- write_integer_cst (value);
- }
- else if (TREE_CODE (value) == REAL_CST)
- write_real_cst (value);
- else
- abort ();
+ case CONST_DECL:
+ write_integer_cst (DECL_INITIAL (value));
+ break;
+
+ case INTEGER_CST:
+ gcc_assert (!same_type_p (TREE_TYPE (value), boolean_type_node)
+ || integer_zerop (value) || integer_onep (value));
+ write_integer_cst (value);
+ break;
+
+ case REAL_CST:
+ write_real_cst (value);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
write_char ('E');
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
write_char ('T');
else if (type == java_boolean_type_node)
write_char ('b');
else
- abort ();
+ gcc_unreachable ();
}
#include "gt-cp-mangle.h"
break;
}
default:
- abort ();
+ gcc_unreachable ();
}
/* Create the function. */
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_INLINE (fn) = 1;
- if (TREE_USED (fn))
- abort ();
+ gcc_assert (!TREE_USED (fn));
return fn;
}