cp-tree.h (IDENTIFIER_AS_DESC, [...]): Remove cruft.

* cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
	CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
	CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
	CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
	CLASSTYPE_BINFO_AS_LIST): Remove cruft.
	* class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
	tree.c: Adjust.

From-SVN: r26071
This commit is contained in:
Jason Merrill 1999-03-30 23:30:32 +00:00 committed by Jason Merrill
parent fa848ee014
commit 9e0781b581
10 changed files with 517 additions and 828 deletions

View File

@ -1,3 +1,13 @@
1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
CLASSTYPE_BINFO_AS_LIST): Remove cruft.
* class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
tree.c: Adjust.
1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.

View File

@ -1295,18 +1295,6 @@ add_method (type, fields, method)
/* Actually insert the new method. */
TREE_VEC_ELT (method_vec, slot)
= build_overload (method, TREE_VEC_ELT (method_vec, slot));
if (TYPE_BINFO_BASETYPES (type) && CLASSTYPE_BASELINK_VEC (type))
{
/* ??? May be better to know whether these can be extended? */
tree baselink_vec = CLASSTYPE_BASELINK_VEC (type);
TREE_VEC_LENGTH (baselink_vec) += 1;
CLASSTYPE_BASELINK_VEC (type) = copy_node (baselink_vec);
TREE_VEC_LENGTH (baselink_vec) -= 1;
TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), len) = 0;
}
}
pop_obstacks ();
}
@ -1641,10 +1629,6 @@ build_class_init_list (type)
continue;
}
if ((blist = CLASSTYPE_BASE_INIT_LIST (BINFO_TYPE (base_binfo))) == NULL_TREE)
/* Nothing to initialize. */
continue;
/* ...ditto... */
base_init_list = maybe_fixup_vptrs (type, base_binfo, base_init_list);
@ -1687,30 +1671,15 @@ build_class_init_list (type)
/* The function expand_aggr_init knows how to do the
initialization of `basetype' without getting
an explicit `blist'. */
if (base_init_list)
base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list);
else
base_init_list = CLASSTYPE_BINFO_AS_LIST (BINFO_TYPE (base_binfo));
base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list);
}
}
if (base_init_list)
{
if (member_init_list)
CLASSTYPE_BASE_INIT_LIST (type) =
build_tree_list (base_init_list, member_init_list);
else
CLASSTYPE_BASE_INIT_LIST (type) = base_init_list;
}
else if (member_init_list)
CLASSTYPE_BASE_INIT_LIST (type) = member_init_list;
}
struct base_info
{
int has_virtual;
int max_has_virtual;
int n_ancestors;
tree vfield;
tree vfields;
tree rtti;
@ -1793,7 +1762,6 @@ finish_base_struct (t, b)
&& !TYPE_HAS_CONST_ASSIGN_REF (basetype))
b->no_const_asn_ref = 1;
b->n_ancestors += CLASSTYPE_N_SUPERCLASSES (basetype);
TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (basetype);
TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_NEEDS_DESTRUCTOR (basetype);
TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype);
@ -1803,9 +1771,6 @@ finish_base_struct (t, b)
TYPE_OVERLOADS_ARRAY_REF (t) |= TYPE_OVERLOADS_ARRAY_REF (basetype);
TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype);
if (! TREE_VIA_VIRTUAL (base_binfo))
CLASSTYPE_N_SUPERCLASSES (t) += 1;
if (TYPE_VIRTUAL_P (basetype))
{
/* Ensure that this is set from at least a virtual base
@ -1960,14 +1925,14 @@ finish_struct_bits (t, max_has_virtual)
if (n_baseclasses && max_has_virtual)
{
/* for a class w/o baseclasses, `finish_struct' has set
* CLASS_TYPE_ABSTRACT_VIRTUALS correctly (by definition). Similarly
* for a class who's base classes do not have vtables. When neither of
* these is true, we might have removed abstract virtuals (by
* providing a definition), added some (by declaring new ones), or
* redeclared ones from a base class. We need to recalculate what's
* really an abstract virtual at this point (by looking in the vtables).
*/
/* For a class w/o baseclasses, `finish_struct' has set
CLASS_TYPE_ABSTRACT_VIRTUALS correctly (by definition). Similarly
for a class who's base classes do not have vtables. When neither
of these is true, we might have removed abstract virtuals (by
providing a definition), added some (by declaring new ones), or
redeclared ones from a base class. We need to recalculate what's
really an abstract virtual at this point (by looking in the
vtables). */
CLASSTYPE_ABSTRACT_VIRTUALS (t) = get_abstract_virtuals (t);
}
@ -1983,8 +1948,6 @@ finish_struct_bits (t, max_has_virtual)
basetype = BINFO_TYPE (TREE_VEC_ELT (binfos, i));
TYPE_HAS_CONVERSION (t) |= TYPE_HAS_CONVERSION (basetype);
if (CLASSTYPE_MAX_DEPTH (basetype) >= CLASSTYPE_MAX_DEPTH (t))
CLASSTYPE_MAX_DEPTH (t) = CLASSTYPE_MAX_DEPTH (basetype) + 1;
}
}
@ -2185,7 +2148,6 @@ finish_struct_methods (t)
tree fn_fields;
tree method_vec = CLASSTYPE_METHOD_VEC (t);
tree ctor_name = constructor_name (t);
int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
/* First fill in entry 0 with the constructors, entry 1 with destructors,
and the next few with type conversion operators (if any). */
@ -2244,34 +2206,6 @@ finish_struct_methods (t)
/* Issue warnings about private constructors and such. If there are
no methods, then some public defaults are generated. */
maybe_warn_about_overly_private_class (t);
/* Now for each member function (except for constructors and
destructors), compute where member functions of the same
name reside in base classes. */
if (n_baseclasses != 0
&& method_vec
&& TREE_VEC_LENGTH (method_vec) > 2)
{
int len = TREE_VEC_LENGTH (method_vec);
tree baselink_vec = make_tree_vec (len);
int any_links = 0;
tree baselink_binfo = build_tree_list (NULL_TREE, TYPE_BINFO (t));
for (i = 2; i < len && TREE_VEC_ELT (method_vec, i); i++)
{
tree ovl = TREE_VEC_ELT (method_vec, i);
TREE_VEC_ELT (baselink_vec, i)
= get_baselinks (baselink_binfo, t,
DECL_NAME (OVL_CURRENT (ovl)));
if (TREE_VEC_ELT (baselink_vec, i) != 0)
any_links = 1;
}
if (any_links != 0)
CLASSTYPE_BASELINK_VEC (t) = baselink_vec;
else
obstack_free (current_obstack, baselink_vec);
}
}
/* Emit error when a duplicate definition of a type is seen. Patch up. */
@ -2310,18 +2244,14 @@ duplicate_tag_error (t)
if (TYPE_LANG_SPECIFIC (t))
{
tree as_list = CLASSTYPE_AS_LIST (t);
tree binfo = TYPE_BINFO (t);
tree binfo_as_list = CLASSTYPE_BINFO_AS_LIST (t);
int interface_only = CLASSTYPE_INTERFACE_ONLY (t);
int interface_unknown = CLASSTYPE_INTERFACE_UNKNOWN (t);
bzero ((char *) TYPE_LANG_SPECIFIC (t), sizeof (struct lang_type));
BINFO_BASETYPES(binfo) = NULL_TREE;
CLASSTYPE_AS_LIST (t) = as_list;
TYPE_BINFO (t) = binfo;
CLASSTYPE_BINFO_AS_LIST (t) = binfo_as_list;
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
TYPE_REDEFINED (t) = 1;
@ -3370,7 +3300,6 @@ finish_struct_1 (t, warn_anon)
CLASSTYPE_VFIELD_PARENT (t) = first_vfn_base_index;
has_virtual = base_info.has_virtual;
max_has_virtual = base_info.max_has_virtual;
CLASSTYPE_N_SUPERCLASSES (t) += base_info.n_ancestors;
vfield = base_info.vfield;
vfields = base_info.vfields;
CLASSTYPE_RTTI (t) = base_info.rtti;
@ -3899,7 +3828,7 @@ finish_struct_1 (t, warn_anon)
fields = vfield;
#endif
empty = 0;
vfields = chainon (vfields, CLASSTYPE_AS_LIST (t));
vfields = chainon (vfields, build_tree_list (NULL_TREE, t));
}
/* Now DECL_INITIAL is null on all members except for zero-width bit-fields.
@ -4014,7 +3943,6 @@ finish_struct_1 (t, warn_anon)
tree vbases;
vbases = CLASSTYPE_VBASECLASSES (t);
CLASSTYPE_N_VBASECLASSES (t) = list_length (vbases);
{
/* Now fixup overrides of all functions in vtables from all

View File

@ -104,7 +104,7 @@ struct lang_identifier
struct lang_id2
{
tree label_value, implicit_decl;
tree type_desc, as_list, error_locus;
tree error_locus;
};
typedef struct
@ -278,14 +278,6 @@ struct tree_srcloc
#define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
SET_LANG_ID(NODE, VALUE, implicit_decl)
#define IDENTIFIER_AS_DESC(NODE) LANG_ID_FIELD(type_desc, NODE)
#define SET_IDENTIFIER_AS_DESC(NODE,DESC) \
SET_LANG_ID(NODE, DESC, type_desc)
#define IDENTIFIER_AS_LIST(NODE) LANG_ID_FIELD(as_list, NODE)
#define SET_IDENTIFIER_AS_LIST(NODE,LIST) \
SET_LANG_ID(NODE, LIST, as_list)
#define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE)
#define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \
SET_LANG_ID(NODE, VALUE, error_locus)
@ -737,13 +729,9 @@ struct lang_type
unsigned dummy : 11;
} type_flags;
int n_ancestors;
int n_vancestors;
int vsize;
int max_depth;
int vfield_parent;
union tree_node *baselink_vec;
union tree_node *vfields;
union tree_node *vbases;
@ -756,11 +744,7 @@ struct lang_type
union tree_node *size;
union tree_node *base_init_list;
union tree_node *abstract_virtuals;
union tree_node *as_list;
union tree_node *id_as_list;
union tree_node *binfo_as_list;
union tree_node *friend_classes;
union tree_node *rtti;
@ -862,7 +846,7 @@ struct lang_type
signature reference type. */
#define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
/* The is the VAR_DECL that contains NODE's rtti. */
/* The is the basetype that contains NODE's rtti. */
#define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
/* Nonzero means that this _CLASSTYPE node overloads operator(). */
@ -900,10 +884,6 @@ struct lang_type
? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
: NULL_TREE;
/* Pointer from any member function to the head of the list of
member functions of the type that member function belongs to. */
#define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec)
/* Mark bits for depth-first and breath-first searches. */
/* Get the value of the Nth mark bit. */
@ -974,17 +954,6 @@ struct lang_type
#define CLASSTYPE_N_BASECLASSES(NODE) \
(TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
/* Memoize the number of super classes (base classes) that this node
has. That way we can know immediately (albeit conservatively how
large a multiple-inheritance matrix we need to build to find
derivation information. */
#define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors)
#define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_vancestors)
/* Record how deep the inheritance is for this class so `void*' conversions
are less favorable than a conversion to the most base type. */
#define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth)
/* Used for keeping search-specific information. Any search routine
which uses this must define what exactly this slot is used for. */
#define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
@ -994,17 +963,6 @@ struct lang_type
#define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
#define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
/* A cons list of structure elements which either have constructors
to be called, or virtual function table pointers which
need initializing. Depending on what is being initialized,
the TREE_PURPOSE and TREE_VALUE fields have different meanings:
Member initialization: <FIELD_DECL, TYPE>
Base class construction: <NULL_TREE, BASETYPE>
Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS>
Whole type: <MEMBER_INIT, BASE_INIT>. */
#define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list)
/* A cons list of virtual functions which cannot be inherited by
derived classes. When deriving from this type, the derived
class must provide its own definition for each of these functions. */
@ -1038,16 +996,6 @@ struct lang_type
#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
/* Many routines need to cons up a list of basetypes for access
checking. This field contains a TREE_LIST node whose TREE_VALUE
is the main variant of the type, and whose TREE_VIA_PUBLIC
and TREE_VIA_VIRTUAL bits are correctly set. */
#define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list)
/* Same, but cache a list whose value is the name of this type. */
#define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list)
/* Same, but cache a list whose value is the binfo of this type. */
#define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list)
/* A list of class types of which this type is a friend. The
TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
case of a template friend. */
@ -3221,8 +3169,6 @@ extern tree lookup_member PROTO((tree, tree, int, int));
extern tree lookup_nested_tag PROTO((tree, tree));
extern tree get_matching_virtual PROTO((tree, tree, int));
extern tree get_abstract_virtuals PROTO((tree));
extern tree get_baselinks PROTO((tree, tree, tree));
extern tree next_baselink PROTO((tree));
extern tree init_vbase_pointers PROTO((tree, tree));
extern void expand_indirect_vtbls_init PROTO((tree, tree, tree));
extern void clear_search_slots PROTO((tree));
@ -3352,7 +3298,6 @@ extern tree build_base_fields PROTO((tree));
extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree));
extern tree hash_tree_chain PROTO((tree, tree));
extern tree hash_chainon PROTO((tree, tree));
extern tree get_decl_list PROTO((tree));
extern tree make_binfo PROTO((tree, tree, tree, tree));
extern tree binfo_value PROTO((tree, tree));
extern tree reverse_path PROTO((tree));

