diff options
author | David Malcolm <dmalcolm@redhat.com> | 2013-10-29 01:16:05 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2013-10-29 01:16:05 +0000 |
commit | 32fe52714e42a391c6a7a1ac18bb0a57a80ecb5b (patch) | |
tree | 456914960b33f804e0e0a01a2caaa7e312150c73 /gcc/expr.c | |
parent | 1ed5a6cc504ef8089f1431590c2fbca15b6a2475 (diff) | |
download | gcc-32fe52714e42a391c6a7a1ac18bb0a57a80ecb5b.zip gcc-32fe52714e42a391c6a7a1ac18bb0a57a80ecb5b.tar.gz gcc-32fe52714e42a391c6a7a1ac18bb0a57a80ecb5b.tar.bz2 |
Make gengtype more robust against user error
* doc/gty.texi ("Inheritance and GTY"): Make it clear that
to use autogenerated markers for a class-hierarchy, every class
must have a GTY marker.
* gengtype.h (struct type): Add linked list of subclasses to
the "s" member of the union.
(add_subclass): New decl.
* gengtype-state.c (read_state_struct_type): Set up subclass
linked list.
* gengtype.c (get_ultimate_base_class): New.
(add_subclass): New.
(new_structure): Set up subclass linked list.
(set_gc_used_type): Propagate usage information to subclasses.
(output_mangled_typename): Use get_ultimate_base_class.
(walk_subclasses): Use the subclass linked list, avoiding an
O(N^2) when writing out all types.
(walk_type): Issue an error if the base class is missing a tag,
rather than generating bogus C code. Add a gcc_unreachable
default case, in case people omit tags from concrete subclasses,
or get the values wrong.
(write_func_for_structure): Issue an error for subclasses for
which the base doesn't have a "desc", since otherwise the
autogenerated routines for the base would silently fail to visit
any subclass fields.
(write_root): Use get_ultimate_base_class, tweaking constness of
tp to match that function's signature.
From-SVN: r204148
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions