cp-tree.h (make_aggr_type): Declare.

* cp-tree.h (make_aggr_type): Declare.
        * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
        (make_aggr_type): New.

        * decl.c (build_typename_type, init_decl_processing): Use it.
        (build_ptrmemfunc_type, xref_tag): Likewise.
        * except.c (call_eh_info): Likewise.
        * init.c (init_init_processing): Likewise.
        * pt.c (process_template_parm, lookup_template_class): Likewise.
        * rtti.c (expand_class_desc): Likewise.
        * semantics.c (begin_class_definition, finish_typeof): Likewise.
        * tree.c (copy_template_template_parm): Likewise.

From-SVN: r30951
This commit is contained in:
Richard Henderson 1999-12-15 01:51:24 -08:00
parent 6ff7fb9572
commit 33848bb028
10 changed files with 73 additions and 47 deletions

View File

@ -1,3 +1,18 @@
1999-12-15 Richard Henderson <rth@cygnus.com>
* cp-tree.h (make_aggr_type): Declare.
* lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
(make_aggr_type): New.
* decl.c (build_typename_type, init_decl_processing): Use it.
(build_ptrmemfunc_type, xref_tag): Likewise.
* except.c (call_eh_info): Likewise.
* init.c (init_init_processing): Likewise.
* pt.c (process_template_parm, lookup_template_class): Likewise.
* rtti.c (expand_class_desc): Likewise.
* semantics.c (begin_class_definition, finish_typeof): Likewise.
* tree.c (copy_template_template_parm): Likewise.
1999-12-15 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using

View File

@ -3743,6 +3743,7 @@ extern tree build_lang_decl PROTO((enum tree_code, tree, tree));
extern void retrofit_lang_decl PROTO((tree));
extern void copy_lang_decl PROTO((tree));
extern tree cp_make_lang_type PROTO((enum tree_code));
extern tree make_aggr_type PROTO((enum tree_code));
extern void dump_time_statistics PROTO((void));
extern void compiler_error PVPROTO((const char *, ...))
ATTRIBUTE_PRINTF_1;

View File