View File

@ -679,70 +679,28 @@ init_parse (filename)
token_buffer = (char *) xmalloc (maxtoken + 2);
ridpointers[(int) RID_INT] = get_identifier ("int");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_INT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]));
ridpointers[(int) RID_BOOL] = get_identifier ("bool");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_BOOL],
build_tree_list (NULL_TREE, ridpointers[(int) RID_BOOL]));
ridpointers[(int) RID_CHAR] = get_identifier ("char");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_CHAR],
build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]));
ridpointers[(int) RID_VOID] = get_identifier ("void");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VOID],
build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]));
ridpointers[(int) RID_FLOAT] = get_identifier ("float");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_FLOAT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_FLOAT]));
ridpointers[(int) RID_DOUBLE] = get_identifier ("double");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_DOUBLE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_DOUBLE]));
ridpointers[(int) RID_SHORT] = get_identifier ("short");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_SHORT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_SHORT]));
ridpointers[(int) RID_LONG] = get_identifier ("long");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_LONG],
build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]));
ridpointers[(int) RID_UNSIGNED] = get_identifier ("unsigned");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_UNSIGNED],
build_tree_list (NULL_TREE, ridpointers[(int) RID_UNSIGNED]));
ridpointers[(int) RID_SIGNED] = get_identifier ("signed");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_SIGNED],
build_tree_list (NULL_TREE, ridpointers[(int) RID_SIGNED]));
ridpointers[(int) RID_INLINE] = get_identifier ("inline");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_INLINE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_INLINE]));
ridpointers[(int) RID_CONST] = get_identifier ("const");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_CONST],
build_tree_list (NULL_TREE, ridpointers[(int) RID_CONST]));
ridpointers[(int) RID_VOLATILE] = get_identifier ("volatile");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VOLATILE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_VOLATILE]));
ridpointers[(int) RID_RESTRICT] = get_identifier ("__restrict");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_RESTRICT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_RESTRICT]));
ridpointers[(int) RID_AUTO] = get_identifier ("auto");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_AUTO],
build_tree_list (NULL_TREE, ridpointers[(int) RID_AUTO]));
ridpointers[(int) RID_STATIC] = get_identifier ("static");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_STATIC],
build_tree_list (NULL_TREE, ridpointers[(int) RID_STATIC]));
ridpointers[(int) RID_EXTERN] = get_identifier ("extern");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXTERN],
build_tree_list (NULL_TREE, ridpointers[(int) RID_EXTERN]));
ridpointers[(int) RID_TYPEDEF] = get_identifier ("typedef");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_TYPEDEF],
build_tree_list (NULL_TREE, ridpointers[(int) RID_TYPEDEF]));
ridpointers[(int) RID_REGISTER] = get_identifier ("register");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_REGISTER],
build_tree_list (NULL_TREE, ridpointers[(int) RID_REGISTER]));
ridpointers[(int) RID_COMPLEX] = get_identifier ("__complex");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_COMPLEX],
build_tree_list (NULL_TREE, ridpointers[(int) RID_COMPLEX]));
/* C++ extensions. These are probably not correctly named. */
ridpointers[(int) RID_WCHAR] = get_identifier ("__wchar_t");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_WCHAR],
build_tree_list (NULL_TREE, ridpointers[(int) RID_WCHAR]));
class_type_node = build_int_2 (class_type, 0);
TREE_TYPE (class_type_node) = class_type_node;
ridpointers[(int) RID_CLASS] = class_type_node;
@ -760,34 +718,16 @@ init_parse (filename)
ridpointers[(int) RID_ENUM] = enum_type_node;
ridpointers[(int) RID_VIRTUAL] = get_identifier ("virtual");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VIRTUAL],
build_tree_list (NULL_TREE, ridpointers[(int) RID_VIRTUAL]));
ridpointers[(int) RID_EXPLICIT] = get_identifier ("explicit");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPLICIT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPLICIT]));
ridpointers[(int) RID_EXPORT] = get_identifier ("export");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPORT],
build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPORT]));
ridpointers[(int) RID_FRIEND] = get_identifier ("friend");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_FRIEND],
build_tree_list (NULL_TREE, ridpointers[(int) RID_FRIEND]));
ridpointers[(int) RID_PUBLIC] = get_identifier ("public");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PUBLIC],
build_tree_list (NULL_TREE, ridpointers[(int) RID_PUBLIC]));
ridpointers[(int) RID_PRIVATE] = get_identifier ("private");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PRIVATE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_PRIVATE]));
ridpointers[(int) RID_PROTECTED] = get_identifier ("protected");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PROTECTED],
build_tree_list (NULL_TREE, ridpointers[(int) RID_PROTECTED]));
ridpointers[(int) RID_TEMPLATE] = get_identifier ("template");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_TEMPLATE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_TEMPLATE]));
/* This is for ANSI C++. */
ridpointers[(int) RID_MUTABLE] = get_identifier ("mutable");
SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_MUTABLE],
build_tree_list (NULL_TREE, ridpointers[(int) RID_MUTABLE]));
/* Signature handling extensions. */
signature_type_node = build_int_2 (signature_type, 0);
@ -4724,12 +4664,9 @@ make_lang_type (code)
bzero ((char *) pi, (int) sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (t) = pi;
CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
CLASSTYPE_BINFO_AS_LIST (t)
= build_tree_list (NULL_TREE, TYPE_BINFO (t));
/* Make sure this is laid out, for ease of use later. In the
presence of parse errors, the normal was of assuring this

File diff suppressed because it is too large Load Diff

View File

@ -319,7 +319,7 @@ parse_decl(declarator, specs_attrs, attributes, initialized, decl)
split_specs_attrs (specs_attrs, &current_declspecs, &prefix_attributes);
if (current_declspecs
&& TREE_CODE (current_declspecs) != TREE_LIST)
current_declspecs = get_decl_list (current_declspecs);
current_declspecs = build_decl_list (NULL_TREE, current_declspecs);
if (have_extern_spec && !used_extern_spec)
{
current_declspecs = decl_tree_cons (NULL_TREE,
@ -1686,7 +1686,8 @@ type_id:
{ $$.t = build_decl_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typespec absdcl
{ $$.t = build_decl_list (get_decl_list ($1.t), $2);
{ $$.t = build_decl_list (build_decl_list (NULL_TREE, $1.t),
$2);
$$.new_type_flag = $1.new_type_flag; }
| typed_typespecs %prec EMPTY
{ $$.t = build_decl_list ($1.t, NULL_TREE);
@ -1756,7 +1757,7 @@ declmods:
nonempty_cv_qualifiers %prec EMPTY
{ $$ = $1.t; TREE_STATIC ($$) = 1; }
| SCSPEC
{ $$ = IDENTIFIER_AS_LIST ($$); }
{ $$ = build_decl_list (NULL_TREE, $$); }
| declmods CV_QUALIFIER
{ $$ = decl_tree_cons (NULL_TREE, $2, $$);
TREE_STATIC ($$) = 1; }
@ -1780,7 +1781,7 @@ declmods:
typed_typespecs:
typespec %prec EMPTY
{ $$.t = get_decl_list ($1.t);
{ $$.t = build_decl_list (NULL_TREE, $1.t);
$$.new_type_flag = $1.new_type_flag; }
| nonempty_cv_qualifiers typespec
{ $$.t = decl_tree_cons (NULL_TREE, $2.t, $1.t);
@ -2688,7 +2689,7 @@ cv_qualifiers:
nonempty_cv_qualifiers:
CV_QUALIFIER
{ $$.t = IDENTIFIER_AS_LIST ($1);
{ $$.t = build_decl_list (NULL_TREE, $1);
$$.new_type_flag = 0; }
| nonempty_cv_qualifiers CV_QUALIFIER
{ $$.t = decl_tree_cons (NULL_TREE, $2, $1.t);
@ -3578,7 +3579,8 @@ named_parm:
{ $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typespec declarator
{ $$.t = build_tree_list (get_decl_list ($1.t), $2);
{ $$.t = build_tree_list (build_decl_list (NULL_TREE, $1.t),
$2);
$$.new_type_flag = $1.new_type_flag; }
| typed_declspecs1 absdcl
{ tree specs = strip_attrs ($1.t);

View File

@ -1,5 +1,5 @@
/* Prints out trees in human readable form.
Copyright (C) 1992, 93-96, 1998 Free Software Foundation, Inc.
Copyright (C) 1992, 93-96, 1998, 1999 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
@ -126,9 +126,7 @@ print_lang_type (file, node, indent)
if (TREE_CODE (node) == RECORD_TYPE)
{
fprintf (file, " n_parents %d n_ancestors %d",
CLASSTYPE_N_BASECLASSES (node),
CLASSTYPE_N_SUPERCLASSES (node));
fprintf (file, " n_parents %d", CLASSTYPE_N_BASECLASSES (node));
fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
if (CLASSTYPE_INTERFACE_ONLY (node))
fprintf (file, " interface-only");
@ -136,9 +134,6 @@ print_lang_type (file, node, indent)
fprintf (file, " interface-unknown");
print_node (file, "member-functions", CLASSTYPE_METHOD_VEC (node),
indent + 4);
print_node (file, "baselinks",
TYPE_BINFO_BASETYPES (node) ? CLASSTYPE_BASELINK_VEC (node) : NULL_TREE,
indent + 4);
}
}

View File

@ -78,6 +78,7 @@ pop_stack_level (stack)
static struct search_level *search_stack;
static tree get_abstract_virtuals_1 PROTO((tree, int, tree));
static tree next_baselink PROTO((tree));
static tree get_vbase_1 PROTO((tree, tree, unsigned int *));
static tree convert_pointer_to_vbase PROTO((tree, tree));
static tree lookup_field_1 PROTO((tree, tree));
@ -2041,77 +2042,7 @@ get_abstract_virtuals (type)
return nreverse (abstract_virtuals);
}
/* For the type TYPE, return a list of member functions available from
base classes with name NAME. The TREE_VALUE of the list is a chain of
member functions with name NAME. The TREE_PURPOSE of the list is a
basetype, or a list of base types (in reverse order) which were
traversed to reach the chain of member functions. If we reach a base
type which provides a member function of name NAME, and which has at
most one base type itself, then we can terminate the search. */
tree
get_baselinks (type_as_binfo_list, type, name)
tree type_as_binfo_list;
tree type, name;
{
int head = 0, tail = 0, idx;
tree rval = 0, nval = 0;
tree basetypes = type_as_binfo_list;
tree binfo = TYPE_BINFO (type);
search_stack = push_search_level (search_stack, &search_obstack);
while (1)
{
tree binfos = BINFO_BASETYPES (binfo);
int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
/* Process and/or queue base types. */
for (i = 0; i < n_baselinks; i++)
{
tree base_binfo = TREE_VEC_ELT (binfos, i);
tree btypes;
btypes = hash_tree_cons (TREE_VIA_PUBLIC (base_binfo),
TREE_VIA_VIRTUAL (base_binfo),
TREE_VIA_PROTECTED (base_binfo),
NULL_TREE, base_binfo,
basetypes);
obstack_ptr_grow (&search_obstack, btypes);
search_stack->first = (tree *)obstack_base (&search_obstack);
tail += 1;
}
dont_queue:
/* Process head of queue, if one exists. */
if (head >= tail)
break;
basetypes = search_stack->first[head++];
binfo = TREE_VALUE (basetypes);
type = BINFO_TYPE (binfo);
idx = lookup_fnfields_1 (type, name);
if (idx >= 0)
{
nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
rval = hash_tree_cons (0, 0, 0, basetypes, nval, rval);
if (TYPE_BINFO_BASETYPES (type) == 0)
goto dont_queue;
else if (TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type)) == 1)
{
if (CLASSTYPE_BASELINK_VEC (type))
TREE_TYPE (rval) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
goto dont_queue;
}
}
nval = NULL_TREE;
}
search_stack = pop_search_level (search_stack);
return rval;
}
tree
static tree
next_baselink (baselink)
tree baselink;
{

View File

@ -1432,12 +1432,6 @@ finish_class_definition (t, attributes, semi)
tree attributes;
int semi;
{
#if 0
/* Need to rework class nesting in the presence of nested classes,
etc. */
shadow_tag (CLASSTYPE_AS_LIST (t)); */
#endif
/* finish_struct nukes this anyway; if finish_exception does too,
then it can go. */
if (semi)

View File

@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "toplev.h"
static tree get_identifier_list PROTO((tree));
static tree bot_manip PROTO((tree));
static tree perm_manip PROTO((tree));
static tree build_cplus_array_type_1 PROTO((tree, tree));
@ -1087,60 +1086,6 @@ hash_chainon (list1, list2)
return hash_tree_chain (TREE_VALUE (list1),
hash_chainon (TREE_CHAIN (list1), list2));
}
static tree
get_identifier_list (value)
tree value;
{
tree list = IDENTIFIER_AS_LIST (value);
if (list != NULL_TREE
&& (TREE_CODE (list) != TREE_LIST
|| TREE_VALUE (list) != value))
list = NULL_TREE;
else if (IDENTIFIER_HAS_TYPE_VALUE (value)
&& TREE_CODE (IDENTIFIER_TYPE_VALUE (value)) == RECORD_TYPE
&& IDENTIFIER_TYPE_VALUE (value)
== TYPE_MAIN_VARIANT (IDENTIFIER_TYPE_VALUE (value)))
{
tree type = IDENTIFIER_TYPE_VALUE (value);
if (TYPE_PTRMEMFUNC_P (type))
list = NULL_TREE;
else if (type == current_class_type)
/* Don't mess up the constructor name. */
list = tree_cons (NULL_TREE, value, NULL_TREE);
else
{
if (! CLASSTYPE_ID_AS_LIST (type))
CLASSTYPE_ID_AS_LIST (type)
= perm_tree_cons (NULL_TREE, TYPE_IDENTIFIER (type), NULL_TREE);
list = CLASSTYPE_ID_AS_LIST (type);
}
}
return list;
}
tree
get_decl_list (value)
tree value;
{
tree list = NULL_TREE;
if (TREE_CODE (value) == IDENTIFIER_NODE)
list = get_identifier_list (value);
else if (TREE_CODE (value) == RECORD_TYPE
&& TYPE_LANG_SPECIFIC (value)
&& value == TYPE_MAIN_VARIANT (value))
list = CLASSTYPE_AS_LIST (value);
if (list != NULL_TREE)
{
my_friendly_assert (TREE_CHAIN (list) == NULL_TREE, 301);
return list;
}
return build_decl_list (NULL_TREE, value);
}
/* Build an association between TYPE and some parameters: