This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
GTY as attribute
- From: Taras Glek <tglek at mozilla dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 09 Jul 2008 13:45:48 -0700
- Subject: GTY as attribute
Hello,
I found GTY annotations to be a useful tool for my work. However the
fact that they are not included in the AST is unfortunate. Turns out GTY
can be defined as an attribute with
#define GTY(x) __attribute__((user (("gty:"#x))))
Then all of the handy GTY annotations are reflected in the AST. This
works in most cases except for struct declaration syntax used by GTY is
incompatible with that of attributes.
gengtype requires
struct name GTY{
syntax whereas attributes require
struct GTY name {
syntax.
This patch modifies gengtype to accept the attribute declaration style
and modifies GCC headers such that they compile with the above macro.
Please consider this for inclusion in GCC. I think it's conceptually
cleaner to have GTY and attribute conventions match and it opens way to
possibly using GCC itself instead of gengtype's hacky parser for future
GTY revisions.
This will also significantly reduce the maintenance burden for my
project: http://developer.mozilla.org/en/docs/Treehydra where GTY
annotations are used to generate all code to reflect GIMPLE into JavaScript.
Thanks,
Taras
* * *
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -114,8 +114,8 @@ typedef HOST_WIDEST_INT gcov_type;
typedef HOST_WIDEST_INT gcov_type;
/* Control flow edge information. */
-struct edge_def GTY(())
-{
+struct GTY(())
+ edge_def {
/* The two blocks at the ends of the edge. */
struct basic_block_def *src;
struct basic_block_def *dest;
@@ -211,8 +211,8 @@ struct rtl_bb_info;
basic blocks. */
/* Basic block information indexed by block number. */
-struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")))
-{
+struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")))
+ basic_block_def {
/* The edges into and out of the block. */
VEC(edge,gc) *preds;
VEC(edge,gc) *succs;
@@ -231,8 +231,8 @@ struct basic_block_def GTY((chain_next (
struct basic_block_def *next_bb;
union basic_block_il_dependent {
- struct tree_bb_info * GTY ((tag ("0"))) tree;
- struct rtl_bb_info * GTY ((tag ("1"))) rtl;
+ struct tree_bb_info GTY ((tag ("0"))) * tree;
+ struct rtl_bb_info GTY ((tag ("1"))) * rtl;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
/* Expected number of executions: calculated in profile.c. */
@@ -251,8 +251,8 @@ struct basic_block_def GTY((chain_next (
int flags;
};
-struct rtl_bb_info GTY(())
-{
+struct GTY(())
+ rtl_bb_info {
/* The first and last insns of the block. */
rtx head_;
rtx end_;
@@ -266,8 +266,8 @@ struct rtl_bb_info GTY(())
int visited;
};
-struct tree_bb_info GTY(())
-{
+struct GTY(())
+ tree_bb_info {
/* Pointers to the first and last trees of the block. */
tree stmt_list;
@@ -363,8 +363,8 @@ enum dom_state
The x_* prefixing is necessary because otherwise references to the
fields of this struct are interpreted as the defines for backward
source compatibility following the definition of this struct. */
-struct control_flow_graph GTY(())
-{
+struct GTY(())
+ control_flow_graph {
/* Block pointers for the exit and entry of a function.
These are always the head and tail of the basic block list. */
basic_block x_entry_block_ptr;
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -42,8 +42,8 @@ typedef unsigned long BITMAP_WORD;
#define BITMAP_ELEMENT_ALL_BITS (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS)
/* Obstack for allocating bitmaps and elements from. */
-typedef struct bitmap_obstack GTY (())
-{
+typedef struct GTY (())
+ bitmap_obstack {
struct bitmap_element_def *elements;
struct bitmap_head_def *heads;
struct obstack GTY ((skip)) obstack;
@@ -61,8 +61,8 @@ typedef struct bitmap_obstack GTY (())
bitmap_elt_clear_from to be implemented in unit time rather than
linear in the number of elements to be freed. */
-typedef struct bitmap_element_def GTY(())
-{
+typedef struct GTY(())
+ bitmap_element_def {
struct bitmap_element_def *next; /* Next element. */
struct bitmap_element_def *prev; /* Previous element. */
unsigned int indx; /* regno/BITMAP_ELEMENT_ALL_BITS. */
@@ -74,7 +74,7 @@ struct bitmap_descriptor;
statistics we need to add a bitmap descriptor pointer. As it is
not collected, we can just GTY((skip)) it. */
-typedef struct bitmap_head_def GTY(()) {
+typedef struct GTY(()) bitmap_head_def {
bitmap_element *first; /* First element in linked list. */
bitmap_element *current; /* Last element looked at. */
unsigned int indx; /* Index of last element looked at. */
diff --git a/gcc/c-common.h b/gcc/c-common.h
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -191,7 +191,7 @@ enum c_tree_index
/* Identifier part common to the C front ends. Inherits from
tree_identifier, despite appearances. */
-struct c_common_identifier GTY(())
+struct GTY(()) c_common_identifier
{
struct tree_common common;
struct cpp_hashnode node;
@@ -239,7 +239,7 @@ extern GTY(()) tree c_global_trees[CTI_M
/* In a RECORD_TYPE, a sorted array of the fields of the type, not a
tree for size reasons. */
-struct sorted_fields_type GTY(())
+struct GTY(()) sorted_fields_type
{
int len;
tree GTY((length ("%h.len"))) elts[1];
@@ -267,7 +267,7 @@ extern c_language_kind c_language;
/* Information about a statement tree. */
-struct stmt_tree_s GTY(()) {
+struct GTY(()) stmt_tree_s {
/* The current statement list being collected. */
tree x_cur_stmt_list;
@@ -293,7 +293,7 @@ typedef struct stmt_tree_s *stmt_tree;
/* Global state pertinent to the current function. Some C dialects
extend this structure with additional fields. */
-struct c_language_function GTY(()) {
+struct GTY(()) c_language_function {
/* While we are parsing the function, this contains information
about the statement-tree that we are building. */
struct stmt_tree_s x_stmt_tree;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -51,7 +51,7 @@ extern const char * const cgraph_availab
/* Information about the function collected locally.
Available after function is analyzed. */
-struct cgraph_local_info GTY(())
+struct GTY(()) cgraph_local_info
{
struct inline_summary {
/* Estimated stack frame consumption by the function. */
@@ -93,7 +93,7 @@ struct cgraph_local_info GTY(())
/* Information about the function that needs to be computed globally
once compilation is finished. Available only with -funit-at-time. */
-struct cgraph_global_info GTY(())
+struct GTY(()) cgraph_global_info
{
/* Estimated stack frame consumption by the function. */
HOST_WIDE_INT estimated_stack_size;
@@ -116,7 +116,7 @@ struct cgraph_global_info GTY(())
/* Information about the function that is propagated by the RTL backend.
Available only for functions that has been already assembled. */
-struct cgraph_rtl_info GTY(())
+struct GTY(()) cgraph_rtl_info
{
unsigned int preferred_incoming_stack_boundary;
};
@@ -124,7 +124,7 @@ struct cgraph_rtl_info GTY(())
/* The cgraph data structure.
Each function decl has assigned cgraph_node listing callees and callers. */
-struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
+struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node
{
tree decl;
struct cgraph_edge *callees;
@@ -188,7 +188,7 @@ struct cgraph_node GTY((chain_next ("%h.
int pid;
};
-struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller")))
+struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgraph_edge
{
struct cgraph_node *caller;
struct cgraph_node *callee;
@@ -224,7 +224,7 @@ DEF_VEC_ALLOC_P(cgraph_edge_p,heap);
/* The varpool data structure.
Each static variable decl has assigned varpool_node. */
-struct varpool_node GTY(())
+struct GTY(()) varpool_node
{
tree decl;
/* Pointer to the next function in varpool_nodes. */
@@ -255,7 +255,7 @@ struct varpool_node GTY(())
/* Every top level asm statement is put into a cgraph_asm_node. */
-struct cgraph_asm_node GTY(())
+struct GTY(()) cgraph_asm_node
{
/* Next asm node. */
struct cgraph_asm_node *next;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2487,7 +2487,7 @@ enum ix86_stack_slot
#define FASTCALL_PREFIX '@'
-struct machine_function GTY(())
+struct GTY(()) machine_function
{
struct stack_local_entry *stack_locals;
const char *some_ld_name;
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -32,7 +32,10 @@ along with GCC; see the file COPYING3.
#ifndef GCC_CORETYPES_H
#define GCC_CORETYPES_H
+/* Allow GTY to be overridded as an attribute */
+#ifndef GTY
#define GTY(x) /* nothing - marker for gengtype */
+#endif
#ifndef USED_FOR_TARGET
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -203,7 +203,7 @@ struct diagnostic_info;
/* Language-dependent contents of an identifier. */
-struct lang_identifier GTY(())
+struct GTY(()) lang_identifier
{
struct c_common_identifier c_common;
cxx_binding *namespace_bindings;
@@ -221,7 +221,7 @@ struct lang_identifier GTY(())
#define LANG_IDENTIFIER_CAST(NODE) \
((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
-struct template_parm_index_s GTY(())
+struct GTY(()) template_parm_index_s
{
struct tree_common common;
int index;
@@ -231,7 +231,7 @@ struct template_parm_index_s GTY(())
};
typedef struct template_parm_index_s template_parm_index;
-struct ptrmem_cst GTY(())
+struct GTY(()) ptrmem_cst
{
struct tree_common common;
/* This isn't used, but the middle-end expects all constants to have
@@ -315,7 +315,7 @@ typedef struct ptrmem_cst * ptrmem_cst_t
is not important for this node. */
#define OVL_USED(NODE) TREE_USED (NODE)
-struct tree_overload GTY(())
+struct GTY(()) tree_overload
{
struct tree_common common;
tree function;
@@ -347,7 +347,7 @@ struct tree_overload GTY(())
#define BASELINK_QUALIFIED_P(NODE) \
TREE_LANG_FLAG_0 (BASELINK_CHECK (NODE))
-struct tree_baselink GTY(())
+struct GTY(()) tree_baselink
{
struct tree_common common;
tree binfo;
@@ -437,7 +437,7 @@ typedef enum cp_id_kind
#define DEFARG_INSTANTIATIONS(NODE) \
(((struct tree_default_arg *)DEFAULT_ARG_CHECK (NODE))->instantiations)
-struct tree_default_arg GTY (())
+struct GTY (()) tree_default_arg
{
struct tree_common common;
struct cp_token_cache *tokens;
@@ -459,7 +459,7 @@ struct tree_default_arg GTY (())
#define STATIC_ASSERT_SOURCE_LOCATION(NODE) \
(((struct tree_static_assert *)STATIC_ASSERT_CHECK (NODE))->location)
-struct tree_static_assert GTY (())
+struct GTY (()) tree_static_assert
{
struct tree_common common;
tree condition;
@@ -467,7 +467,7 @@ struct tree_static_assert GTY (())
location_t location;
};
-struct tree_argument_pack_select GTY (())
+struct GTY (()) tree_argument_pack_select
{
struct tree_common common;
tree argument_pack;
@@ -508,7 +508,7 @@ typedef enum cp_trait_kind
#define TRAIT_EXPR_KIND(NODE) \
(((struct tree_trait_expr *)TRAIT_EXPR_CHECK (NODE))->kind)
-struct tree_trait_expr GTY (())
+struct GTY (()) tree_trait_expr
{
struct tree_common common;
tree type1;
@@ -533,8 +533,9 @@ enum cp_tree_node_structure_enum {
};
/* The resulting tree type. */
-union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+union GTY((desc ("cp_tree_node_structure (&%h)"),
+ chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+lang_tree_node
{
union tree_node GTY ((tag ("TS_CP_GENERIC"),
desc ("tree_node_structure (&%h)"))) generic;
@@ -731,7 +732,7 @@ extern GTY(()) tree cp_global_trees[CPTI
/* Global state. */
-struct saved_scope GTY(())
+struct GTY(()) saved_scope
{
VEC(cxx_saved_binding,gc) *old_bindings;
tree old_namespace;
@@ -810,7 +811,7 @@ struct saved_scope GTY(())
extern GTY(()) struct saved_scope *scope_chain;
-struct cxx_int_tree_map GTY(())
+struct GTY(()) cxx_int_tree_map
{
unsigned int uid;
tree to;
@@ -821,7 +822,7 @@ extern int cxx_int_tree_map_eq (const vo
/* Global state pertinent to the current function. */
-struct language_function GTY(())
+struct GTY(()) language_function
{
struct c_language_function base;
@@ -1045,7 +1046,7 @@ enum languages { lang_c, lang_cplusplus,
#define CLASSTYPE_VISIBILITY_SPECIFIED(TYPE) \
DECL_VISIBILITY_SPECIFIED (TYPE_NAME (TYPE))
-typedef struct tree_pair_s GTY (())
+typedef struct GTY (()) tree_pair_s
{
tree purpose;
tree value;
@@ -1057,7 +1058,7 @@ DEF_VEC_ALLOC_O (tree_pair_s,gc);
/* This is a few header flags for 'struct lang_type'. Actually,
all but the first are used only for lang_type_class; they
are put in this structure to save space. */
-struct lang_type_header GTY(())
+struct GTY(()) lang_type_header
{
BOOL_BITFIELD is_lang_type_class : 1;
@@ -1084,7 +1085,7 @@ struct lang_type_header GTY(())
many (i.e., thousands) of classes can easily be generated.
Therefore, we should endeavor to keep the size of this structure to
a minimum. */
-struct lang_type_class GTY(())
+struct GTY(()) lang_type_class
{
struct lang_type_header h;
@@ -1160,13 +1161,13 @@ struct lang_type_class GTY(())
tree objc_info;
};
-struct lang_type_ptrmem GTY(())
+struct GTY(()) lang_type_ptrmem
{
struct lang_type_header h;
tree record;
};
-struct lang_type GTY(())
+struct GTY(()) lang_type
{
union lang_type_u
{
@@ -1577,7 +1578,7 @@ struct lang_type GTY(())
|| TREE_CODE (NODE) == CONST_DECL \
|| TREE_CODE (NODE) == USING_DECL))
-struct lang_decl_flags GTY(())
+struct GTY(()) lang_decl_flags
{
ENUM_BITFIELD(languages) language : 4;
unsigned global_ctor_p : 1;
@@ -1637,7 +1638,7 @@ struct lang_decl_flags GTY(())
/* sorted_fields is sorted based on a pointer, so we need to be able
to resort it if pointers get rearranged. */
-struct lang_decl GTY(())
+struct GTY(()) lang_decl
{
struct lang_decl_flags decl_flags;
@@ -2497,7 +2498,7 @@ extern void decl_shadowed_for_var_insert
/* Abstract iterators for AGGR_INIT_EXPRs. */
/* Structure containing iterator state. */
-typedef struct aggr_init_expr_arg_iterator_d GTY (())
+typedef struct GTY (()) aggr_init_expr_arg_iterator_d
{
tree t; /* the aggr_init_expr */
int n; /* argument count */
@@ -3859,7 +3860,7 @@ extern void init_reswords (void);
opname_tab[(int) MINUS_EXPR] == "-". */
extern const char **opname_tab, **assignop_tab;
-typedef struct operator_name_info_t GTY(())
+typedef struct GTY(()) operator_name_info_t
{
/* The IDENTIFIER_NODE for the operator. */
tree identifier;
@@ -4044,7 +4045,7 @@ struct cp_declarator {
};
/* A level of template instantiation. */
-struct tinst_level GTY(())
+struct GTY(()) tinst_level
{
/* The immediately deeper level in the chain. */
struct tinst_level *next;
@@ -4553,7 +4554,7 @@ extern int shared_member_p (tree);
/* The representation of a deferred access check. */
-typedef struct deferred_access_check GTY(())
+typedef struct GTY(()) deferred_access_check
{
/* The base class in which the declaration is referenced. */
tree binfo;
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -31,7 +31,7 @@ typedef struct binding_entry_s *binding_
/* The type of a routine repeatedly called by binding_table_foreach. */
typedef void (*bt_foreach_proc) (binding_entry, void *);
-struct binding_entry_s GTY(())
+struct GTY(()) binding_entry_s
{
binding_entry chain;
tree name;
@@ -63,7 +63,7 @@ typedef struct cp_binding_level cxx_scop
currently being defined. */
#define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
-struct cxx_binding GTY(())
+struct GTY(()) cxx_binding
{
/* Link to chain together various bindings for this name. */
cxx_binding *previous;
@@ -79,7 +79,7 @@ struct cxx_binding GTY(())
/* Datatype used to temporarily save C++ bindings (for implicit
instantiations purposes and like). Implemented in decl.c. */
-typedef struct cxx_saved_binding GTY(())
+typedef struct GTY(()) cxx_saved_binding
{
/* The name of the current binding. */
tree identifier;
@@ -139,7 +139,7 @@ typedef enum tag_scope {
and [class.friend]/9. */
} tag_scope;
-typedef struct cp_class_binding GTY(())
+typedef struct GTY(()) cp_class_binding
{
cxx_binding base;
/* The bound name. */
@@ -173,7 +173,7 @@ DEF_VEC_ALLOC_O(cp_class_binding,gc);
/* Note that the information in the `names' component of the global contour
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
-struct cp_binding_level GTY(())
+struct GTY(()) cp_binding_level
{
/* A chain of _DECL nodes for all variables, constants, functions,
and typedef types. These are in the reverse of the order
diff --git a/gcc/function.h b/gcc/function.h
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3.
The main insn-chain is saved in the last element of the chain,
unless the chain is empty. */
-struct sequence_stack GTY(())
+struct GTY(()) sequence_stack
{
/* First and last insns in the chain of the saved sequence. */
rtx first;
@@ -39,7 +39,7 @@ struct sequence_stack GTY(())
struct sequence_stack *next;
};
-struct emit_status GTY(())
+struct GTY(()) emit_status
{
/* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
After rtl generation, it is 1 plus the largest register number used. */
@@ -96,7 +96,7 @@ extern GTY ((length ("crtl->emit.x_reg_r
#define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO])
-struct expr_status GTY(())
+struct GTY(()) expr_status
{
/* Number of units that we should eventually pop off the stack.
These are the arguments to function calls that have already returned. */
@@ -142,7 +142,7 @@ DEF_VEC_ALLOC_P(call_site_record, gc);
DEF_VEC_ALLOC_P(call_site_record, gc);
/* RTL representation of exception handling. */
-struct rtl_eh GTY(())
+struct GTY(()) rtl_eh
{
rtx filter;
rtx exc_ptr;
@@ -196,7 +196,7 @@ enum function_frequency {
FUNCTION_FREQUENCY_HOT
};
-struct varasm_status GTY(())
+struct GTY(()) varasm_status
{
/* If we're using a per-function constant pool, this is it. */
struct rtx_constant_pool *pool;
@@ -207,7 +207,7 @@ struct varasm_status GTY(())
};
/* Information mainlined about RTL representation of incoming arguments. */
-struct incoming_args GTY(())
+struct GTY(()) incoming_args
{
/* Number of bytes of args popped by function being compiled on its return.
Zero if no bytes are to be popped.
@@ -237,7 +237,7 @@ struct incoming_args GTY(())
};
/* Data for function partitioning. */
-struct function_subsections GTY(())
+struct GTY(()) function_subsections
{
/* Assembly labels for the hot and cold text sections, to
be used by debugger functions for determining the size of text
@@ -255,7 +255,7 @@ struct function_subsections GTY(())
};
/* Datastructures maintained for currently processed function in RTL form. */
-struct rtl_data GTY(())
+struct GTY(()) rtl_data
{
struct expr_status expr;
struct emit_status emit;
@@ -422,7 +422,7 @@ extern GTY(()) struct rtl_data x_rtl;
/* This structure can save all the important global and static variables
describing the status of the current function. */
-struct function GTY(())
+struct GTY(()) function
{
struct eh_status *eh;
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -187,9 +187,7 @@ EOID [^[:alnum:]_]
}
^{HWS}"#"{HWS}"define"{WS}"GTY(" /* do nothing */
-{WS}"GTY"{WS}?"(" {
- error_at_line (&lexer_line, "stray GTY marker");
-}
+
%%
diff --git a/gcc/gengtype-parse.c b/gcc/gengtype-parse.c
--- a/gcc/gengtype-parse.c
+++ b/gcc/gengtype-parse.c
@@ -677,7 +677,6 @@ type (options_p *optsp, bool nested)
type (options_p *optsp, bool nested)
{
const char *s;
- bool is_union;
*optsp = 0;
switch (token ())
{
@@ -694,14 +693,9 @@ type (options_p *optsp, bool nested)
case UNION:
{
options_p opts = 0;
-
- is_union = (token() == UNION);
+ bool is_gty = 0;
+ bool is_union = (token() == UNION);
advance ();
-
- if (token () == ID)
- s = advance ();
- else
- s = xasprintf ("anonymous:%s:%d", lexer_line.file, lexer_line.line);
/* Top-level structures that are not explicitly tagged GTY(())
are treated as mere forward declarations. This is because
@@ -710,17 +704,35 @@ type (options_p *optsp, bool nested)
that we can't handle. */
if (nested || token () == GTY_TOKEN)
{
+ is_gty = 1;
opts = gtymarker_opt ();
- if (token () == '{')
- {
- pair_p fields;
- advance ();
- fields = struct_field_seq ();
- require ('}');
- return new_structure (s, is_union, &lexer_line, fields, opts);
- }
}
- else if (token () == '{')
+
+ if (token () == ID)
+ s = advance ();
+ else
+ s = xasprintf ("anonymous:%s:%d", lexer_line.file, lexer_line.line);
+
+ /* Unfortunately above GTY_TOKEN check does not capture the
+ typedef struct_type GTY case */
+ if (token () == GTY_TOKEN)
+ {
+ is_gty = 1;
+ opts = gtymarker_opt ();
+ }
+
+ if (is_gty)
+ {
+ if (token () == '{')
+ {
+ pair_p fields;
+ advance ();
+ fields = struct_field_seq ();
+ require ('}');
+ return new_structure (s, is_union, &lexer_line, fields, opts);
+ }
+ }
+ else if (token () == '{')
consume_balanced ('{', '}');
if (opts)
*optsp = opts;
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -61,7 +61,7 @@ enum escape_type
/* Memory reference statistics for individual memory symbols,
collected during alias analysis. */
-struct mem_sym_stats_d GTY(())
+struct GTY(()) mem_sym_stats_d
{
/* Memory symbol. */
tree var;
@@ -107,7 +107,7 @@ DEF_VEC_ALLOC_P(mem_sym_stats_t, heap);
DEF_VEC_ALLOC_P(mem_sym_stats_t, heap);
/* Memory reference statistics collected during alias analysis. */
-struct mem_ref_stats_d GTY(())
+struct GTY(()) mem_ref_stats_d
{
/* Number of statements that make memory references. */
long num_mem_stmts;
@@ -136,7 +136,7 @@ struct mem_ref_stats_d GTY(())
/* Gimple dataflow datastructure. All publicly available fields shall have
gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable
fields should have gimple_set accessor. */
-struct gimple_df GTY(())
+struct GTY(()) gimple_df
{
/* Array of all variables referenced in the function. */
htab_t GTY((param_is (union tree_node))) referenced_vars;
@@ -229,7 +229,7 @@ typedef struct
---------------------------------------------------------------------------*/
/* Aliasing information for SSA_NAMEs representing pointer variables. */
-struct ptr_info_def GTY(())
+struct GTY(()) ptr_info_def
{
/* Mask of reasons this pointer's value escapes the function. */
ENUM_BITFIELD (escape_type) escape_mask : 9;
@@ -270,7 +270,7 @@ struct ptr_info_def GTY(())
---------------------------------------------------------------------------*/
enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };
-struct tree_ann_common_d GTY(())
+struct GTY(()) tree_ann_common_d
{
/* Annotation type. */
enum tree_ann_type type;
@@ -331,7 +331,7 @@ enum noalias_state {
};
-struct var_ann_d GTY(())
+struct GTY(()) var_ann_d
{
struct tree_ann_common_d common;
@@ -401,13 +401,13 @@ struct var_ann_d GTY(())
/* Container for variable annotation used by hashtable for annotations for
static variables. */
-struct static_var_ann_d GTY(())
+struct GTY(()) static_var_ann_d
{
struct var_ann_d ann;
unsigned int uid;
};
-struct function_ann_d GTY(())
+struct GTY(()) function_ann_d
{
struct tree_ann_common_d common;
@@ -476,7 +476,7 @@ typedef struct immediate_use_iterator_d
-struct stmt_ann_d GTY(())
+struct GTY(()) stmt_ann_d
{
struct tree_ann_common_d common;
@@ -508,7 +508,7 @@ struct stmt_ann_d GTY(())
unsigned has_volatile_ops : 1;
};
-union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
+union GTY((desc ("ann_type ((tree_ann_t)&%h)"))) tree_ann_d
{
struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
struct var_ann_d GTY((tag ("VAR_ANN"))) vdecl;
@@ -544,7 +544,7 @@ static inline bitmap addresses_taken (tr
/*---------------------------------------------------------------------------
Structure representing predictions in tree level.
---------------------------------------------------------------------------*/
-struct edge_prediction GTY((chain_next ("%h.ep_next")))
+struct GTY((chain_next ("%h.ep_next"))) edge_prediction
{
struct edge_prediction *ep_next;
edge ep_edge;
@@ -559,7 +559,7 @@ static inline void set_phi_nodes (basic_
/*---------------------------------------------------------------------------
Global declarations
---------------------------------------------------------------------------*/
-struct int_tree_map GTY(())
+struct GTY(()) int_tree_map
{
unsigned int uid;
@@ -890,7 +890,7 @@ extern void strict_aliasing_warning_back
/* In tree-ssa.c */
/* Mapping for redirected edges. */
-struct _edge_var_map GTY(())
+struct GTY(()) _edge_var_map
{
tree result; /* PHI result. */
tree def; /* PHI arg definition. */
diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h
--- a/gcc/tree-ssa-operands.h
+++ b/gcc/tree-ssa-operands.h
@@ -110,7 +110,7 @@ typedef struct voptype_d *voptype_p;
operand memory manager. Operands are suballocated out of this block. The
MEM array varies in size. */
-struct ssa_operand_memory_d GTY((chain_next("%h.next")))
+struct GTY((chain_next("%h.next"))) ssa_operand_memory_d
{
struct ssa_operand_memory_d *next;
char mem[1];
@@ -120,7 +120,7 @@ struct ssa_operand_memory_d GTY((chain_n
#define NUM_VOP_FREE_BUCKETS 29
/* Per-function operand caches. */
-struct ssa_operands GTY(()) {
+struct GTY(()) ssa_operands {
struct ssa_operand_memory_d *operand_memory;
unsigned operand_memory_index;
/* Current size of the operand memory buffer. */
diff --git a/gcc/tree.h b/gcc/tree.h
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -372,7 +372,7 @@ enum omp_clause_code
fields. */
union tree_ann_d;
-struct tree_base GTY(())
+struct GTY(()) tree_base
{
ENUM_BITFIELD(tree_code) code : 16;
@@ -411,7 +411,7 @@ struct tree_base GTY(())
union tree_ann_d *ann;
};
-struct tree_common GTY(())
+struct GTY(()) tree_common
{
struct tree_base base;
tree chain;
@@ -419,7 +419,7 @@ struct tree_common GTY(())
};
/* GIMPLE_MODIFY_STMT */
-struct gimple_stmt GTY(())
+struct GTY(()) gimple_stmt
{
struct tree_base base;
location_t locus;
@@ -1471,7 +1471,7 @@ extern void omp_clause_range_check_faile
== (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \
&& TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
-struct tree_int_cst GTY(())
+struct GTY(()) tree_int_cst
{
struct tree_common common;
double_int int_cst;
@@ -1485,7 +1485,7 @@ struct real_value;
#define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
#define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
-struct tree_real_cst GTY(())
+struct GTY(()) tree_real_cst
{
struct tree_common common;
struct real_value * real_cst_ptr;
@@ -1497,7 +1497,7 @@ struct fixed_value;
#define TREE_FIXED_CST_PTR(NODE) (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
#define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
-struct tree_fixed_cst GTY(())
+struct GTY(()) tree_fixed_cst
{
struct tree_common common;
struct fixed_value * fixed_cst_ptr;
@@ -1508,7 +1508,7 @@ struct tree_fixed_cst GTY(())
#define TREE_STRING_POINTER(NODE) \
((const char *)(STRING_CST_CHECK (NODE)->string.str))
-struct tree_string GTY(())
+struct GTY(()) tree_string
{
struct tree_common common;
int length;
@@ -1519,7 +1519,7 @@ struct tree_string GTY(())
#define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
#define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
-struct tree_complex GTY(())
+struct GTY(()) tree_complex
{
struct tree_common common;
tree real;
@@ -1529,7 +1529,7 @@ struct tree_complex GTY(())
/* In a VECTOR_CST node. */
#define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elements)
-struct tree_vector GTY(())
+struct GTY(()) tree_vector
{
struct tree_common common;
tree elements;
@@ -1553,7 +1553,7 @@ struct tree_vector GTY(())
((tree) ((char *) (NODE) - sizeof (struct tree_common)))
#define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
-struct tree_identifier GTY(())
+struct GTY(()) tree_identifier
{
struct tree_common common;
struct ht_identifier id;
@@ -1563,7 +1563,7 @@ struct tree_identifier GTY(())
#define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
#define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
-struct tree_list GTY(())
+struct GTY(()) tree_list
{
struct tree_common common;
tree purpose;
@@ -1577,7 +1577,7 @@ struct tree_list GTY(())
#define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
-struct tree_vec GTY(())
+struct GTY(()) tree_vec
{
struct tree_common common;
int length;
@@ -1623,7 +1623,7 @@ struct tree_vec GTY(())
element. INDEX can optionally design the position of VALUE: in arrays,
it is the index where VALUE has to be placed; in structures, it is the
FIELD_DECL of the member. */
-typedef struct constructor_elt_d GTY(())
+typedef struct GTY(()) constructor_elt_d
{
tree index;
tree value;
@@ -1632,7 +1632,7 @@ DEF_VEC_O(constructor_elt);
DEF_VEC_O(constructor_elt);
DEF_VEC_ALLOC_O(constructor_elt,gc);
-struct tree_constructor GTY(())
+struct GTY(()) tree_constructor
{
struct tree_common common;
VEC(constructor_elt,gc) *elts;
@@ -1934,7 +1934,7 @@ enum omp_clause_default_kind
#define OMP_CLAUSE_DEFAULT_KIND(NODE) \
(OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
-struct tree_exp GTY(())
+struct GTY(()) tree_exp
{
struct tree_common common;
location_t locus;
@@ -1995,7 +1995,7 @@ struct ptr_info_def;
/* Immediate use linking structure. This structure is used for maintaining
a doubly linked list of uses of an SSA_NAME. */
-typedef struct ssa_use_operand_d GTY(())
+typedef struct GTY(()) ssa_use_operand_d
{
struct ssa_use_operand_d* GTY((skip(""))) prev;
struct ssa_use_operand_d* GTY((skip(""))) next;
@@ -2006,7 +2006,7 @@ typedef struct ssa_use_operand_d GTY(())
/* Return the immediate_use information for an SSA_NAME. */
#define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
-struct tree_ssa_name GTY(())
+struct GTY(()) tree_ssa_name
{
struct tree_common common;
@@ -2053,7 +2053,7 @@ struct tree_ssa_name GTY(())
#define PHI_BB(NODE) PHI_NODE_CHECK (NODE)->phi.bb
#define PHI_ARG_IMM_USE_NODE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).imm_use
-struct phi_arg_d GTY(())
+struct GTY(()) phi_arg_d
{
/* imm_use MUST be the first element in struct because we do some
pointer arithmetic with it. See phi_arg_index_from_use. */
@@ -2061,7 +2061,7 @@ struct phi_arg_d GTY(())
tree def;
};
-struct tree_phi_node GTY(())
+struct GTY(()) tree_phi_node
{
struct tree_base common;
tree chain;
@@ -2090,7 +2090,7 @@ struct tree_phi_node GTY(())
#define OMP_CLAUSE_OPERAND(NODE, I) \
OMP_CLAUSE_ELT_CHECK (NODE, I)
-struct tree_omp_clause GTY(())
+struct GTY(()) tree_omp_clause
{
struct tree_common common;
enum omp_clause_code code;
@@ -2156,7 +2156,7 @@ struct varray_head_tag;
#define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
-struct tree_block GTY(())
+struct GTY(()) tree_block
{
struct tree_common common;
@@ -2389,7 +2389,7 @@ struct tree_block GTY(())
struct die_struct;
-struct tree_type GTY(())
+struct GTY(()) tree_type
{
struct tree_common common;
tree values;
@@ -2543,7 +2543,7 @@ struct tree_type GTY(())
#define BINFO_INHERITANCE_CHAIN(NODE) \
(TREE_BINFO_CHECK(NODE)->binfo.inheritance)
-struct tree_binfo GTY (())
+struct GTY (()) tree_binfo
{
struct tree_common common;
@@ -2619,7 +2619,7 @@ struct function;
scope". */
#define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
#define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
-struct tree_decl_minimal GTY(())
+struct GTY(()) tree_decl_minimal
{
struct tree_common common;
location_t locus;
@@ -2645,7 +2645,7 @@ struct tree_decl_minimal GTY(())
In general, given a pointer P with a symbol tag SMT, the alias set
of SMT should be the union of all the alias sets of the NMTs of
every SSA_NAME for P. */
-struct tree_memory_tag GTY(())
+struct GTY(()) tree_memory_tag
{
struct tree_decl_minimal common;
@@ -2661,7 +2661,7 @@ struct tree_memory_tag GTY(())
/* Memory Partition Tags (MPTs) group memory symbols under one
common name for the purposes of placing memory PHI nodes. */
-struct tree_memory_partition_tag GTY(())
+struct GTY(()) tree_memory_partition_tag
{
struct tree_memory_tag common;
@@ -2817,7 +2817,7 @@ struct tree_memory_partition_tag GTY(())
#define DECL_NO_TBAA_P(DECL) \
DECL_COMMON_CHECK (DECL)->decl_common.no_tbaa_flag
-struct tree_decl_common GTY(())
+struct GTY(()) tree_decl_common
{
struct tree_decl_minimal common;
tree size;
@@ -2918,7 +2918,7 @@ extern void decl_value_expr_insert (tree
/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
#define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
-struct tree_decl_with_rtl GTY(())
+struct GTY(()) tree_decl_with_rtl
{
struct tree_decl_common common;
rtx rtl;
@@ -2987,7 +2987,7 @@ struct tree_decl_with_rtl GTY(())
#define DECL_NONADDRESSABLE_P(NODE) \
(FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)
-struct tree_field_decl GTY(())
+struct GTY(()) tree_field_decl
{
struct tree_decl_common common;
@@ -3009,17 +3009,17 @@ struct tree_field_decl GTY(())
jumping into such a binding contour has been printed for this label. */
#define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl_common.decl_flag_0)
-struct tree_label_decl GTY(())
+struct GTY(()) tree_label_decl
{
struct tree_decl_with_rtl common;
};
-struct tree_result_decl GTY(())
+struct GTY(()) tree_result_decl
{
struct tree_decl_with_rtl common;
};
-struct tree_const_decl GTY(())
+struct GTY(()) tree_const_decl
{
struct tree_decl_with_rtl common;
};
@@ -3032,7 +3032,7 @@ struct tree_const_decl GTY(())
where the data was actually passed. */
#define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
-struct tree_parm_decl GTY(())
+struct GTY(()) tree_parm_decl
{
struct tree_decl_with_rtl common;
rtx incoming_rtl;
@@ -3160,7 +3160,7 @@ extern void decl_restrict_base_insert (t
multiple translation units should be merged. */
#define DECL_ONE_ONLY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.one_only)
-struct tree_decl_with_vis GTY(())
+struct GTY(()) tree_decl_with_vis
{
struct tree_decl_with_rtl common;
tree assembler_name;
@@ -3267,7 +3267,7 @@ extern void decl_fini_priority_insert (t
#define DECL_THREAD_LOCAL_P(NODE) \
(VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
-struct tree_var_decl GTY(())
+struct GTY(()) tree_var_decl
{
struct tree_decl_with_vis common;
};
@@ -3287,7 +3287,7 @@ struct tree_var_decl GTY(())
C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK. */
#define DECL_VINDEX(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
-struct tree_decl_non_common GTY(())
+struct GTY(()) tree_decl_non_common
{
struct tree_decl_with_vis common;
@@ -3414,7 +3414,7 @@ struct tree_decl_non_common GTY(())
FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
which seemed a bit strange. */
-struct tree_function_decl GTY(())
+struct GTY(()) tree_function_decl
{
struct tree_decl_non_common common;
@@ -3459,7 +3459,7 @@ struct tree_function_decl GTY(())
#define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
(TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_2)
-struct tree_type_decl GTY(())
+struct GTY(()) tree_type_decl
{
struct tree_decl_non_common common;
@@ -3476,16 +3476,18 @@ struct tree_type_decl GTY(())
#define STATEMENT_LIST_TAIL(NODE) \
(STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
-struct tree_statement_list_node
- GTY ((chain_next ("%h.next"), chain_prev ("%h.prev")))
+struct
+ GTY((chain_next ("%h.next"), chain_prev ("%h.prev")))
+ tree_statement_list_node
{
struct tree_statement_list_node *prev;
struct tree_statement_list_node *next;
tree stmt;
};
-struct tree_statement_list
+struct
GTY(())
+ tree_statement_list
{
struct tree_common common;
struct tree_statement_list_node *head;
@@ -3497,8 +3499,9 @@ struct tree_statement_list
It may be any of the structures declared above
for various types of node. */
-union tree_node GTY ((ptr_alias (union lang_tree_node),
- desc ("tree_node_structure (&%h)")))
+union
+ GTY ((ptr_alias (union lang_tree_node), desc ("tree_node_structure (&%h)")))
+ tree_node
{
struct tree_base GTY ((tag ("TS_BASE"))) base;
struct tree_common GTY ((tag ("TS_COMMON"))) common;
@@ -5236,7 +5239,7 @@ extern void vect_set_verbosity_level (co
/* In tree.c. */
-struct tree_map_base GTY(())
+struct GTY(()) tree_map_base
{
tree from;
};
@@ -5247,7 +5250,7 @@ extern int tree_map_base_marked_p (const
/* Map from a tree to another tree. */
-struct tree_map GTY(())
+struct GTY(()) tree_map
{
struct tree_map_base base;
unsigned int hash;
@@ -5260,7 +5263,7 @@ extern unsigned int tree_map_hash (const
/* Map from a tree to an int. */
-struct tree_int_map GTY(())
+struct GTY(()) tree_int_map
{
struct tree_map_base base;
unsigned int to;
@@ -5272,7 +5275,7 @@ struct tree_int_map GTY(())
/* Map from a tree to initialization/finalization priorities. */
-struct tree_priority_map GTY(())
+struct GTY(()) tree_priority_map
{
struct tree_map_base base;
priority_type init;
@@ -5320,14 +5323,14 @@ tree_operand_length (const_tree node)
defined by this point. */
/* Structure containing iterator state. */
-typedef struct call_expr_arg_iterator_d GTY (())
+typedef struct GTY (()) call_expr_arg_iterator_d
{
tree t; /* the call_expr */
int n; /* argument count */
int i; /* next argument index */
} call_expr_arg_iterator;
-typedef struct const_call_expr_arg_iterator_d GTY (())
+typedef struct GTY (()) const_call_expr_arg_iterator_d
{
const_tree t; /* the call_expr */
int n; /* argument count */
diff --git a/gcc/varray.h b/gcc/varray.h
--- a/gcc/varray.h
+++ b/gcc/varray.h
@@ -62,7 +62,7 @@ enum varray_data_enum {
};
/* Union of various array types that are used. */
-typedef union varray_data_tag GTY (()) {
+typedef union GTY (()) varray_data_tag {
char GTY ((length ("%0.num_elements"),
tag ("VARRAY_DATA_C"))) vdt_c[1];
unsigned char GTY ((length ("%0.num_elements"),
@@ -110,7 +110,7 @@ typedef union varray_data_tag GTY (()) {
} varray_data;
/* Virtual array of pointers header. */
-struct varray_head_tag GTY(()) {
+struct GTY(()) varray_head_tag {
size_t num_elements; /* Maximum element number allocated. */
size_t elements_used; /* The number of elements used, if
using VARRAY_PUSH/VARRAY_POP. */
diff --git a/gcc/vec.h b/gcc/vec.h
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -466,7 +466,7 @@ typedef struct VEC(T,B) \
} VEC(T,B)
#define VEC_T_GTY(T,B) \
-typedef struct VEC(T,B) GTY(()) \
+typedef struct GTY(()) VEC(T,B) \
{ \
unsigned num; \
unsigned alloc; \
@@ -475,7 +475,7 @@ typedef struct VEC(T,B) GTY(())
/* Derived vector type, user visible. */
#define VEC_TA_GTY(T,B,A,GTY) \
-typedef struct VEC(T,A) GTY \
+typedef struct GTY VEC(T,A) \
{ \
VEC(T,B) base; \
} VEC(T,A)
diff --git a/include/hashtab.h b/include/hashtab.h
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -96,7 +96,7 @@ typedef void (*htab_free_with_arg) (void
functions mentioned below. The size of this structure is subject to
change. */
-struct htab GTY(())
+struct GTY(()) htab
{
/* Pointer to hash function. */
htab_hash hash_f;
diff --git a/include/splay-tree.h b/include/splay-tree.h
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -86,7 +86,7 @@ typedef void (*splay_tree_deallocate_fn)
typedef void (*splay_tree_deallocate_fn) (void *, void *);
/* The nodes in the splay tree. */
-struct splay_tree_node_s GTY(())
+struct GTY(()) splay_tree_node_s
{
/* The key. */
splay_tree_key GTY ((use_param1)) key;
@@ -100,7 +100,7 @@ struct splay_tree_node_s GTY(())
};
/* The splay tree itself. */
-struct splay_tree_s GTY(())
+struct GTY(()) splay_tree_s
{
/* The root of the tree. */
splay_tree_node GTY ((use_params)) root;
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -162,7 +162,7 @@ enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99,
CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX0X, CLK_CXX0X, CLK_ASM};
/* Payload of a NUMBER, STRING, CHAR or COMMENT token. */
-struct cpp_string GTY(())
+struct GTY(()) cpp_string
{
unsigned int len;
const unsigned char *text;
@@ -192,7 +192,7 @@ enum cpp_token_fld_kind {
/* A preprocessing token. This has been carefully packed and should
occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */
-struct cpp_token GTY(())
+struct GTY(()) cpp_token
{
source_location src_loc; /* Location of first char of token. */
ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT; /* token type */
@@ -609,7 +609,7 @@ enum {
ends. Also used to store CPP identifiers, which are a superset of
identifiers in the grammatical sense. */
-union _cpp_hashnode_value GTY(())
+union GTY(()) _cpp_hashnode_value
{
/* If a macro. */
cpp_macro * GTY((tag ("NTV_MACRO"))) macro;
@@ -621,7 +621,7 @@ union _cpp_hashnode_value GTY(())
unsigned short GTY ((tag ("NTV_ARGUMENT"))) arg_index;
};
-struct cpp_hashnode GTY(())
+struct GTY(()) cpp_hashnode
{
struct ht_identifier ident;
unsigned int is_directive : 1;
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@ -54,7 +54,7 @@ typedef void *(*line_map_realloc) (void
creation of this line map, SYSP is one for a system header, two for
a C system header file that therefore needs to be extern "C"
protected in C++, and zero otherwise. */
-struct line_map GTY(())
+struct GTY(()) line_map
{
const char *to_file;
unsigned int to_line;
@@ -68,7 +68,7 @@ struct line_map GTY(())
};
/* A set of chronological line_map structures. */
-struct line_maps GTY(())
+struct GTY(()) line_maps
{
struct line_map * GTY ((length ("%h.used"))) maps;
unsigned int allocated;
diff --git a/libcpp/include/symtab.h b/libcpp/include/symtab.h
--- a/libcpp/include/symtab.h
+++ b/libcpp/include/symtab.h
@@ -26,7 +26,7 @@ Foundation, 51 Franklin Street, Fifth Fl
/* This is what each hash table entry points to. It may be embedded
deeply within another object. */
typedef struct ht_identifier ht_identifier;
-struct ht_identifier GTY(())
+struct GTY(()) ht_identifier
{
const unsigned char *str;
unsigned int len;