mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 03:56:43 +08:00
cp-tree.h (scratchalloc): Remove.
* cp-tree.h (scratchalloc): Remove. (build_scratch_list): Likewise. * call.c (convert_class_to_reference): Replace build_scratch_list and build_expr_list with build_tree_list. (add_candidate): Replace scratchalloc with expralloc. Note memory leak. (build_user_type_conversion_1): Replace build_scratch_list and build_expr_list with build_tree_list. (build_new_op): Likewise. (build_op_delete_call): Likewise. (convert_like): Likewise. * cvt.c (ocp_convert): Likewise. * decl.c (start_decl): Likewise. (start_function): Likewise. (finish_destructor_body): Likewise. (maybe_build_cleanup_1): Likewise. * decl2.c (reparse_decl_as_expr): Likewise. * init.c (perform_member_init): Likewise. (expand_cleanup_for_base): Likewise. (build_builtin_delete_call): Likewise. (build_new_1): Likewise. (build_delete): Likewise. * method.c (do_build_assign_ref): Likewise. * parse.y (already_scoped_stmt): Likewise. (nontrivial_exprlist): Likewise. (net_initializer): Likewise. (initlist): Likewise. * parse.c: Regenerated. * rtti.c (build_x_typeid): Likewise. (build_dynamic_cast_1): Likewise. * typeck.c (build_x_compound_expr): Likewise. (build_static_cast): Likewise. (build_modify_expr): Likewise. * cp-tree.h (DECL_VINDEX): Add documentation. * class.c (build_vtable_entry): Likewise. (start_vtable): Add comment. (add_virtual_function): Replace pending_hard_virtuals with overridden_virtuals and pending_virtuals with new_virtuals. Replace redundant assignments with assertions. (check_for_override): Add comment. (check_bases_and_members): Replace pending_hard_virtuals with overridden_virtuals and pending_virtuals with new_virtuals. (create_vtbl_ptr): Likewise. (layout_class_type): Likewise. (finish_struct_1): Likewise. Add comments. From-SVN: r31473
This commit is contained in:
parent
7af8555855
commit
051e6fd745
@ -1,3 +1,52 @@
|
||||
2000-01-17 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* cp-tree.h (scratchalloc): Remove.
|
||||
(build_scratch_list): Likewise.
|
||||
* call.c (convert_class_to_reference): Replace build_scratch_list
|
||||
and build_expr_list with build_tree_list.
|
||||
(add_candidate): Replace scratchalloc with expralloc. Note memory
|
||||
leak.
|
||||
(build_user_type_conversion_1): Replace build_scratch_list
|
||||
and build_expr_list with build_tree_list.
|
||||
(build_new_op): Likewise.
|
||||
(build_op_delete_call): Likewise.
|
||||
(convert_like): Likewise.
|
||||
* cvt.c (ocp_convert): Likewise.
|
||||
* decl.c (start_decl): Likewise.
|
||||
(start_function): Likewise.
|
||||
(finish_destructor_body): Likewise.
|
||||
(maybe_build_cleanup_1): Likewise.
|
||||
* decl2.c (reparse_decl_as_expr): Likewise.
|
||||
* init.c (perform_member_init): Likewise.
|
||||
(expand_cleanup_for_base): Likewise.
|
||||
(build_builtin_delete_call): Likewise.
|
||||
(build_new_1): Likewise.
|
||||
(build_delete): Likewise.
|
||||
* method.c (do_build_assign_ref): Likewise.
|
||||
* parse.y (already_scoped_stmt): Likewise.
|
||||
(nontrivial_exprlist): Likewise.
|
||||
(net_initializer): Likewise.
|
||||
(initlist): Likewise.
|
||||
* parse.c: Regenerated.
|
||||
* rtti.c (build_x_typeid): Likewise.
|
||||
(build_dynamic_cast_1): Likewise.
|
||||
* typeck.c (build_x_compound_expr): Likewise.
|
||||
(build_static_cast): Likewise.
|
||||
(build_modify_expr): Likewise.
|
||||
|
||||
* cp-tree.h (DECL_VINDEX): Add documentation.
|
||||
* class.c (build_vtable_entry): Likewise.
|
||||
(start_vtable): Add comment.
|
||||
(add_virtual_function): Replace pending_hard_virtuals with
|
||||
overridden_virtuals and pending_virtuals with new_virtuals.
|
||||
Replace redundant assignments with assertions.
|
||||
(check_for_override): Add comment.
|
||||
(check_bases_and_members): Replace pending_hard_virtuals with
|
||||
overridden_virtuals and pending_virtuals with new_virtuals.
|
||||
(create_vtbl_ptr): Likewise.
|
||||
(layout_class_type): Likewise.
|
||||
(finish_struct_1): Likewise. Add comments.
|
||||
|
||||
2000-01-16 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* class.c (finish_struct_1): Replace redundant code with
|
||||
|
@ -869,7 +869,7 @@ convert_class_to_reference (t, s, expr)
|
||||
cast to the appropriate type. */
|
||||
arglist = build_int_2 (0, 0);
|
||||
TREE_TYPE (arglist) = build_pointer_type (s);
|
||||
arglist = build_scratch_list (NULL_TREE, arglist);
|
||||
arglist = build_tree_list (NULL_TREE, arglist);
|
||||
|
||||
for (conversions = lookup_conversions (s);
|
||||
conversions;
|
||||
@ -1214,8 +1214,10 @@ add_candidate (candidates, fn, convs, viable)
|
||||
tree fn, convs;
|
||||
int viable;
|
||||
{
|
||||
/* FIXME: This is a memory leak. Presumably, we should use
|
||||
ggc_alloc instead. */
|
||||
struct z_candidate *cand
|
||||
= (struct z_candidate *) scratchalloc (sizeof (struct z_candidate));
|
||||
= (struct z_candidate *) expralloc (sizeof (struct z_candidate));
|
||||
|
||||
cand->fn = fn;
|
||||
cand->convs = convs;
|
||||
@ -2269,7 +2271,7 @@ build_user_type_conversion_1 (totype, expr, flags)
|
||||
{
|
||||
tree t = build_int_2 (0, 0);
|
||||
TREE_TYPE (t) = build_pointer_type (totype);
|
||||
args = build_scratch_list (NULL_TREE, expr);
|
||||
args = build_tree_list (NULL_TREE, expr);
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (totype))
|
||||
args = tree_cons (NULL_TREE, integer_one_node, args);
|
||||
args = tree_cons (NULL_TREE, t, args);
|
||||
@ -2302,7 +2304,7 @@ build_user_type_conversion_1 (totype, expr, flags)
|
||||
}
|
||||
|
||||
if (convs)
|
||||
args = build_scratch_list (NULL_TREE, build_this (expr));
|
||||
args = build_tree_list (NULL_TREE, build_this (expr));
|
||||
|
||||
for (; convs; convs = TREE_CHAIN (convs))
|
||||
{
|
||||
@ -3164,11 +3166,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
|
||||
|
||||
if (arg2 && arg3)
|
||||
arglist = tree_cons (NULL_TREE, arg1, tree_cons
|
||||
(NULL_TREE, arg2, build_scratch_list (NULL_TREE, arg3)));
|
||||
(NULL_TREE, arg2, build_tree_list (NULL_TREE, arg3)));
|
||||
else if (arg2)
|
||||
arglist = tree_cons (NULL_TREE, arg1, build_scratch_list (NULL_TREE, arg2));
|
||||
arglist = tree_cons (NULL_TREE, arg1, build_tree_list (NULL_TREE, arg2));
|
||||
else
|
||||
arglist = build_scratch_list (NULL_TREE, arg1);
|
||||
arglist = build_tree_list (NULL_TREE, arg1);
|
||||
|
||||
fns = lookup_function_nonclass (fnname, arglist);
|
||||
|
||||
@ -3567,7 +3569,7 @@ build_op_delete_call (code, addr, size, flags, placement)
|
||||
enforce_access (TREE_PURPOSE (fns), fn);
|
||||
return build_function_call
|
||||
(fn, tree_cons (NULL_TREE, addr,
|
||||
build_expr_list (NULL_TREE, size)));
|
||||
build_tree_list (NULL_TREE, size)));
|
||||
}
|
||||
|
||||
/* finish_function passes LOOKUP_SPECULATIVELY if we're in a
|
||||
@ -3650,7 +3652,7 @@ convert_like (convs, expr)
|
||||
tree t = build_int_2 (0, 0);
|
||||
TREE_TYPE (t) = build_pointer_type (DECL_CONTEXT (fn));
|
||||
|
||||
args = build_scratch_list (NULL_TREE, expr);
|
||||
args = build_tree_list (NULL_TREE, expr);
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn)))
|
||||
args = tree_cons (NULL_TREE, integer_one_node, args);
|
||||
args = tree_cons (NULL_TREE, t, args);
|
||||
@ -3911,7 +3913,7 @@ build_over_call (cand, args, flags)
|
||||
enforce_access (cand->basetype_path, fn);
|
||||
|
||||
if (args && TREE_CODE (args) != TREE_LIST)
|
||||
args = build_scratch_list (NULL_TREE, args);
|
||||
args = build_tree_list (NULL_TREE, args);
|
||||
arg = args;
|
||||
|
||||
/* The implicit parameters to a constructor are not considered by overload
|
||||
|
128
gcc/cp/class.c
128
gcc/cp/class.c
@ -573,7 +573,7 @@ build_vtable_entry (delta, pfn)
|
||||
extern int flag_huge_objects;
|
||||
tree elems = tree_cons (NULL_TREE, delta,
|
||||
tree_cons (NULL_TREE, integer_zero_node,
|
||||
build_expr_list (NULL_TREE, pfn)));
|
||||
build_tree_list (NULL_TREE, pfn)));
|
||||
tree entry = build (CONSTRUCTOR, vtable_entry_type, NULL_TREE, elems);
|
||||
|
||||
/* DELTA used to be constructed by `size_int' and/or size_binop,
|
||||
@ -1139,6 +1139,9 @@ start_vtable (t, has_virtual_p)
|
||||
{
|
||||
if (*has_virtual_p == 0 && ! CLASSTYPE_COM_INTERFACE (t))
|
||||
{
|
||||
/* If we are using thunks, use two slots at the front, one
|
||||
for the offset pointer, one for the tdesc pointer.
|
||||
For ARM-style vtables, use the same slot for both. */
|
||||
if (flag_vtable_thunks)
|
||||
*has_virtual_p = 2;
|
||||
else
|
||||
@ -1151,40 +1154,35 @@ start_vtable (t, has_virtual_p)
|
||||
allocate a new slot in our table. If it is error_mark_node, we
|
||||
know that no other function from another vtable is overridden by X.
|
||||
HAS_VIRTUAL keeps track of how many virtuals there are in our main
|
||||
vtable for the type, and we build upon the PENDING_VIRTUALS list
|
||||
vtable for the type, and we build upon the NEW_VIRTUALS list
|
||||
and return it. */
|
||||
|
||||
static void
|
||||
add_virtual_function (pv, phv, has_virtual, fndecl, t)
|
||||
tree *pv, *phv;
|
||||
add_virtual_function (new_virtuals_p, overridden_virtuals_p,
|
||||
has_virtual, fndecl, t)
|
||||
tree *new_virtuals_p;
|
||||
tree *overridden_virtuals_p;
|
||||
int *has_virtual;
|
||||
tree fndecl;
|
||||
tree t; /* Structure type. */
|
||||
{
|
||||
tree pending_virtuals = *pv;
|
||||
tree pending_hard_virtuals = *phv;
|
||||
my_friendly_assert (DECL_CONTEXT (fndecl) == t, 20000116);
|
||||
|
||||
#ifndef DUMB_USER
|
||||
if (current_class_type == 0)
|
||||
cp_warning ("internal problem, current_class_type is zero when adding `%D', please report",
|
||||
fndecl);
|
||||
if (current_class_type && t != current_class_type)
|
||||
cp_warning ("internal problem, current_class_type differs when adding `%D', please report",
|
||||
fndecl);
|
||||
#endif
|
||||
|
||||
/* If the virtual function is a redefinition of a prior one,
|
||||
figure out in which base class the new definition goes,
|
||||
and if necessary, make a fresh virtual function table
|
||||
to hold that entry. */
|
||||
if (DECL_VINDEX (fndecl) == error_mark_node)
|
||||
/* If this function doesn't override anything from a base class, we
|
||||
can just assign it a new DECL_VINDEX now. Otherwise, if it does
|
||||
override something, we keep it around and assign its DECL_VINDEX
|
||||
later, in modify_all_vtables. */
|
||||
if (TREE_CODE (DECL_VINDEX (fndecl)) == INTEGER_CST)
|
||||
/* We've already dealt with this function. */
|
||||
;
|
||||
else if (DECL_VINDEX (fndecl) == error_mark_node)
|
||||
{
|
||||
/* FNDECL is a new virtual function; it doesn't override any
|
||||
virtual function in a base class. */
|
||||
|
||||
/* We remember that this was the base sub-object for rtti. */
|
||||
CLASSTYPE_RTTI (t) = t;
|
||||
|
||||
/* If we are using thunks, use two slots at the front, one
|
||||
for the offset pointer, one for the tdesc pointer.
|
||||
For ARM-style vtables, use the same slot for both. */
|
||||
start_vtable (t, has_virtual);
|
||||
|
||||
/* Build a new INT_CST for this DECL_VINDEX. */
|
||||
@ -1205,25 +1203,17 @@ add_virtual_function (pv, phv, has_virtual, fndecl, t)
|
||||
|
||||
/* Now assign virtual dispatch information. */
|
||||
DECL_VINDEX (fndecl) = idx;
|
||||
DECL_CONTEXT (fndecl) = t;
|
||||
}
|
||||
/* Save the state we've computed on the PENDING_VIRTUALS list. */
|
||||
pending_virtuals = tree_cons (integer_zero_node,
|
||||
fndecl,
|
||||
pending_virtuals);
|
||||
/* Save the state we've computed on the NEW_VIRTUALS list. */
|
||||
*new_virtuals_p = tree_cons (integer_zero_node,
|
||||
fndecl,
|
||||
*new_virtuals_p);
|
||||
}
|
||||
/* Might already be INTEGER_CST if declared twice in class. We will
|
||||
give error later or we've already given it. */
|
||||
else if (TREE_CODE (DECL_VINDEX (fndecl)) != INTEGER_CST)
|
||||
{
|
||||
/* Need an entry in some other virtual function table.
|
||||
Deal with this after we have laid out our virtual base classes. */
|
||||
pending_hard_virtuals = tree_cons (NULL_TREE,
|
||||
fndecl,
|
||||
pending_hard_virtuals);
|
||||
}
|
||||
*pv = pending_virtuals;
|
||||
*phv = pending_hard_virtuals;
|
||||
/* FNDECL overrides a function from a base class. */
|
||||
*overridden_virtuals_p = tree_cons (NULL_TREE,
|
||||
fndecl,
|
||||
*overridden_virtuals_p);
|
||||
}
|
||||
|
||||
extern struct obstack *current_obstack;
|
||||
@ -3126,8 +3116,12 @@ check_for_override (decl, ctype)
|
||||
}
|
||||
virtualp = 1;
|
||||
|
||||
DECL_VINDEX (decl)
|
||||
= tree_cons (NULL_TREE, tmp, DECL_VINDEX (decl));
|
||||
/* Set DECL_VINDEX to a value that is neither an
|
||||
INTEGER_CST nor the error_mark_node so that
|
||||
add_virtual_function will realize this is an
|
||||
overridden function. */
|
||||
DECL_VINDEX (decl)
|
||||
= tree_cons (tmp, NULL_TREE, DECL_VINDEX (decl));
|
||||
|
||||
/* We now know that DECL overrides something,
|
||||
which is all that is important. But, we must
|
||||
@ -4202,12 +4196,12 @@ check_bases_and_members (t, empty_p)
|
||||
|
||||
static void
|
||||
create_vtable_ptr (t, empty_p, has_virtual_p,
|
||||
pending_virtuals_p, pending_hard_virtuals_p)
|
||||
new_virtuals_p, overridden_virtuals_p)
|
||||
tree t;
|
||||
int *empty_p;
|
||||
int *has_virtual_p;
|
||||
tree *pending_virtuals_p;
|
||||
tree *pending_hard_virtuals_p;
|
||||
tree *new_virtuals_p;
|
||||
tree *overridden_virtuals_p;
|
||||
{
|
||||
tree fn;
|
||||
|
||||
@ -4215,7 +4209,7 @@ create_vtable_ptr (t, empty_p, has_virtual_p,
|
||||
vtables. */
|
||||
for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
|
||||
if (DECL_VINDEX (fn))
|
||||
add_virtual_function (pending_virtuals_p, pending_hard_virtuals_p,
|
||||
add_virtual_function (new_virtuals_p, overridden_virtuals_p,
|
||||
has_virtual_p, fn, t);
|
||||
|
||||
/* Even if there weren't any new virtual functions, we might need a
|
||||
@ -4609,12 +4603,12 @@ layout_basetypes (rec)
|
||||
|
||||
static void
|
||||
layout_class_type (t, empty_p, has_virtual_p,
|
||||
pending_virtuals_p, pending_hard_virtuals_p)
|
||||
new_virtuals_p, overridden_virtuals_p)
|
||||
tree t;
|
||||
int *empty_p;
|
||||
int *has_virtual_p;
|
||||
tree *pending_virtuals_p;
|
||||
tree *pending_hard_virtuals_p;
|
||||
tree *new_virtuals_p;
|
||||
tree *overridden_virtuals_p;
|
||||
{
|
||||
/* If possible, we reuse the virtual function table pointer from one
|
||||
of our base classes. */
|
||||
@ -4629,7 +4623,7 @@ layout_class_type (t, empty_p, has_virtual_p,
|
||||
|
||||
/* Create a pointer to our virtual function table. */
|
||||
create_vtable_ptr (t, empty_p, has_virtual_p,
|
||||
pending_virtuals_p, pending_hard_virtuals_p);
|
||||
new_virtuals_p, overridden_virtuals_p);
|
||||
|
||||
/* CLASSTYPE_INLINE_FRIENDS is really TYPE_NONCOPIED_PARTS. Thus,
|
||||
we have to save this before we start modifying
|
||||
@ -4725,8 +4719,15 @@ finish_struct_1 (t)
|
||||
{
|
||||
tree x;
|
||||
int has_virtual;
|
||||
tree pending_virtuals = NULL_TREE;
|
||||
tree pending_hard_virtuals = NULL_TREE;
|
||||
/* The NEW_VIRTUALS is a TREE_LIST. The TREE_VALUE of each node is
|
||||
a FUNCTION_DECL. Each of these functions is a virtual function
|
||||
declared in T that does not override any virtual function from a
|
||||
base class. */
|
||||
tree new_virtuals = NULL_TREE;
|
||||
/* The OVERRIDDEN_VIRTUALS list is like the NEW_VIRTUALS list,
|
||||
except that each declaration here overrides the declaration from
|
||||
a base class. */
|
||||
tree overridden_virtuals = NULL_TREE;
|
||||
int n_fields = 0;
|
||||
tree vfield;
|
||||
int empty = 1;
|
||||
@ -4745,7 +4746,6 @@ finish_struct_1 (t)
|
||||
|
||||
/* If this type was previously laid out as a forward reference,
|
||||
make sure we lay it out again. */
|
||||
|
||||
TYPE_SIZE (t) = NULL_TREE;
|
||||
CLASSTYPE_GOT_SEMICOLON (t) = 0;
|
||||
CLASSTYPE_VFIELD_PARENT (t) = -1;
|
||||
@ -4758,7 +4758,7 @@ finish_struct_1 (t)
|
||||
|
||||
/* Layout the class itself. */
|
||||
layout_class_type (t, &empty, &has_virtual,
|
||||
&pending_virtuals, &pending_hard_virtuals);
|
||||
&new_virtuals, &overridden_virtuals);
|
||||
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (t))
|
||||
{
|
||||
@ -4818,13 +4818,13 @@ finish_struct_1 (t)
|
||||
TYPE_VFIELD (t) = vfield;
|
||||
}
|
||||
|
||||
if (flag_rtti && TYPE_CONTAINS_VPTR_P (t) && !pending_hard_virtuals)
|
||||
if (flag_rtti && TYPE_CONTAINS_VPTR_P (t) && !overridden_virtuals)
|
||||
modify_all_vtables (t, NULL_TREE);
|
||||
|
||||
for (pending_hard_virtuals = nreverse (pending_hard_virtuals);
|
||||
pending_hard_virtuals;
|
||||
pending_hard_virtuals = TREE_CHAIN (pending_hard_virtuals))
|
||||
modify_all_vtables (t, TREE_VALUE (pending_hard_virtuals));
|
||||
for (overridden_virtuals = nreverse (overridden_virtuals);
|
||||
overridden_virtuals;
|
||||
overridden_virtuals = TREE_CHAIN (overridden_virtuals))
|
||||
modify_all_vtables (t, TREE_VALUE (overridden_virtuals));
|
||||
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (t))
|
||||
{
|
||||
@ -4850,10 +4850,10 @@ finish_struct_1 (t)
|
||||
}
|
||||
|
||||
/* If necessary, create the vtable for this class. */
|
||||
if (pending_virtuals
|
||||
if (new_virtuals
|
||||
|| (TYPE_CONTAINS_VPTR_P (t) && vptrs_present_everywhere_p ()))
|
||||
{
|
||||
pending_virtuals = nreverse (pending_virtuals);
|
||||
new_virtuals = nreverse (new_virtuals);
|
||||
/* We must enter these virtuals into the table. */
|
||||
if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
|
||||
{
|
||||
@ -4861,12 +4861,12 @@ finish_struct_1 (t)
|
||||
{
|
||||
/* The second slot is for the tdesc pointer when thunks are used. */
|
||||
if (flag_vtable_thunks)
|
||||
pending_virtuals = tree_cons (NULL_TREE, NULL_TREE, pending_virtuals);
|
||||
new_virtuals = tree_cons (NULL_TREE, NULL_TREE, new_virtuals);
|
||||
|
||||
/* The first slot is for the rtti offset. */
|
||||
pending_virtuals = tree_cons (NULL_TREE, NULL_TREE, pending_virtuals);
|
||||
new_virtuals = tree_cons (NULL_TREE, NULL_TREE, new_virtuals);
|
||||
|
||||
set_rtti_entry (pending_virtuals,
|
||||
set_rtti_entry (new_virtuals,
|
||||
convert (ssizetype, integer_zero_node), t);
|
||||
}
|
||||
build_vtable (NULL_TREE, t);
|
||||
@ -4917,7 +4917,7 @@ finish_struct_1 (t)
|
||||
/* Entries for virtual functions defined in the primary base are
|
||||
followed by entries for new functions unique to this class. */
|
||||
TYPE_BINFO_VIRTUALS (t)
|
||||
= chainon (TYPE_BINFO_VIRTUALS (t), pending_virtuals);
|
||||
= chainon (TYPE_BINFO_VIRTUALS (t), new_virtuals);
|
||||
}
|
||||
|
||||
/* Now lay out the virtual function table. */
|
||||
|
@ -126,7 +126,18 @@ Boston, MA 02111-1307, USA. */
|
||||
entry does not have a TREE_VALUE; it is just an offset.
|
||||
|
||||
DECL_ARGUMENTS
|
||||
For a VAR_DECL this is DECL_ANON_UNION_ELEMS. */
|
||||
For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
|
||||
|
||||
DECL_VINDEX
|
||||
This field is NULL for a non-virtual function. For a virtual
|
||||
function, it is eventually set to an INTEGER_CST indicating the
|
||||
index in the vtable at which this function can be found. When
|
||||
a virtual function is declared, but before it is known what
|
||||
function is overriden, this field is the error_mark_node.
|
||||
|
||||
Temporarily, it may be set to a TREE_LIST whose TREE_VALUE is
|
||||
the virtual function this one overrides, and whose TREE_CHAIN is
|
||||
the old DECL_VINDEX. */
|
||||
|
||||
/* Language-specific tree checkers. */
|
||||
|
||||
@ -214,6 +225,14 @@ extern int flag_rtti;
|
||||
alternative; otherwise, we choose the former. */
|
||||
#define vptrs_present_everywhere_p() (flag_new_abi)
|
||||
|
||||
/* Nonzero if the vtable for a derived class should contain the
|
||||
virtual functions from the primary base and all virtual functions
|
||||
present in the class itself. Zero if, instead, it should contain
|
||||
only those virtual functions from the primary base together with
|
||||
the functions declared in the derived class (but not in any base
|
||||
class). */
|
||||
#define all_overridden_vfuns_in_vtables_p() (flag_new_abi)
|
||||
|
||||
|
||||
/* Language-dependent contents of an identifier. */
|
||||
|
||||
@ -4181,9 +4200,6 @@ extern void remap_save_expr PROTO((tree *, splay_tree, tree,
|
||||
#define cp_build_qualified_type(TYPE, QUALS) \
|
||||
cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
|
||||
|
||||
#define scratchalloc expralloc
|
||||
#define build_scratch_list build_expr_list
|
||||
|
||||
/* in typeck.c */
|
||||
extern int string_conv_p PROTO((tree, tree, int));
|
||||
extern tree condition_conversion PROTO((tree));
|
||||
|
@ -807,7 +807,7 @@ ocp_convert (type, expr, convtype, flags)
|
||||
ctor = build_user_type_conversion (type, ctor, flags);
|
||||
if (ctor)
|
||||
ctor = build_method_call (NULL_TREE, ctor_identifier,
|
||||
build_expr_list (NULL_TREE, ctor),
|
||||
build_tree_list (NULL_TREE, ctor),
|
||||
TYPE_BINFO (type), flags);
|
||||
if (ctor)
|
||||
return build_cplus_new (type, ctor);
|
||||
|
@ -6668,7 +6668,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
|
||||
}
|
||||
|
||||
if (attributes || prefix_attributes)
|
||||
attrlist = build_scratch_list (attributes, prefix_attributes);
|
||||
attrlist = build_tree_list (attributes, prefix_attributes);
|
||||
else
|
||||
attrlist = NULL_TREE;
|
||||
|
||||
@ -12968,7 +12968,7 @@ start_function (declspecs, declarator, attrs, flags)
|
||||
if (CLASS_TYPE_P (restype) && !CLASSTYPE_GOT_SEMICOLON (restype))
|
||||
{
|
||||
cp_error ("semicolon missing after declaration of `%#T'", restype);
|
||||
shadow_tag (build_expr_list (NULL_TREE, restype));
|
||||
shadow_tag (build_tree_list (NULL_TREE, restype));
|
||||
CLASSTYPE_GOT_SEMICOLON (restype) = 1;
|
||||
if (TREE_CODE (fntype) == FUNCTION_TYPE)
|
||||
fntype = build_function_type (integer_type_node,
|
||||
@ -13600,7 +13600,7 @@ finish_destructor_body ()
|
||||
finish_expr_stmt
|
||||
(build_scoped_method_call
|
||||
(current_class_ref, vb, dtor_identifier,
|
||||
build_expr_list (NULL_TREE, integer_zero_node)));
|
||||
build_tree_list (NULL_TREE, integer_zero_node)));
|
||||
}
|
||||
vbases = TREE_CHAIN (vbases);
|
||||
}
|
||||
@ -14276,7 +14276,7 @@ maybe_build_cleanup_1 (decl, auto_delete)
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (type)
|
||||
&& ! TYPE_HAS_DESTRUCTOR (type))
|
||||
rval = build_compound_expr (tree_cons (NULL_TREE, rval,
|
||||
build_expr_list (NULL_TREE, build_vbase_delete (type, decl))));
|
||||
build_tree_list (NULL_TREE, build_vbase_delete (type, decl))));
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -4026,7 +4026,7 @@ reparse_decl_as_expr (type, decl)
|
||||
{
|
||||
decl = build_expr_from_tree (decl);
|
||||
if (type)
|
||||
return build_functional_cast (type, build_expr_list (NULL_TREE, decl));
|
||||
return build_functional_cast (type, build_tree_list (NULL_TREE, decl));
|
||||
else
|
||||
return decl;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ perform_member_init (member, name, init, explicit)
|
||||
/* Since `init' is already a TREE_LIST on the current_member_init_list,
|
||||
only build it into one if we aren't already a list. */
|
||||
if (init != NULL_TREE && TREE_CODE (init) != TREE_LIST)
|
||||
init = build_expr_list (NULL_TREE, init);
|
||||
init = build_tree_list (NULL_TREE, init);
|
||||
|
||||
if (explicit
|
||||
&& TREE_CODE (type) == ARRAY_TYPE
|
||||
@ -695,7 +695,7 @@ expand_cleanup_for_base (binfo, flag)
|
||||
/* Call the destructor. */
|
||||
expr = (build_scoped_method_call
|
||||
(current_class_ref, binfo, dtor_identifier,
|
||||
build_expr_list (NULL_TREE, integer_zero_node)));
|
||||
build_tree_list (NULL_TREE, integer_zero_node)));
|
||||
if (flag)
|
||||
expr = fold (build (COND_EXPR, void_type_node,
|
||||
truthvalue_conversion (flag),
|
||||
@ -1186,7 +1186,7 @@ expand_default_init (binfo, true_exp, exp, init, flags)
|
||||
init = TREE_VALUE (parms);
|
||||
}
|
||||
else
|
||||
parms = build_expr_list (NULL_TREE, init);
|
||||
parms = build_tree_list (NULL_TREE, init);
|
||||
|
||||
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
|
||||
{
|
||||
@ -1361,7 +1361,7 @@ get_type_value (name)
|
||||
else
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* This code could just as well go in `class.c', but is placed here for
|
||||
modularity. */
|
||||
@ -1619,7 +1619,7 @@ build_offset_ref (type, name)
|
||||
/* The code in instantiate_type which will process this
|
||||
expects to encounter OVERLOADs, not raw functions. */
|
||||
t = ovl_cons (t, NULL_TREE);
|
||||
|
||||
|
||||
return build (OFFSET_REF,
|
||||
unknown_type_node,
|
||||
decl,
|
||||
@ -1772,7 +1772,7 @@ resolve_offset_ref (exp)
|
||||
basetype = DECL_CONTEXT (member);
|
||||
|
||||
base = current_class_ptr;
|
||||
|
||||
|
||||
if (get_base_distance (basetype, TREE_TYPE (TREE_TYPE (base)), 0, &basetype_path) < 0)
|
||||
{
|
||||
error_not_base_type (basetype, TREE_TYPE (TREE_TYPE (base)));
|
||||
@ -1812,7 +1812,7 @@ resolve_offset_ref (exp)
|
||||
basetype = TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (member)));
|
||||
addr = convert_pointer_to (basetype, addr);
|
||||
member = cp_convert (ptrdiff_type_node, member);
|
||||
|
||||
|
||||
/* Pointer to data members are offset by one, so that a null
|
||||
pointer with a real value of 0 is distinguishable from an
|
||||
offset of the first member of a structure. */
|
||||
@ -1861,7 +1861,7 @@ build_builtin_delete_call (addr)
|
||||
{
|
||||
mark_used (global_delete_fndecl);
|
||||
return build_call (global_delete_fndecl,
|
||||
void_type_node, build_expr_list (NULL_TREE, addr));
|
||||
void_type_node, build_tree_list (NULL_TREE, addr));
|
||||
}
|
||||
|
||||
/* Generate a C++ "new" expression. DECL is either a TREE_LIST
|
||||
@ -2258,7 +2258,7 @@ build_new_1 (exp)
|
||||
rval = cp_convert (build_pointer_type (true_type), rval);
|
||||
rval = build_compound_expr
|
||||
(tree_cons (NULL_TREE, exp1,
|
||||
build_expr_list (NULL_TREE, rval)));
|
||||
build_tree_list (NULL_TREE, rval)));
|
||||
}
|
||||
|
||||
if (rval == error_mark_node)
|
||||
@ -3059,7 +3059,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
||||
passed_auto_delete = auto_delete;
|
||||
|
||||
expr = build_method_call
|
||||
(ref, dtor_identifier, build_expr_list (NULL_TREE, passed_auto_delete),
|
||||
(ref, dtor_identifier, build_tree_list (NULL_TREE, passed_auto_delete),
|
||||
NULL_TREE, flags);
|
||||
|
||||
if (do_delete)
|
||||
@ -3108,7 +3108,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
||||
cond = NULL_TREE;
|
||||
|
||||
if (cond)
|
||||
exprstmt = build_expr_list (NULL_TREE, cond);
|
||||
exprstmt = build_tree_list (NULL_TREE, cond);
|
||||
|
||||
if (base_binfo
|
||||
&& ! TREE_VIA_VIRTUAL (base_binfo)
|
||||
@ -3123,7 +3123,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
||||
|
||||
expr = build_scoped_method_call
|
||||
(ref, base_binfo, dtor_identifier,
|
||||
build_expr_list (NULL_TREE, this_auto_delete));
|
||||
build_tree_list (NULL_TREE, this_auto_delete));
|
||||
exprstmt = tree_cons (NULL_TREE, expr, exprstmt);
|
||||
}
|
||||
|
||||
@ -3137,7 +3137,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
|
||||
|
||||
expr = build_scoped_method_call
|
||||
(ref, base_binfo, dtor_identifier,
|
||||
build_expr_list (NULL_TREE, integer_zero_node));
|
||||
build_tree_list (NULL_TREE, integer_zero_node));
|
||||
|
||||
exprstmt = tree_cons (NULL_TREE, expr, exprstmt);
|
||||
}
|
||||
|
@ -2277,7 +2277,7 @@ do_build_assign_ref (fndecl)
|
||||
CONV_IMPLICIT|CONV_CONST, LOOKUP_COMPLAIN, NULL_TREE);
|
||||
p = convert_from_reference (p);
|
||||
p = build_member_call (basetype, ansi_opname [MODIFY_EXPR],
|
||||
build_expr_list (NULL_TREE, p));
|
||||
build_tree_list (NULL_TREE, p));
|
||||
finish_expr_stmt (p);
|
||||
}
|
||||
for (; fields; fields = TREE_CHAIN (fields))
|
||||
|
@ -5252,24 +5252,24 @@ case 208:
|
||||
case 210:
|
||||
#line 1061 "parse.y"
|
||||
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype,
|
||||
build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
|
||||
build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
|
||||
break;}
|
||||
case 211:
|
||||
#line 1064 "parse.y"
|
||||
{ yyval.ttype = tree_cons (NULL_TREE, yyval.ttype,
|
||||
build_expr_list (NULL_TREE, error_mark_node)); ;
|
||||
build_tree_list (NULL_TREE, error_mark_node)); ;
|
||||
break;}
|
||||
case 212:
|
||||
#line 1067 "parse.y"
|
||||
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, yyvsp[0].ttype)); ;
|
||||
{ chainon (yyval.ttype, build_tree_list (NULL_TREE, yyvsp[0].ttype)); ;
|
||||
break;}
|
||||
case 213:
|
||||
#line 1069 "parse.y"
|
||||
{ chainon (yyval.ttype, build_expr_list (NULL_TREE, error_mark_node)); ;
|
||||
{ chainon (yyval.ttype, build_tree_list (NULL_TREE, error_mark_node)); ;
|
||||
break;}
|
||||
case 214:
|
||||
#line 1074 "parse.y"
|
||||
{ yyval.ttype = build_expr_list (NULL_TREE, yyval.ttype); ;
|
||||
{ yyval.ttype = build_tree_list (NULL_TREE, yyval.ttype); ;
|
||||
break;}
|
||||
case 216:
|
||||
#line 1080 "parse.y"
|
||||
@ -5421,7 +5421,7 @@ case 246:
|
||||
pedwarn ("ANSI C++ forbids initialization of new expression with `='");
|
||||
if (TREE_CODE (yyvsp[0].ttype) != TREE_LIST
|
||||
&& TREE_CODE (yyvsp[0].ttype) != CONSTRUCTOR)
|
||||
yyval.ttype = build_expr_list (NULL_TREE, yyvsp[0].ttype);
|
||||
yyval.ttype = build_tree_list (NULL_TREE, yyvsp[0].ttype);
|
||||
else
|
||||
yyval.ttype = yyvsp[0].ttype;
|
||||
;
|
||||
@ -6297,11 +6297,11 @@ case 454:
|
||||
break;}
|
||||
case 455:
|
||||
#line 2007 "parse.y"
|
||||
{ yyval.ttype = build_expr_list (yyvsp[-2].ttype, yyvsp[0].ttype); ;
|
||||
{ yyval.ttype = build_tree_list (yyvsp[-2].ttype, yyvsp[0].ttype); ;
|
||||
break;}
|
||||
case 456:
|
||||
#line 2009 "parse.y"
|
||||
{ yyval.ttype = build_expr_list (yyval.ttype, yyvsp[0].ttype); ;
|
||||
{ yyval.ttype = build_tree_list (yyval.ttype, yyvsp[0].ttype); ;
|
||||
break;}
|
||||
case 457:
|
||||
#line 2011 "parse.y"
|
||||
|
@ -1059,19 +1059,19 @@ already_scoped_stmt:
|
||||
nontrivial_exprlist:
|
||||
expr_no_commas ',' expr_no_commas
|
||||
{ $$ = tree_cons (NULL_TREE, $$,
|
||||
build_expr_list (NULL_TREE, $3)); }
|
||||
build_tree_list (NULL_TREE, $3)); }
|
||||
| expr_no_commas ',' error
|
||||
{ $$ = tree_cons (NULL_TREE, $$,
|
||||
build_expr_list (NULL_TREE, error_mark_node)); }
|
||||
build_tree_list (NULL_TREE, error_mark_node)); }
|
||||
| nontrivial_exprlist ',' expr_no_commas
|
||||
{ chainon ($$, build_expr_list (NULL_TREE, $3)); }
|
||||
{ chainon ($$, build_tree_list (NULL_TREE, $3)); }
|
||||
| nontrivial_exprlist ',' error
|
||||
{ chainon ($$, build_expr_list (NULL_TREE, error_mark_node)); }
|
||||
{ chainon ($$, build_tree_list (NULL_TREE, error_mark_node)); }
|
||||
;
|
||||
|
||||
nonnull_exprlist:
|
||||
expr_no_commas
|
||||
{ $$ = build_expr_list (NULL_TREE, $$); }
|
||||
{ $$ = build_tree_list (NULL_TREE, $$); }
|
||||
| nontrivial_exprlist
|
||||
;
|
||||
|
||||
@ -1181,7 +1181,7 @@ new_initializer:
|
||||
pedwarn ("ANSI C++ forbids initialization of new expression with `='");
|
||||
if (TREE_CODE ($2) != TREE_LIST
|
||||
&& TREE_CODE ($2) != CONSTRUCTOR)
|
||||
$$ = build_expr_list (NULL_TREE, $2);
|
||||
$$ = build_tree_list (NULL_TREE, $2);
|
||||
else
|
||||
$$ = $2;
|
||||
}
|
||||
@ -2004,9 +2004,9 @@ initlist:
|
||||
{ $$ = tree_cons (NULL_TREE, $3, $$); }
|
||||
/* These are for labeled elements. */
|
||||
| '[' expr_no_commas ']' init
|
||||
{ $$ = build_expr_list ($2, $4); }
|
||||
{ $$ = build_tree_list ($2, $4); }
|
||||
| identifier ':' init
|
||||
{ $$ = build_expr_list ($$, $3); }
|
||||
{ $$ = build_tree_list ($$, $3); }
|
||||
| initlist ',' identifier ':' init
|
||||
{ $$ = tree_cons ($3, $5, $$); }
|
||||
;
|
||||
|
@ -295,7 +295,7 @@ build_x_typeid (exp)
|
||||
tree bad = throw_bad_typeid ();
|
||||
|
||||
bad = build_compound_expr
|
||||
(tree_cons (NULL_TREE, bad, build_expr_list
|
||||
(tree_cons (NULL_TREE, bad, build_tree_list
|
||||
(NULL_TREE, cp_convert (type, integer_zero_node))));
|
||||
exp = build (COND_EXPR, type, cond, exp, bad);
|
||||
}
|
||||
@ -680,7 +680,7 @@ build_dynamic_cast_1 (type, expr)
|
||||
expr1 = throw_bad_cast ();
|
||||
expr1 = build_compound_expr
|
||||
(tree_cons (NULL_TREE, expr1,
|
||||
build_expr_list (NULL_TREE, cp_convert (type, integer_zero_node))));
|
||||
build_tree_list (NULL_TREE, cp_convert (type, integer_zero_node))));
|
||||
TREE_TYPE (expr1) = type;
|
||||
result = save_expr (result);
|
||||
return build (COND_EXPR, type, result, result, expr1);
|
||||
|
@ -5092,7 +5092,7 @@ build_x_compound_expr (list)
|
||||
|
||||
return build_compound_expr
|
||||
(tree_cons (NULL_TREE, TREE_VALUE (list),
|
||||
build_expr_list (NULL_TREE,
|
||||
build_tree_list (NULL_TREE,
|
||||
build_x_compound_expr (rest))));
|
||||
}
|
||||
|
||||
@ -5177,7 +5177,7 @@ build_static_cast (type, expr)
|
||||
if (IS_AGGR_TYPE (type))
|
||||
return build_cplus_new
|
||||
(type, (build_method_call
|
||||
(NULL_TREE, ctor_identifier, build_expr_list (NULL_TREE, expr),
|
||||
(NULL_TREE, ctor_identifier, build_tree_list (NULL_TREE, expr),
|
||||
TYPE_BINFO (type), LOOKUP_NORMAL)));
|
||||
|
||||
expr = decay_conversion (expr);
|
||||
@ -5702,7 +5702,7 @@ build_modify_expr (lhs, modifycode, rhs)
|
||||
else
|
||||
{
|
||||
result = build_method_call (lhs, ctor_identifier,
|
||||
build_expr_list (NULL_TREE, rhs),
|
||||
build_tree_list (NULL_TREE, rhs),
|
||||
TYPE_BINFO (lhstype), LOOKUP_NORMAL);
|
||||
if (result == NULL_TREE)
|
||||
return error_mark_node;
|
||||
@ -5932,7 +5932,7 @@ build_modify_expr (lhs, modifycode, rhs)
|
||||
if (TREE_SIDE_EFFECTS (lhs))
|
||||
cond = build_compound_expr (tree_cons
|
||||
(NULL_TREE, lhs,
|
||||
build_expr_list (NULL_TREE, cond)));
|
||||
build_tree_list (NULL_TREE, cond)));
|
||||
|
||||
/* Cannot have two identical lhs on this one tree (result) as preexpand
|
||||
calls will rip them out and fill in RTL for them, but when the
|
||||
|
Loading…
Reference in New Issue
Block a user