@ -5225,7 +5225,7 @@ build_typename_type (context, name, fullname, base_type)
}
/* Build the TYPENAME_TYPE. */
t = make_lang_type (TYPENAME_TYPE);
t = make_aggr_type (TYPENAME_TYPE);
TYPE_CONTEXT (t) = FROB_CONTEXT (context);
TYPENAME_TYPE_FULLNAME (t) = fullname;
TREE_TYPE (t) = base_type;
@ -6163,7 +6163,7 @@ init_decl_processing ()
/* This is just some anonymous class type. Nobody should ever
need to look inside this envelope. */
class_star_type_node = build_pointer_type (make_lang_type (RECORD_TYPE));
class_star_type_node = build_pointer_type (make_aggr_type (RECORD_TYPE));
if (flag_huge_objects)
delta_type_node = long_integer_type_node;
@ -6234,7 +6234,7 @@ init_decl_processing ()
}
else
{
vtable_entry_type = make_lang_type (RECORD_TYPE);
vtable_entry_type = make_aggr_type (RECORD_TYPE);
fields[0] = build_lang_decl (FIELD_DECL, delta_identifier,
delta_type_node);
fields[1] = build_lang_decl (FIELD_DECL, index_identifier,
@ -8615,7 +8615,7 @@ build_ptrmemfunc_type (type)
unqualified_variant
= build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type));
u = make_lang_type (UNION_TYPE);
u = make_aggr_type (UNION_TYPE);
SET_IS_AGGR_TYPE (u, 0);
fields[0] = build_lang_decl (FIELD_DECL, pfn_identifier, type);
fields[1] = build_lang_decl (FIELD_DECL, delta2_identifier,
@ -8623,7 +8623,7 @@ build_ptrmemfunc_type (type)
finish_builtin_type (u, "__ptrmemfunc_type", fields, 1, ptr_type_node);
TYPE_NAME (u) = NULL_TREE;
t = make_lang_type (RECORD_TYPE);
t = make_aggr_type (RECORD_TYPE);
/* Let the front-end know this is a pointer to member function... */
TYPE_PTRMEMFUNC_FLAG (t) = 1;
@ -12121,7 +12121,7 @@ xref_tag (code_type_node, name, globalize)
{
struct binding_level *old_b = class_binding_level;
ref = make_lang_type (code);
ref = make_aggr_type (code);
TYPE_CONTEXT (ref) = context;
#ifdef NONNESTED_CLASSES

View File

@ -195,7 +195,7 @@ call_eh_info ()
/* struct cp_eh_info. This must match exception.cc. Note that this
type is not pushed anywhere. */
t1= make_lang_type (RECORD_TYPE);
t1= make_aggr_type (RECORD_TYPE);
fields[0] = build_lang_decl (FIELD_DECL,
get_identifier ("handler_label"), ptr_type_node);
fields[1] = build_lang_decl (FIELD_DECL,
@ -209,7 +209,7 @@ call_eh_info ()
finish_builtin_type (t1, "eh_context", fields, 3, ptr_type_node);
t1 = build_pointer_type (t1);
t1= make_lang_type (RECORD_TYPE);
t1= make_aggr_type (RECORD_TYPE);
fields[0] = build_lang_decl (FIELD_DECL,
get_identifier ("match_function"), ptr_type_node);
fields[1] = build_lang_decl (FIELD_DECL,
@ -219,7 +219,7 @@ call_eh_info ()
/* N.B.: The fourth field LEN is expected to be
the number of fields - 1, not the total number of fields. */
finish_builtin_type (t1, "__eh_info", fields, 2, ptr_type_node);
t = make_lang_type (RECORD_TYPE);
t = make_aggr_type (RECORD_TYPE);
fields[0] = build_lang_decl (FIELD_DECL,
get_identifier ("eh_info"), t1);
fields[1] = build_lang_decl (FIELD_DECL, get_identifier ("value"),

View File

@ -62,7 +62,7 @@ void init_init_processing ()
/* Define the structure that holds header information for
arrays allocated via operator new. */
BI_header_type = make_lang_type (RECORD_TYPE);
BI_header_type = make_aggr_type (RECORD_TYPE);
nelts_identifier = get_identifier ("nelts");
fields[0] = build_lang_decl (FIELD_DECL, nelts_identifier, sizetype);

View File

@ -4784,8 +4784,6 @@ cp_make_lang_type (code)
{
struct lang_type *pi;
SET_IS_AGGR_TYPE (t, 1);
pi = (struct lang_type *) ggc_alloc (sizeof (struct lang_type));
bzero ((char *) pi, (int) sizeof (struct lang_type));
@ -4819,6 +4817,18 @@ cp_make_lang_type (code)
return t;
}
tree
make_aggr_type (code)
enum tree_code code;
{
tree t = cp_make_lang_type (code);
if (IS_AGGR_TYPE_CODE (code))
SET_IS_AGGR_TYPE (t, 1);
return t;
}
void
dump_time_statistics ()
{

View File

@ -1793,7 +1793,7 @@ process_template_parm (list, next)
if (parm && TREE_CODE (parm) == TEMPLATE_DECL)
{
t = make_lang_type (TEMPLATE_TEMPLATE_PARM);
t = make_aggr_type (TEMPLATE_TEMPLATE_PARM);
/* This is for distinguishing between real templates and template
template parameters */
TREE_TYPE (parm) = t;
@ -1802,7 +1802,7 @@ process_template_parm (list, next)
}
else
{
t = make_lang_type (TEMPLATE_TYPE_PARM);
t = make_aggr_type (TEMPLATE_TYPE_PARM);
/* parm is either IDENTIFIER_NODE or NULL_TREE */
decl = build_decl (TYPE_DECL, parm, t);
}
@ -3904,7 +3904,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope)
}
else
{
t = make_lang_type (TREE_CODE (template_type));
t = make_aggr_type (TREE_CODE (template_type));
CLASSTYPE_DECLARED_CLASS (t)
= CLASSTYPE_DECLARED_CLASS (template_type);
CLASSTYPE_GOT_SEMICOLON (t) = 1;

View File

@ -811,7 +811,7 @@ expand_class_desc (tdecl, type)
/* A reasonably close approximation of __class_type_info::base_info */
base_info_type_node = make_lang_type (RECORD_TYPE);
base_info_type_node = make_aggr_type (RECORD_TYPE);
/* Actually const __user_type_info * */
fields [0] = build_lang_decl

View File

@ -1815,7 +1815,7 @@ begin_class_definition (t)
if (t == error_mark_node
|| ! IS_AGGR_TYPE (t))
{
t = make_lang_type (RECORD_TYPE);
t = make_aggr_type (RECORD_TYPE);
pushtag (make_anon_name (), t, 0);
}
@ -1880,7 +1880,7 @@ begin_class_definition (t)
if (TYPE_BEING_DEFINED (t))
{
t = make_lang_type (TREE_CODE (t));
t = make_aggr_type (TREE_CODE (t));
pushtag (TYPE_IDENTIFIER (t), t, 0);
}
maybe_process_partial_specialization (t);
@ -2223,7 +2223,7 @@ finish_typeof (expr)
{
tree t;
t = make_lang_type (TYPEOF_TYPE);
t = make_aggr_type (TYPEOF_TYPE);
TYPE_FIELDS (t) = expr;
return t;

View File

@ -1560,7 +1560,7 @@ copy_template_template_parm (t)
tree template = TYPE_NAME (t);
tree t2;
t2 = make_lang_type (TEMPLATE_TEMPLATE_PARM);
t2 = make_aggr_type (TEMPLATE_TEMPLATE_PARM);
template = copy_node (template);
copy_lang_decl (template);