Commit 6d0a3f67 by Nathan Sidwell Committed by Nathan Sidwell

Remove TYPE_NONCOPIED_PARTS.

	* tree.h (TYPE_NONCOPIED_PARTS): Remove.
	(struct tree_type): Remove noncopied_parts.
	* c-tree.h (TYPE_ACTUAL_ARG_TYPES): Map onto TYPE_BINFO.
	* expr.c (save_noncopied_parts, init_noncopied_parts): Remove.
	(fixed_type_p): Remove.
	(expand_expr, INIT_EXPR): Don't deal with noncopied parts.
	(expand_expr, MODIFY_EXPR): Likewise.
	* ggc-common.c (ggc_mark_trees): Remove TYPE_NONCOPIED_PARTS.
	* doc/c-tree.texi: Remove TYPE_NONCOPIED_PARTS FIXME.
cp:
	Remove TYPE_NONCOPIED_PARTS.
	* cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto
	CLASSTYPE_PURE_VIRTUALS.
	(TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO.
	* class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS.
	(layout_class_type): Don't call fixup_inlin_methods here ...
	(finish_struct_1): ... call it here.

From-SVN: r45434
parent baff6e54
2001-09-06 Nathan Sidwell <nathan@codesourcery.com>
Remove TYPE_NONCOPIED_PARTS.
* tree.h (TYPE_NONCOPIED_PARTS): Remove.
(struct tree_type): Remove noncopied_parts.
* c-tree.h (TYPE_ACTUAL_ARG_TYPES): Map onto TYPE_BINFO.
* expr.c (save_noncopied_parts, init_noncopied_parts): Remove.
(fixed_type_p): Remove.
(expand_expr, INIT_EXPR): Don't deal with noncopied parts.
(expand_expr, MODIFY_EXPR): Likewise.
* ggc-common.c (ggc_mark_trees): Remove TYPE_NONCOPIED_PARTS.
* doc/c-tree.texi: Remove TYPE_NONCOPIED_PARTS FIXME.
2001-09-06 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (mask_operand): Use signed vars to avoid
......
......@@ -135,7 +135,7 @@ struct lang_type
/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
TYPE_ARG_TYPES for functions with prototypes, but created for functions
without prototypes. */
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_NONCOPIED_PARTS (NODE)
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_BINFO (NODE)
/* in c-lang.c and objc-act.c */
......
2001-09-06 Nathan Sidwell <nathan@codesourcery.com>
Remove TYPE_NONCOPIED_PARTS.
* cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto
CLASSTYPE_PURE_VIRTUALS.
(TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO.
* class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS.
(layout_class_type): Don't call fixup_inlin_methods here ...
(finish_struct_1): ... call it here.
2001-09-04 Mark Mitchell <mark@codesourcery.com>
* decl.c (duplicate_decls): Remove code deadling with
......
......@@ -2189,7 +2189,6 @@ duplicate_tag_error (t)
TYPE_METHODS (t) = NULL_TREE;
TYPE_VFIELD (t) = NULL_TREE;
TYPE_CONTEXT (t) = NULL_TREE;
TYPE_NONCOPIED_PARTS (t) = NULL_TREE;
/* Clear TYPE_LANG_FLAGS -- those in TYPE_LANG_SPECIFIC are cleared above. */
TYPE_LANG_FLAG_0 (t) = 0;
......@@ -4866,10 +4865,6 @@ layout_class_type (t, empty_p, vfuns_p,
if (build_base_fields (rli, empty_p, empty_base_offsets, t))
CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
/* CLASSTYPE_INLINE_FRIENDS is really TYPE_NONCOPIED_PARTS. Thus,
we have to save this before we zap TYPE_NONCOPIED_PARTS. */
fixup_inline_methods (t);
/* Layout the non-static data members. */
for (field = non_static_data_members; field; field = TREE_CHAIN (field))
{
......@@ -5077,6 +5072,8 @@ finish_struct_1 (t)
vfuns = 0;
CLASSTYPE_RTTI (t) = NULL_TREE;
fixup_inline_methods (t);
/* Do end-of-class semantic processing: checking the validity of the
bases and members and add implicitly generated methods. */
check_bases_and_members (t, &empty);
......
......@@ -117,6 +117,7 @@ Boston, MA 02111-1307, USA. */
For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
For a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM,
this is TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS
BINFO_VIRTUALS
For a binfo, this is a TREE_LIST. The BV_DELTA of each node
......@@ -1266,7 +1267,7 @@ struct lang_type
After the class is defined, these fields hold other information. */
/* List of friends which were defined inline in this class definition. */
#define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE))
#define CLASSTYPE_INLINE_FRIENDS(NODE) (CLASSTYPE_PURE_VIRTUALS (NODE))
/* Nonzero for _CLASSTYPE means that operator delete is defined. */
#define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_delete)
......@@ -1660,7 +1661,7 @@ struct lang_type
this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE
will be NULL_TREE to indicate a throw specification of `()', or
no exceptions allowed. */
#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE)
#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_BINFO (NODE)
/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */
#define TYPE_NOTHROW_P(NODE) \
......
......@@ -758,8 +758,6 @@ indicated kind of inheritance was used. If @code{TREE_VIA_VIRTUAL}
holds of a binfo, then its @code{BINFO_TYPE} was inherited from
virtually.
FIXME: Talk about @code{TYPE_NONCOPIED_PARTS}.
The following macros can be used on a tree node representing a class-type.
@ftable @code
......
......@@ -163,9 +163,6 @@ static rtx store_field PARAMS ((rtx, HOST_WIDE_INT,
unsigned int, HOST_WIDE_INT, int));
static enum memory_use_mode
get_memory_usage_from_modifier PARAMS ((enum expand_modifier));
static tree save_noncopied_parts PARAMS ((tree, tree));
static tree init_noncopied_parts PARAMS ((tree, tree));
static int fixed_type_p PARAMS ((tree));
static rtx var_rtx PARAMS ((tree));
static rtx expand_expr_unaligned PARAMS ((tree, unsigned int *));
static rtx expand_increment PARAMS ((tree, int, int));
......@@ -5659,68 +5656,6 @@ force_operand (value, target)
return value;
}
/* Subroutine of expand_expr:
save the non-copied parts (LIST) of an expr (LHS), and return a list
which can restore these values to their previous values,
should something modify their storage. */
static tree
save_noncopied_parts (lhs, list)
tree lhs;
tree list;
{
tree tail;
tree parts = 0;
for (tail = list; tail; tail = TREE_CHAIN (tail))
if (TREE_CODE (TREE_VALUE (tail)) == TREE_LIST)
parts = chainon (parts, save_noncopied_parts (lhs, TREE_VALUE (tail)));
else
{
tree part = TREE_VALUE (tail);
tree part_type = TREE_TYPE (part);
tree to_be_saved = build (COMPONENT_REF, part_type, lhs, part);
rtx target
= assign_temp (build_qualified_type (part_type,
(TYPE_QUALS (part_type)
| TYPE_QUAL_CONST)),
0, 1, 1);
parts = tree_cons (to_be_saved,
build (RTL_EXPR, part_type, NULL_TREE,
(tree) validize_mem (target)),
parts);
store_expr (TREE_PURPOSE (parts),
RTL_EXPR_RTL (TREE_VALUE (parts)), 0);
}
return parts;
}
/* Subroutine of expand_expr:
record the non-copied parts (LIST) of an expr (LHS), and return a list
which specifies the initial values of these parts. */
static tree
init_noncopied_parts (lhs, list)
tree lhs;
tree list;
{
tree tail;
tree parts = 0;
for (tail = list; tail; tail = TREE_CHAIN (tail))
if (TREE_CODE (TREE_VALUE (tail)) == TREE_LIST)
parts = chainon (parts, init_noncopied_parts (lhs, TREE_VALUE (tail)));
else if (TREE_PURPOSE (tail))
{
tree part = TREE_VALUE (tail);
tree part_type = TREE_TYPE (part);
tree to_be_initialized = build (COMPONENT_REF, part_type, lhs, part);
parts = tree_cons (TREE_PURPOSE (tail), to_be_initialized, parts);
}
return parts;
}
/* Subroutine of expand_expr: return nonzero iff there is no way that
EXP can reference X, which is being modified. TOP_P is nonzero if this
call is going to be used to determine whether we need a temporary
......@@ -5945,22 +5880,6 @@ safe_from_p (x, exp, top_p)
return 1;
}
/* Subroutine of expand_expr: return nonzero iff EXP is an
expression whose type is statically determinable. */
static int
fixed_type_p (exp)
tree exp;
{
if (TREE_CODE (exp) == PARM_DECL
|| TREE_CODE (exp) == VAR_DECL
|| TREE_CODE (exp) == CALL_EXPR || TREE_CODE (exp) == TARGET_EXPR
|| TREE_CODE (exp) == COMPONENT_REF
|| TREE_CODE (exp) == ARRAY_REF)
return 1;
return 0;
}
/* Subroutine of expand_expr: return rtx if EXP is a
variable or parameter; else return 0. */
......@@ -8505,37 +8424,23 @@ expand_expr (exp, target, tmode, modifier)
{
tree lhs = TREE_OPERAND (exp, 0);
tree rhs = TREE_OPERAND (exp, 1);
tree noncopied_parts = 0;
tree lhs_type = TREE_TYPE (lhs);
temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
if (TYPE_NONCOPIED_PARTS (lhs_type) != 0 && !fixed_type_p (rhs))
noncopied_parts
= init_noncopied_parts (stabilize_reference (lhs),
TYPE_NONCOPIED_PARTS (lhs_type));
while (noncopied_parts != 0)
{
expand_assignment (TREE_VALUE (noncopied_parts),
TREE_PURPOSE (noncopied_parts), 0, 0);
noncopied_parts = TREE_CHAIN (noncopied_parts);
}
return temp;
}
case MODIFY_EXPR:
{
/* If lhs is complex, expand calls in rhs before computing it.
That's so we don't compute a pointer and save it over a call.
If lhs is simple, compute it first so we can give it as a
target if the rhs is just a call. This avoids an extra temp and copy
and that prevents a partial-subsumption which makes bad code.
Actually we could treat component_ref's of vars like vars. */
That's so we don't compute a pointer and save it over a
call. If lhs is simple, compute it first so we can give it
as a target if the rhs is just a call. This avoids an
extra temp and copy and that prevents a partial-subsumption
which makes bad code. Actually we could treat
component_ref's of vars like vars. */
tree lhs = TREE_OPERAND (exp, 0);
tree rhs = TREE_OPERAND (exp, 1);
tree noncopied_parts = 0;
tree lhs_type = TREE_TYPE (lhs);
temp = 0;
......@@ -8571,19 +8476,8 @@ expand_expr (exp, target, tmode, modifier)
return const0_rtx;
}
if (TYPE_NONCOPIED_PARTS (lhs_type) != 0
&& ! (fixed_type_p (lhs) && fixed_type_p (rhs)))
noncopied_parts
= save_noncopied_parts (stabilize_reference (lhs),
TYPE_NONCOPIED_PARTS (lhs_type));
temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
while (noncopied_parts != 0)
{
expand_assignment (TREE_PURPOSE (noncopied_parts),
TREE_VALUE (noncopied_parts), 0, 0);
noncopied_parts = TREE_CHAIN (noncopied_parts);
}
return temp;
}
......
......@@ -399,7 +399,6 @@ ggc_mark_trees ()
ggc_mark_tree (TYPE_NEXT_VARIANT (t));
ggc_mark_tree (TYPE_MAIN_VARIANT (t));
ggc_mark_tree (TYPE_BINFO (t));
ggc_mark_tree (TYPE_NONCOPIED_PARTS (t));
ggc_mark_tree (TYPE_CONTEXT (t));
lang_mark_tree (t);
break;
......
......@@ -918,7 +918,6 @@ struct tree_block
#define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
#define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
#define TYPE_NONCOPIED_PARTS(NODE) (TYPE_CHECK (NODE)->type.noncopied_parts)
#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
......@@ -1191,7 +1190,6 @@ struct tree_type
tree next_variant;
tree main_variant;
tree binfo;
tree noncopied_parts;
tree context;
HOST_WIDE_INT alias_set;
/* Points to a structure whose details depend on the language in use. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment