aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-05-12 00:24:33 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-05-11 22:24:33 +0000
commit5ce039dfe917d694bef1ecb16844f3b1bcb7ed09 (patch)
treeb27aa77b5c6f68e088a61128b1c06c597c6b36f9 /gcc/dwarf2out.c
parent20d4397af8a085a17925d3a3a3545748d5ab7fc6 (diff)
downloadgcc-5ce039dfe917d694bef1ecb16844f3b1bcb7ed09.zip
gcc-5ce039dfe917d694bef1ecb16844f3b1bcb7ed09.tar.gz
gcc-5ce039dfe917d694bef1ecb16844f3b1bcb7ed09.tar.bz2
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index a1394ef..3212c2e 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19945,23 +19945,26 @@ gen_member_die (tree type, dw_die_ref context_die)
gen_decl_die (member, NULL, context_die);
}
+ /* We do not keep type methods in type variants. */
+ gcc_assert (TYPE_MAIN_VARIANT (type) == type);
/* Now output info about the function members (if any). */
- for (member = TYPE_METHODS (type); member; member = DECL_CHAIN (member))
- {
- /* Don't include clones in the member list. */
- if (DECL_ABSTRACT_ORIGIN (member))
- continue;
- /* Nor constructors for anonymous classes. */
- if (DECL_ARTIFICIAL (member)
- && dwarf2_name (member, 0) == NULL)
- continue;
+ if (TYPE_METHODS (type) != error_mark_node)
+ for (member = TYPE_METHODS (type); member; member = DECL_CHAIN (member))
+ {
+ /* Don't include clones in the member list. */
+ if (DECL_ABSTRACT_ORIGIN (member))
+ continue;
+ /* Nor constructors for anonymous classes. */
+ if (DECL_ARTIFICIAL (member)
+ && dwarf2_name (member, 0) == NULL)
+ continue;
- child = lookup_decl_die (member);
- if (child)
- splice_child_die (context_die, child);
- else
- gen_decl_die (member, NULL, context_die);
- }
+ child = lookup_decl_die (member);
+ if (child)
+ splice_child_die (context_die, child);
+ else
+ gen_decl_die (member, NULL, context_die);
+ }
}
/* Generate a DIE for a structure or union type. If TYPE_DECL_SUPPRESS_DEBUG