From 33848bb0281d0be603c0391342284273c123ae4a Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 15 Dec 1999 01:51:24 -0800 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 69 ++++++++++++++++++++++++++++------------------ gcc/cp/cp-tree.h | 1 + gcc/cp/decl.c | 12 ++++---- gcc/cp/except.c | 6 ++-- gcc/cp/init.c | 2 +- gcc/cp/lex.c | 14 ++++++++-- gcc/cp/pt.c | 6 ++-- gcc/cp/rtti.c | 2 +- gcc/cp/semantics.c | 6 ++-- gcc/cp/tree.c | 2 +- 10 files changed, 73 insertions(+), 47 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6bb2211b2d6..949e64a0183 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +1999-12-15 Richard Henderson + + * 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 * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using @@ -176,7 +191,7 @@ (generate_ctor_or_dtor_function): Adjust accordingly. 1999-11-24 Geoffrey Keating - Greg McGary + Greg McGary * decl.c (duplicate_decls): Merge DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, @@ -585,7 +600,7 @@ Thu Nov 11 12:42:11 MST 1999 Diego Novillo * pt.c (tsubst_enum): Adjust according to build_enumerator changes. Wed Nov 10 12:43:21 1999 Philippe De Muyter - Kaveh R. Ghazi + Kaveh R. Ghazi * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. @@ -696,8 +711,8 @@ Wed Nov 10 12:43:21 1999 Philippe De Muyter 1999-11-02 Scott Snyder - * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and - IMAGPART_EXPR. + * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and + IMAGPART_EXPR. * pt.c (tsubst_copy): Likewise. 1999-11-01 Jason Merrill @@ -934,9 +949,9 @@ Wed Oct 13 22:01:35 1999 J"orn Rennecke 1999-10-7 Franz Sirl - * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. - * lex.c (cp_make_lake_type): Likewise. - * tree.c (init_tree): Init make_lang_type_fn. + * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. + * lex.c (cp_make_lake_type): Likewise. + * tree.c (init_tree): Init make_lang_type_fn. 1999-10-07 Mark Mitchell @@ -1241,19 +1256,19 @@ Thu Sep 30 00:13:27 1999 Dirk Zoller 1999-09-28 Gabriel Dos Reis - * pt.c (most_general_template): Adjust declaration. + * pt.c (most_general_template): Adjust declaration. - * cp-tree.h: (most_general_template): Declare. + * cp-tree.h: (most_general_template): Declare. - * error.c (dump_template_value): Rename to ... - (dump_template_argument): This. - (dump_template_argument_list): New function. - (dump_type): Use it. - (dump_template_parameter): New function. - (dump_template_decl): Use it. - (dump_template_bindings): New function. - (dump_function_decl): Use it. Pretty print function template - instantiations. + * error.c (dump_template_value): Rename to ... + (dump_template_argument): This. + (dump_template_argument_list): New function. + (dump_type): Use it. + (dump_template_parameter): New function. + (dump_template_decl): Use it. + (dump_template_bindings): New function. + (dump_function_decl): Use it. Pretty print function template + instantiations. 1999-09-28 Nathan Sidwell @@ -1654,7 +1669,7 @@ Mon Sep 20 10:49:05 1999 Bernd Schmidt 1999-09-17 Mark Mitchell - Turn on function-at-a-time processing. + Turn on function-at-a-time processing. * cp-tree.h (doing_semantic_analysis_p): New macro. (SF_DEFAULT): Define to zero, not SF_EXPAND. (start_handler_parms): Change prototype. @@ -2475,8 +2490,8 @@ Fri Sep 10 10:32:32 1999 Bernd Schmidt (init_search_processing): Use vptr_identifier. 1999-09-05 Richard Henderson - Bernd Schmidt - Mark Mitchell + Bernd Schmidt + Mark Mitchell * Makefile.in (parse.o): Depend on ggc.h. (decl2.o): Depend on ggc.h. @@ -3033,7 +3048,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan * typeck.c (common_type): Use same_type_p, not pointer equality, to compare types. - * cp-tree.h (build_lang_field_decl): Remove. + * cp-tree.h (build_lang_field_decl): Remove. * class.c (build_vtable): Replace calls to build_lang_field_decl with build_lang_decl. (prepare_fresh_vtable): Likewise. @@ -3489,7 +3504,7 @@ Mon Aug 23 22:17:20 1999 Mumit Khan 1999-08-09 Kaveh R. Ghazi - * lex.c (lang_identify): Likewise. + * lex.c (lang_identify): Likewise. 1999-08-09 Bernd Schmidt @@ -4079,10 +4094,10 @@ Tue Jul 20 11:24:19 1999 Bernd Schmidt Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) - * Makefile.in (INTERFACE): Bump to 2. + * Makefile.in (INTERFACE): Bump to 2. 1999-07-17 Alexandre Oliva - + * typeck2.c (my_friendly_abort): Updated URL with bug reporting instructions to gcc.gnu.org. Removed e-mail address. @@ -4206,7 +4221,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva 1999-06-28 Richard Henderson - * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. + * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. 1999-06-28 Jason Merrill @@ -4466,7 +4481,7 @@ Wed Jul 7 01:26:47 1999 Alexandre Oliva result in a valid non-type template argument. 1999-05-21 Mark Mitchell - Nathan Sidwell + Nathan Sidwell * Make-lang.in (cc1plus): Make it depend on gxx.gperf. * cp-tree.h: Fix typo in documentation on pointers-to-members. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 99b258077fe..9e341be6b47 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -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; diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3f7fe2a5918..5af732b3017 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 48eb4fd8929..7e41d2e9dea 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -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"), diff --git a/gcc/cp/init.c b/gcc/cp/init.c index e5b9d7848ad..e841feeacb9 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index a6a1d2896be..e72d01c4eff 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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 () { diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 522045685dd..48d0c7b022d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 3f8300ff6e3..6776d11670c 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -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 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c8368883d4e..339726fe7ed 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index c66d2fb54b2..37c947d8226 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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);