Deleted Added
full compact
class.c (52284) class.c (60967)
1/* Functions related to building classes and their related objects.
2 Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
3 Contributed by Michael Tiemann (tiemann@cygnus.com)
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by

--- 88 unchanged lines hidden (view full) ---

97static tree build_vbase_pointer PROTO((tree, tree));
98static tree build_vtable_entry PROTO((tree, tree));
99static tree get_vtable_name PROTO((tree));
100static tree get_derived_offset PROTO((tree, tree));
101static tree get_basefndecls PROTO((tree, tree));
102static void set_rtti_entry PROTO((tree, tree, tree));
103static tree build_vtable PROTO((tree, tree));
104static void prepare_fresh_vtable PROTO((tree, tree));
1/* Functions related to building classes and their related objects.
2 Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc.
3 Contributed by Michael Tiemann (tiemann@cygnus.com)
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by

--- 88 unchanged lines hidden (view full) ---

97static tree build_vbase_pointer PROTO((tree, tree));
98static tree build_vtable_entry PROTO((tree, tree));
99static tree get_vtable_name PROTO((tree));
100static tree get_derived_offset PROTO((tree, tree));
101static tree get_basefndecls PROTO((tree, tree));
102static void set_rtti_entry PROTO((tree, tree, tree));
103static tree build_vtable PROTO((tree, tree));
104static void prepare_fresh_vtable PROTO((tree, tree));
105static tree prepare_ctor_vtable PROTO((tree, tree, tree));
105static void fixup_vtable_deltas1 PROTO((tree, tree));
106static void fixup_vtable_deltas PROTO((tree, int, tree));
106static void fixup_vtable_deltas1 PROTO((tree, tree));
107static void fixup_vtable_deltas PROTO((tree, int, tree));
108static tree finish_one_ctor_vtable PROTO((tree, tree, tree, tree));
109static tree prepend_ctor_vfields_for_vbase PROTO((tree, tree, tree, tree, int, tree));
110static tree finish_ctor_vtables_for_vbases PROTO((tree, tree, tree));
111static tree finish_ctor_vtables_1 PROTO((tree, tree));
112static tree prepend_vbase_vfields PROTO((tree, int, tree));
113static void finish_ctor_vtables PROTO((tree));
107static void finish_vtbls PROTO((tree, int, tree));
108static void modify_vtable_entry PROTO((tree, tree, tree));
109static tree get_vtable_entry_n PROTO((tree, unsigned HOST_WIDE_INT));
110static void add_virtual_function PROTO((tree *, tree *, int *, tree, tree));
111static tree delete_duplicate_fields_1 PROTO((tree, tree));
112static void delete_duplicate_fields PROTO((tree));
113static void finish_struct_bits PROTO((tree, int));
114static int alter_access PROTO((tree, tree, tree, tree));

--- 553 unchanged lines hidden (view full) ---

668 tree virtuals, offset, type;
669{
670 tree vfn;
671
672 if (CLASSTYPE_COM_INTERFACE (type))
673 return;
674
675 if (flag_rtti)
114static void finish_vtbls PROTO((tree, int, tree));
115static void modify_vtable_entry PROTO((tree, tree, tree));
116static tree get_vtable_entry_n PROTO((tree, unsigned HOST_WIDE_INT));
117static void add_virtual_function PROTO((tree *, tree *, int *, tree, tree));
118static tree delete_duplicate_fields_1 PROTO((tree, tree));
119static void delete_duplicate_fields PROTO((tree));
120static void finish_struct_bits PROTO((tree, int));
121static int alter_access PROTO((tree, tree, tree, tree));

--- 553 unchanged lines hidden (view full) ---

675 tree virtuals, offset, type;
676{
677 tree vfn;
678
679 if (CLASSTYPE_COM_INTERFACE (type))
680 return;
681
682 if (flag_rtti)
676 vfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, get_tinfo_fn (type));
683 vfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, get_tinfo_fn_unused (type));
677 else
678 vfn = build1 (NOP_EXPR, vfunc_ptr_type_node, size_zero_node);
679 TREE_CONSTANT (vfn) = 1;
680
681 if (! flag_vtable_thunks)
682 TREE_VALUE (virtuals) = build_vtable_entry (offset, vfn);
683 else
684 {

--- 232 unchanged lines hidden (view full) ---

917
918 if (TREE_VIA_VIRTUAL (binfo))
919 my_friendly_assert (binfo == binfo_member (BINFO_TYPE (binfo),
920 CLASSTYPE_VBASECLASSES (current_class_type)),
921 170);
922 SET_BINFO_NEW_VTABLE_MARKED (binfo);
923}
924
684 else
685 vfn = build1 (NOP_EXPR, vfunc_ptr_type_node, size_zero_node);
686 TREE_CONSTANT (vfn) = 1;
687
688 if (! flag_vtable_thunks)
689 TREE_VALUE (virtuals) = build_vtable_entry (offset, vfn);
690 else
691 {

--- 232 unchanged lines hidden (view full) ---

924
925 if (TREE_VIA_VIRTUAL (binfo))
926 my_friendly_assert (binfo == binfo_member (BINFO_TYPE (binfo),
927 CLASSTYPE_VBASECLASSES (current_class_type)),
928 170);
929 SET_BINFO_NEW_VTABLE_MARKED (binfo);
930}
931
932/* Return a new vtable for use in initialization of the BASE subobject
933 of COMPLETE_TYPE. The vtable there goes into the vfield of the
934 VBASEBASE virtual subobject. */
935
936static tree
937prepare_ctor_vtable (complete_type, base, vbasebase)
938 tree complete_type, base, vbasebase;
939{
940 tree orig_decl = BINFO_VTABLE (vbasebase);
941 tree name = get_vlist_vtable_id (base, vbasebase);
942 tree new_decl;
943
944 new_decl = build_lang_decl (VAR_DECL, name, TREE_TYPE (orig_decl));
945 /* Remember which class this vtable is really for. */
946 DECL_CONTEXT (new_decl) = complete_type;
947
948 DECL_ARTIFICIAL (new_decl) = 1;
949 TREE_STATIC (new_decl) = 1;
950 new_decl = pushdecl_top_level (new_decl);
951 DECL_VIRTUAL_P (new_decl) = 1;
952#ifndef WRITABLE_VTABLES
953 /* Make them READONLY by default. (mrs) */
954 TREE_READONLY (new_decl) = 1;
955#endif
956 DECL_ALIGN (new_decl) = DECL_ALIGN (orig_decl);
957
958#ifdef GATHER_STATISTICS
959 n_vtables += 1;
960 n_vtable_elems += list_length (BINFO_VIRTUALS (binfo));
961#endif
962
963 /* Set TREE_PUBLIC and TREE_EXTERN as appropriate. */
964 import_export_vtable (new_decl, complete_type, 0);
965
966 return new_decl;
967}
968
925#if 0
926/* Access the virtual function table entry that logically
927 contains BASE_FNDECL. VIRTUALS is the virtual function table's
928 initializer. We can run off the end, when dealing with virtual
929 destructors in MI situations, return NULL_TREE in that case. */
930
931static tree
932get_vtable_entry (virtuals, base_fndecl)

--- 860 unchanged lines hidden (view full) ---

1793 TYPE_HAS_CONSTRUCTOR (variants) = TYPE_HAS_CONSTRUCTOR (t);
1794 TYPE_HAS_DESTRUCTOR (variants) = TYPE_HAS_DESTRUCTOR (t);
1795 TYPE_NEEDS_CONSTRUCTING (variants) = TYPE_NEEDS_CONSTRUCTING (t);
1796 TYPE_NEEDS_DESTRUCTOR (variants) = TYPE_NEEDS_DESTRUCTOR (t);
1797
1798 TYPE_USES_COMPLEX_INHERITANCE (variants) = TYPE_USES_COMPLEX_INHERITANCE (t);
1799 TYPE_VIRTUAL_P (variants) = TYPE_VIRTUAL_P (t);
1800 TYPE_USES_VIRTUAL_BASECLASSES (variants) = TYPE_USES_VIRTUAL_BASECLASSES (t);
969#if 0
970/* Access the virtual function table entry that logically
971 contains BASE_FNDECL. VIRTUALS is the virtual function table's
972 initializer. We can run off the end, when dealing with virtual
973 destructors in MI situations, return NULL_TREE in that case. */
974
975static tree
976get_vtable_entry (virtuals, base_fndecl)

--- 860 unchanged lines hidden (view full) ---

1837 TYPE_HAS_CONSTRUCTOR (variants) = TYPE_HAS_CONSTRUCTOR (t);
1838 TYPE_HAS_DESTRUCTOR (variants) = TYPE_HAS_DESTRUCTOR (t);
1839 TYPE_NEEDS_CONSTRUCTING (variants) = TYPE_NEEDS_CONSTRUCTING (t);
1840 TYPE_NEEDS_DESTRUCTOR (variants) = TYPE_NEEDS_DESTRUCTOR (t);
1841
1842 TYPE_USES_COMPLEX_INHERITANCE (variants) = TYPE_USES_COMPLEX_INHERITANCE (t);
1843 TYPE_VIRTUAL_P (variants) = TYPE_VIRTUAL_P (t);
1844 TYPE_USES_VIRTUAL_BASECLASSES (variants) = TYPE_USES_VIRTUAL_BASECLASSES (t);
1845 TYPE_USES_PVBASES (variants) = TYPE_USES_PVBASES (t);
1801 /* Copy whatever these are holding today. */
1802 TYPE_MIN_VALUE (variants) = TYPE_MIN_VALUE (t);
1803 TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t);
1804 TYPE_FIELDS (variants) = TYPE_FIELDS (t);
1805 TYPE_SIZE (variants) = TYPE_SIZE (t);
1806 TYPE_SIZE_UNIT (variants) = TYPE_SIZE_UNIT (t);
1807 variants = TYPE_NEXT_VARIANT (variants);
1808 }

--- 1119 unchanged lines hidden (view full) ---

2928 /* Here we know it is a hider, and no overrider exists. */
2929 cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
2930 cp_warning_at (" by `%D'", TREE_PURPOSE (base_fndecls));
2931 }
2932 }
2933 }
2934}
2935
1846 /* Copy whatever these are holding today. */
1847 TYPE_MIN_VALUE (variants) = TYPE_MIN_VALUE (t);
1848 TYPE_MAX_VALUE (variants) = TYPE_MAX_VALUE (t);
1849 TYPE_FIELDS (variants) = TYPE_FIELDS (t);
1850 TYPE_SIZE (variants) = TYPE_SIZE (t);
1851 TYPE_SIZE_UNIT (variants) = TYPE_SIZE_UNIT (t);
1852 variants = TYPE_NEXT_VARIANT (variants);
1853 }

--- 1119 unchanged lines hidden (view full) ---

2973 /* Here we know it is a hider, and no overrider exists. */
2974 cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
2975 cp_warning_at (" by `%D'", TREE_PURPOSE (base_fndecls));
2976 }
2977 }
2978 }
2979}
2980
2981/* Generate one vtable for use in constructors or destructors of BASE
2982 subobjects of COMPLETE_TYPE objects. The vtable belongs to the
2983 vfield of the VBASEVASE subobject of the VBASE virtual base of
2984 COMPLETE_TYPE (and BASE). */
2985
2986static tree
2987finish_one_ctor_vtable (complete_type, base, vbase, vbasebase)
2988 tree complete_type, base, vbase, vbasebase;
2989{
2990 tree virtuals;
2991 tree newtable;
2992 tree newvirtuals;
2993 tree offset;
2994 tree newvbase = binfo_member (BINFO_TYPE (vbase),
2995 CLASSTYPE_VBASECLASSES (complete_type));
2996
2997 newtable = prepare_ctor_vtable (complete_type, base, vbasebase);
2998 newvirtuals = copy_list (BINFO_VIRTUALS (vbasebase));
2999
3000 virtuals = newvirtuals;
3001 /* Change the offset entry. First, delta between base an vbase. */
3002 offset = ssize_binop (MINUS_EXPR, BINFO_OFFSET (newvbase),
3003 BINFO_OFFSET (base));
3004 /* Add delta between vbase and vbasebase. */
3005 offset = ssize_binop (PLUS_EXPR, offset, BINFO_OFFSET (vbasebase));
3006 offset = ssize_binop (MINUS_EXPR, offset, BINFO_OFFSET (vbase));
3007 /* Finally, negate. */
3008 offset = ssize_binop (MINUS_EXPR, integer_zero_node, offset);
3009 offset = build1 (NOP_EXPR, vfunc_ptr_type_node, offset);
3010 TREE_CONSTANT (offset) = 1;
3011 TREE_VALUE (virtuals) = build_vtable_entry (integer_zero_node, offset);
3012 virtuals = TREE_CHAIN (virtuals);
3013
3014 /* Skip the typeinfo function. */
3015 virtuals = TREE_CHAIN (virtuals);
3016
3017 /* Iterate over all methods of this virtual base. */
3018 for (; virtuals; virtuals = TREE_CHAIN (virtuals))
3019 {
3020 tree fndecl = TREE_VALUE (virtuals);
3021 tree pfn = FNADDR_FROM_VTABLE_ENTRY (fndecl);
3022 fndecl = TREE_OPERAND (pfn, 0);
3023 if (fndecl)
3024 {
3025 tree delta, newdelta, binfo_context;
3026 tree context = DECL_CLASS_CONTEXT (fndecl);
3027
3028 /* If this method is implemented in a base of the vbase, the
3029 thunk we have is correct. */
3030 if (DERIVED_FROM_P (context, vbase))
3031 continue;
3032
3033 binfo_context = binfo_value (context, base);
3034 if (TREE_VIA_VIRTUAL (binfo_context))
3035 binfo_context = binfo_member
3036 (context, CLASSTYPE_VBASECLASSES (complete_type));
3037 /* This is the delta from a complete C to a B subobject, or
3038 more generally to the base subobject that implements the
3039 virtual function for B. BASE already has the offset to
3040 the complete type. */
3041 delta = BINFO_OFFSET (binfo_context);
3042 /* This is the delta from the A to the complete C. */
3043 newdelta = BINFO_OFFSET (newvbase);
3044 /* This is the delta from the A to the B subobject. */
3045 newdelta = size_binop (MINUS_EXPR, newdelta, delta);
3046 newdelta = ssize_binop (MINUS_EXPR, integer_zero_node,
3047 newdelta);
3048
3049 modify_vtable_entry (virtuals,
3050 build_vtable_entry (newdelta, pfn),
3051 fndecl);
3052 }
3053 }
3054 DECL_INITIAL (newtable) = build_nt (CONSTRUCTOR, NULL_TREE,
3055 newvirtuals);
3056 DECL_CONTEXT (newtable) = NULL_TREE;
3057 cp_finish_decl (newtable, DECL_INITIAL (newtable), NULL_TREE, 0, 0);
3058 DECL_CONTEXT (newtable) = complete_type;
3059 return newtable;
3060}
3061
3062/* Add all vtables into LIST for the VBASEBASE subobject and its bases
3063 of VBASE virtual BASE of COMPLETE_TYPE for use in BASE
3064 constructors. DO_SELF indicates whether this is the VBASEBASE that
3065 has 'primary' vfield. Return the new LIST. */
3066
3067static tree
3068prepend_ctor_vfields_for_vbase (complete_type, base, vbase, vbasebase,
3069 do_self, list)
3070 tree complete_type, base, vbase, vbasebase;
3071 int do_self;
3072 tree list;
3073{
3074 int i;
3075 tree vtbl;
3076 tree bases = BINFO_BASETYPES (vbasebase);
3077 int vfp = CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (vbasebase));
3078
3079 if (do_self && CLASSTYPE_VFIELDS (BINFO_TYPE (vbasebase)))
3080 {
3081 vtbl = finish_one_ctor_vtable (complete_type, base, vbase, vbasebase);
3082 vtbl = build1 (ADDR_EXPR, vtbl_ptr_type_node, vtbl);
3083 TREE_READONLY (vtbl) = 1;
3084 TREE_CONSTANT (vtbl) = 1;
3085 list = tree_cons (NULL_TREE, vtbl, list);
3086 }
3087
3088 if (!bases)
3089 return list;
3090
3091 for (i = 0; i < TREE_VEC_LENGTH (bases); i++)
3092 {
3093 tree vbasebase = TREE_VEC_ELT (bases, i);
3094 if (TREE_VIA_VIRTUAL (vbasebase))
3095 continue;
3096 list = prepend_ctor_vfields_for_vbase
3097 (complete_type, base, vbase, vbasebase, (i != vfp), list);
3098 }
3099
3100 return list;
3101}
3102
3103/* Iterate over all virtual bases of the BASE subobject of
3104 COMPLETE_TYPE. This list is given in VBASES. Return the list of
3105 vtables generated in the process. */
3106
3107static tree
3108finish_ctor_vtables_for_vbases (vbases, base, complete_type)
3109 tree vbases, base, complete_type;
3110{
3111 tree result = NULL_TREE;
3112
3113 for (; vbases; vbases = TREE_CHAIN (vbases))
3114 result = prepend_ctor_vfields_for_vbase
3115 (complete_type, base, vbases, vbases, 1, result);
3116 return result;
3117}
3118
3119/* Generate special vtables for virtual bases for use inside base
3120 class ctors and dtors. Inside this function, we assume the
3121 following scenario:
3122 class A{virtual void foo();};
3123 class B:virtual A{int member1;}
3124 class C:B{int member2;}
3125
3126 BINFO is a base subject (e.g. B) of COMPLETE_TYPE. Returns the list
3127 of virtual tables. */
3128
3129static tree
3130finish_ctor_vtables_1 (binfo, complete_type)
3131 tree binfo;
3132 tree complete_type;
3133{
3134 int i;
3135 tree binfos;
3136 tree result = NULL_TREE;
3137
3138 binfos = BINFO_BASETYPES (binfo);
3139 if (!binfos)
3140 return result;
3141
3142 /* Iterate over all bases (i.e. B). */
3143 for (i = 0; i < TREE_VEC_LENGTH (binfos); i++)
3144 {
3145 tree base = TREE_VEC_ELT (binfos, i);
3146 tree vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (base));
3147 if (!vbases)
3148 /* This base class does not have virtual bases. */
3149 continue;
3150 if (TREE_VIA_VIRTUAL (base))
3151 /* A virtual base class is initialized on in the most-derived
3152 constructor. */
3153 continue;
3154 if (!TYPE_USES_PVBASES (BINFO_TYPE (base)))
3155 /* Class has no polymorphic vbases. */
3156 continue;
3157 /* Prepend vtable list for base class. */
3158 result = chainon (finish_ctor_vtables_1 (base, complete_type),
3159 result);
3160 /* Prepend our own vtable list. */
3161 result = chainon
3162 (finish_ctor_vtables_for_vbases (vbases, base, complete_type),
3163 result);
3164 }
3165 return result;
3166}
3167
3168/* Add the vtables of a virtual base BINFO in front of LIST, returning
3169 the new list. DO_SELF indicates whether we have to return the
3170 vtable of a vfield borrowed in a derived class. */
3171
3172static tree
3173prepend_vbase_vfields (binfo, do_self, list)
3174 tree binfo;
3175 int do_self;
3176 tree list;
3177{
3178 int i;
3179 tree vtbl;
3180 tree bases = BINFO_BASETYPES (binfo);
3181 int vfp = CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (binfo));
3182
3183 if (do_self && CLASSTYPE_VFIELDS (BINFO_TYPE (binfo)))
3184 {
3185 vtbl = BINFO_VTABLE (binfo);
3186 vtbl = build1 (ADDR_EXPR, vtbl_ptr_type_node, vtbl);
3187 TREE_READONLY (vtbl) = 1;
3188 TREE_CONSTANT (vtbl) = 1;
3189 list = tree_cons (NULL_TREE, vtbl, list);
3190 }
3191
3192 if (!bases)
3193 return list;
3194
3195 for (i = 0; i < TREE_VEC_LENGTH (bases); i++)
3196 {
3197 tree base = TREE_VEC_ELT (bases, i);
3198 if (TREE_VIA_VIRTUAL (base))
3199 continue;
3200 list = prepend_vbase_vfields (base, (i != vfp), list);
3201 }
3202
3203 return list;
3204}
3205
3206/* Wrapper around finish_ctor_vtables_1. Compute the vtable list for
3207 type T. */
3208
3209static void
3210finish_ctor_vtables (t)
3211 tree t;
3212{
3213 tree veclist = NULL_TREE;
3214 tree decl, type;
3215 char *name;
3216 tree vbase;
3217 int len;
3218
3219 /* This is only good for vtable thunks. */
3220 my_friendly_assert (flag_vtable_thunks, 990307);
3221
3222 /* Start with the list of most-derived vtables. */
3223
3224 for (vbase = CLASSTYPE_VBASECLASSES (t); vbase;
3225 vbase = TREE_CHAIN (vbase))
3226 veclist = prepend_vbase_vfields (vbase, 1, veclist);
3227
3228 /* Compute the list of vtables for the bases. */
3229 veclist = chainon (veclist, finish_ctor_vtables_1 (TYPE_BINFO (t), t));
3230
3231 /* Finally, we initialize the virtual bases first. */
3232 for (vbase = CLASSTYPE_VBASECLASSES (t); vbase;
3233 vbase = TREE_CHAIN (vbase))
3234 {
3235 tree vbases = CLASSTYPE_VBASECLASSES (BINFO_TYPE (vbase));
3236 if (!vbases)
3237 continue;
3238 veclist = chainon (veclist,
3239 finish_ctor_vtables_for_vbases (vbases, vbase, t));
3240 veclist = chainon (veclist,
3241 finish_ctor_vtables_1 (vbase, t));
3242 }
3243
3244 veclist = nreverse (veclist);
3245
3246 /* Generate the name for the vtable list. */
3247 name = alloca (strlen (VLIST_NAME_FORMAT)
3248 + TYPE_ASSEMBLER_NAME_LENGTH (t) + 2);
3249 sprintf (name, VLIST_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (t));
3250
3251 /* Build the type of the list. */
3252 len = list_length (veclist) - 1;
3253 if (len < 0)
3254 /* If this class has virtual bases without virtual methods, make a
3255 single zero-entry in the array. This avoids zero-sized objects. */
3256 len++;
3257 type = build_cplus_array_type (vtbl_ptr_type_node,
3258 build_index_type (size_int (len)));
3259
3260
3261 /* Produce a new decl holding the list. */
3262 decl = build_lang_decl (VAR_DECL, get_identifier (name), type);
3263 TREE_STATIC (decl) = 1;
3264 TREE_READONLY (decl) = 1;
3265 decl = pushdecl_top_level (decl);
3266 import_export_vtable (decl, t, 0);
3267 DECL_INITIAL (decl) = build_nt (CONSTRUCTOR, NULL_TREE, veclist);
3268
3269 DECL_ARTIFICIAL (decl) = 1;
3270 /* This tells finish_file et.al. that this is related to virtual
3271 tables. There is currently no way to distinguish between vtables
3272 and vlists, other than the name of the decl. */
3273 DECL_VIRTUAL_P (decl) = 1;
3274
3275 /* Output the array. */
3276 cp_finish_decl (decl, DECL_INITIAL (decl), NULL_TREE, 0, 0);
3277
3278 /* Set the class context after finishing, so that finish thinks this
3279 is an unrelated global, and then finish_vtable_vardecl knows what
3280 class this is related to. */
3281 DECL_CONTEXT (decl) = t;
3282}
3283
2936/* Check for things that are invalid. There are probably plenty of other
2937 things we should check for also. */
2938
2939static void
2940finish_struct_anon (t)
2941 tree t;
2942{
2943 tree field;

--- 1120 unchanged lines hidden (view full) ---

4064 && DECL_VINDEX (TREE_VEC_ELT (method_vec, 1)) == NULL_TREE)
4065 cp_warning ("`%#T' has virtual functions but non-virtual destructor",
4066 t);
4067 }
4068
4069 /* Make the rtl for any new vtables we have created, and unmark
4070 the base types we marked. */
4071 finish_vtbls (TYPE_BINFO (t), 1, t);
3284/* Check for things that are invalid. There are probably plenty of other
3285 things we should check for also. */
3286
3287static void
3288finish_struct_anon (t)
3289 tree t;
3290{
3291 tree field;

--- 1120 unchanged lines hidden (view full) ---

4412 && DECL_VINDEX (TREE_VEC_ELT (method_vec, 1)) == NULL_TREE)
4413 cp_warning ("`%#T' has virtual functions but non-virtual destructor",
4414 t);
4415 }
4416
4417 /* Make the rtl for any new vtables we have created, and unmark
4418 the base types we marked. */
4419 finish_vtbls (TYPE_BINFO (t), 1, t);
4420 /* If we use thunks, and have virtual bases, we might need to emit
4421 additional vtables. */
4422 if (flag_vtable_thunks && TYPE_USES_PVBASES (t))
4423 finish_ctor_vtables (t);
4072 hack_incomplete_structures (t);
4073
4074#if 0
4075 if (TYPE_NAME (t) && TYPE_IDENTIFIER (t))
4076 undo_template_name_overload (TYPE_IDENTIFIER (t), 1);
4077#endif
4078
4079 resume_momentary (old);

--- 1322 unchanged lines hidden ---
4424 hack_incomplete_structures (t);
4425
4426#if 0
4427 if (TYPE_NAME (t) && TYPE_IDENTIFIER (t))
4428 undo_template_name_overload (TYPE_IDENTIFIER (t), 1);
4429#endif
4430
4431 resume_momentary (old);

--- 1322 unchanged lines hidden ---