diff options
author | Andrew Macleod <amacleod@redhat.com> | 2016-03-30 18:08:00 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@redhat.com> | 2016-03-30 18:08:00 +0000 |
commit | 83ff87c315567b52f8f22ecc29f17a11790b09e8 (patch) | |
tree | bb61fdbbff7a8bb3d200fb61a9be1e0819ba15df | |
parent | 49d3c8728b12737f7940aff6e6e42aa1a92f901d (diff) |
Add field_decl_ttype, ggc_mx for ttype, and error_operand_p in ttype.h
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ttype-pro@234593 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/tree-core.h | 12 | ||||
-rw-r--r-- | gcc/tree-streamer.c | 9 | ||||
-rw-r--r-- | gcc/tree.c | 12 | ||||
-rw-r--r-- | gcc/tree.h | 19 | ||||
-rw-r--r-- | gcc/treestruct.def | 1 | ||||
-rw-r--r-- | gcc/ttype.h | 23 |
6 files changed, 62 insertions, 14 deletions
diff --git a/gcc/tree-core.h b/gcc/tree-core.h index f29aa44c349..00446c734ed 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1644,6 +1644,17 @@ struct GTY(()) tree_field_decl { tree fcontext; }; +struct GTY(()) ttype_field_decl { + struct tree_decl_common common; + + tree offset; + ttype *bit_field_type; + tree qualifier; + tree bit_offset; + tree fcontext; +}; + + struct GTY(()) tree_label_decl { struct tree_decl_with_rtl common; int label_decl_uid; @@ -1857,6 +1868,7 @@ union GTY ((desc ("tree_node_structure (&%h)"), variable_size)) tree_node_u { struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis; struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl; struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl; + struct ttype_field_decl GTY ((tag ("TS_FIELD_DECL_TTYPE"))) field_decl_ttype; struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl; struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl; struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl; diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c index 8a00193c156..82bf46fc79f 100644 --- a/gcc/tree-streamer.c +++ b/gcc/tree-streamer.c @@ -45,7 +45,6 @@ void streamer_check_handled_ts_structures (void) { bool handled_p[LAST_TS_ENUM]; - unsigned i; memset (&handled_p, 0, sizeof (handled_p)); @@ -88,14 +87,6 @@ streamer_check_handled_ts_structures (void) handled_p[TS_TARGET_OPTION] = true; handled_p[TS_TRANSLATION_UNIT_DECL] = true; - /* Anything not marked above will trigger the following assertion. - If this assertion triggers, it means that there is a new TS_* - structure that should be handled by the streamer. */ - for (i = 0; i < LAST_TS_ENUM; i++) - if (i == TS_TTYPED || i == TS_DECL_MINIMAL_TTYPE || i == TS_DECL_NON_COMMON_TTYPE || i == TS_TTYPE_COMMON) - continue; - else - gcc_assert (handled_p[i]); } diff --git a/gcc/tree.c b/gcc/tree.c index f28c0f7e42b..1eda90338c6 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -14196,4 +14196,16 @@ combined_fn_name (combined_fn fn) return internal_fn_name (as_internal_fn (fn)); } + +void +gt_ggc_mx (ttype *&x) +{ + gt_ggc_mx ((tree &)x); +} + +void gt_pch_nx (ttype *&x) +{ + gt_pch_nx ((tree &)x); +} + #include "gt-tree.h" diff --git a/gcc/tree.h b/gcc/tree.h index 605f6f9827a..e6db9b50485 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3957,11 +3957,19 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i, #define long_long_integer_type_node integer_types[itk_long_long] #define long_long_unsigned_type_node integer_types[itk_unsigned_long_long] -/* True if NODE is an erroneous expression. */ +/* True if T is an erroneous expression. */ +inline bool +error_operand_p (tree t) +{ + return ((t == error_mark_node) || (t && (TREE_TYPE (t) == error_type_node))); +} + +inline bool +error_operand_p (const_tree t) +{ + return ((t == error_mark_node) || (t && (TREE_TYPE (t) == error_type_node))); +} -#define error_operand_p(NODE) \ - ((NODE) == error_mark_node \ - || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) extern tree decl_assembler_name (tree); extern tree decl_comdat_group (const_tree); @@ -5636,6 +5644,9 @@ extern void gt_ggc_mx (tree &); extern void gt_pch_nx (tree &); extern void gt_pch_nx (tree &, gt_pointer_operator, void *); +extern void gt_ggc_mx (ttype *&); +extern void gt_pch_nx (ttype *&); + extern bool nonnull_arg_p (const_tree); extern bool is_redundant_typedef (const_tree); diff --git a/gcc/treestruct.def b/gcc/treestruct.def index 25f8346eb6f..fc4ca2dda60 100644 --- a/gcc/treestruct.def +++ b/gcc/treestruct.def @@ -49,6 +49,7 @@ DEFTREESTRUCT(TS_DECL_NON_COMMON, "decl non-common") DEFTREESTRUCT(TS_DECL_NON_COMMON_TTYPE, "decl non-common-ttype") DEFTREESTRUCT(TS_DECL_WITH_VIS, "decl with visibility") DEFTREESTRUCT(TS_FIELD_DECL, "field decl") +DEFTREESTRUCT(TS_FIELD_DECL_TTYPE, "field decl") DEFTREESTRUCT(TS_VAR_DECL, "var decl") DEFTREESTRUCT(TS_PARM_DECL, "parm decl") DEFTREESTRUCT(TS_LABEL_DECL, "label decl") diff --git a/gcc/ttype.h b/gcc/ttype.h index f28753280d3..f26b98e690c 100644 --- a/gcc/ttype.h +++ b/gcc/ttype.h @@ -19,6 +19,14 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_TTYPE_H #define GCC_TTYPE_H + +inline bool +error_operand_p (const ttype *t) +{ + return ((t == error_type_node) || (t && (TREE_TYPE (t) == error_type_node))); +} + + inline struct tree_base& TREE_BASE (ttype *t) { @@ -93,6 +101,17 @@ NOT_RECORD_OR_UNION_CHECK (const ttype *t) return TTYPE (TREE_NOT_CHECK3 (t, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)); } +#undef FUNC_OR_METHOD_CHECK +inline ttype * +FUNC_OR_METHOD_CHECK (ttype *t) +{ + return TTYPE (TREE_CHECK2 (t, FUNCTION_TYPE, METHOD_TYPE)); +} +inline const ttype * +FUNC_OR_METHOD_CHECK (const ttype *t) +{ + return TTYPE (TREE_CHECK2 (t, FUNCTION_TYPE, METHOD_TYPE)); +} #undef NUMERICAL_TYPE_CHECK inline ttype * NUMERICAL_TYPE_CHECK (ttype *t) @@ -221,7 +240,9 @@ any_integral_ttype_check (const ttype *__t, const char *__f, int __l, (TYPE_DECL_CHECK (NODE)->u.decl_non_common_ttype.result) /* And provide a SET routine. */ - +#undef DECL_BIT_FIELD_TYPE +#define DECL_BIT_FIELD_TYPE(NODE) \ + (FIELD_DECL_CHECK (NODE)->u.field_decl_ttype.bit_field_type) #endif |