From 5ce039dfe917d694bef1ecb16844f3b1bcb7ed09 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 12 May 2015 00:24:33 +0200 Subject: class.c (fixup_type_variants): Do not copy TYPE_METHODS * class.c (fixup_type_variants): Do not copy TYPE_METHODS (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant. * semantics.c (finish_member_declaration): Likewise. * method.c (lazily_declare_fn): Allways add method to main variant list. * dwarf2out.c (gen_member_die): Sanity check that we access TYPE_MAIN_VARIANT for TYPE_METHODS. * function.c (use_register_for_decl): Look for TYPE_MAIN_VARIANT when checking TYPE_METHODS. * tree.c (free_lang_data_in_type): See TYPE_METHODS to error_mark_node if non-null. (build_distinct_type_copy): Clear TYPE_METHODS. (verify_type_variant): Verify that TYPE_METHODS is NULL for variants. (verify_type): Allow TYPE_METHODS to be error_mark_node. * tree.def: Update docs of YTPE_STUB_DECL and TYPE_METHODS. From-SVN: r223021 --- gcc/tree.def | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/tree.def') diff --git a/gcc/tree.def b/gcc/tree.def index ea7bea0..56580af 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -110,9 +110,12 @@ DEFTREECODE (BLOCK, "block", tcc_exceptional, 0) particular, since any type which is of some type category (e.g. an array type or a function type) which cannot either have a name itself or have named members doesn't really have a "scope" per se. - The TREE_CHAIN field is used as a forward-references to names for + The TYPE_STUB_DECL field is used as a forward-references to names for ENUMERAL_TYPE, RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE nodes; - see below. */ + see below. + The TYPE_METHODS points to list of all methods associated with the type. + It is non-NULL only at main variant of the type and after free_lang_data + it may be set to error_mark_node instead of actual list to save memory. */ /* The ordering of the following codes is optimized for the checking macros in tree.h. Changing the order will degrade the speed of the -- cgit v1.1