diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-05-13 15:17:34 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-05-13 15:17:34 +0000 |
commit | 9aa54cc915d6ef589c805d87bb751d50c8eaed1b (patch) | |
tree | 8bffdaf2d5d6487778cb3b5ae5abfe405d0963d4 /gcc/gengtype.h | |
parent | 5c0f009c926cc78fb15f1c5cfa46071a4359c9e9 (diff) |
gengtype: Support explicit pointers in template arguments
gcc/
2014-05-13 David Malcolm <dmalcolm@redhat.com>
* gengtype-parse.c (require3): Eliminate in favor of...
(require4): New.
(require_template_declaration): Update to support optional single *
on a type.
* gengtype.c (get_ultimate_base_class): Add a non-const overload.
(create_user_defined_type): Handle a single level of explicit
pointerness within template arguments.
(struct write_types_data): Add field "kind".
(filter_type_name): Handle "*" character.
(write_user_func_for_structure_ptr): Require a write_types_data
rather than just a prefix string, so that we can look up the kind
of the wtd and use it as an index into wrote_user_func_for_ptr,
ensuring that such functions are written at most once. Support
subclasses by invoking the marking function of the ultimate base
class.
(write_user_func_for_structure_body): Require a write_types_data
rather than just a prefix string, so that we can pass this to
write_user_func_for_structure_ptr.
(write_func_for_structure): Likewise.
(ggc_wtd): Add initializer of new "kind" field.
(pch_wtd): Likewise.
* gengtype.h (enum write_types_kinds): New.
(struct type): Add field wrote_user_func_for_ptr to the "s"
union member.
From-SVN: r210379
Diffstat (limited to 'gcc/gengtype.h')
-rw-r--r-- | gcc/gengtype.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gengtype.h b/gcc/gengtype.h index 345a545d294..6369001e038 100644 --- a/gcc/gengtype.h +++ b/gcc/gengtype.h @@ -127,7 +127,15 @@ extern type_p structures; extern type_p param_structs; extern pair_p variables; +/* An enum for distinguishing GGC vs PCH. */ +enum write_types_kinds +{ + WTK_GGC, + WTK_PCH, + + NUM_WTK +}; /* Discrimating kind of types we can understand. */ @@ -302,6 +310,10 @@ struct type { type_p first_subclass; /* The next in that list. */ type_p next_sibling_class; + + /* Have we already written ggc/pch user func for ptr to this? + (in write_user_func_for_structure_ptr). */ + bool wrote_user_func_for_ptr[NUM_WTK]; } s; /* when TYPE_SCALAR: */ |