diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 23 | ||||
-rw-r--r-- | gcc/c/c-lang.h | 4 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 4 |
4 files changed, 31 insertions, 17 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 7b7d665..1266d4e 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,20 @@ +2014-05-17 Trevor Saunders <tsaunders@mozilla.com> + + * c-decl.c (finish_struct): Adjust. + (finish_enum): Likewise. + (bind): Adjust. + (record_inline_static): Likewise. + (push_scope): Likewise. + (make_label): Likewise. + (lookup_label_for_goto): Likewise. + (finish_struct): Likewise. + (finish_enum): Likewise. + (store_parm_decls): Likewise. + (c_push_function_context): Likewise. + * c-lang.h: Remove usage of variable_size gty attribute. + * c-parser.c (c_parse_init): Adjust. + (c_parse_file): Likewise. + 2014-05-13 Marek Polacek <polacek@redhat.com> PR c/61162 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index d52dcc9..75d1220 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -638,7 +638,7 @@ bind (tree name, tree decl, struct c_scope *scope, bool invisible, binding_freelist = b->prev; } else - b = ggc_alloc_c_binding (); + b = ggc_alloc<c_binding> (); b->shadowed = 0; b->decl = decl; @@ -755,7 +755,7 @@ void record_inline_static (location_t loc, tree func, tree decl, enum c_inline_static_type type) { - struct c_inline_static *csi = ggc_alloc_c_inline_static (); + c_inline_static *csi = ggc_alloc<c_inline_static> (); csi->location = loc; csi->function = func; csi->static_decl = decl; @@ -952,7 +952,7 @@ push_scope (void) scope_freelist = scope->outer; } else - scope = ggc_alloc_cleared_c_scope (); + scope = ggc_cleared_alloc<c_scope> (); /* The FLOAT_CONST_DECIMAL64 pragma applies to nested scopes. */ if (current_scope) @@ -3084,12 +3084,10 @@ make_label (location_t location, tree name, bool defining, struct c_label_vars **p_label_vars) { tree label = build_decl (location, LABEL_DECL, name, void_type_node); - struct c_label_vars *label_vars; - DECL_CONTEXT (label) = current_function_decl; DECL_MODE (label) = VOIDmode; - label_vars = ggc_alloc_c_label_vars (); + c_label_vars *label_vars = ggc_alloc<c_label_vars> (); label_vars->shadowed = NULL; set_spot_bindings (&label_vars->label_bindings, defining); label_vars->decls_in_scope = make_tree_vector (); @@ -3185,9 +3183,8 @@ lookup_label_for_goto (location_t loc, tree name) list for possible later warnings. */ if (label_vars->label_bindings.scope == NULL) { - struct c_goto_bindings *g; + c_goto_bindings *g = ggc_alloc<c_goto_bindings> (); - g = ggc_alloc_c_goto_bindings (); g->loc = loc; set_spot_bindings (&g->goto_bindings, true); vec_safe_push (label_vars->gotos, g); @@ -7423,8 +7420,8 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes, ensure that this lives as long as the rest of the struct decl. All decls in an inline function need to be saved. */ - space = ggc_alloc_cleared_lang_type (sizeof (struct lang_type)); - space2 = ggc_alloc_sorted_fields_type + space = ggc_cleared_alloc<struct lang_type> (); + space2 = (sorted_fields_type *) ggc_internal_alloc (sizeof (struct sorted_fields_type) + len * sizeof (tree)); len = 0; @@ -7705,7 +7702,7 @@ finish_enum (tree enumtype, tree values, tree attributes) /* Record the min/max values so that we can warn about bit-field enumerations that are too small for the values. */ - lt = ggc_alloc_cleared_lang_type (sizeof (struct lang_type)); + lt = ggc_cleared_alloc<struct lang_type> (); lt->enum_min = minnode; lt->enum_max = maxnode; TYPE_LANG_SPECIFIC (enumtype) = lt; @@ -8479,7 +8476,7 @@ store_parm_decls (void) allocate_struct_function (fndecl, false); if (warn_unused_local_typedefs) - cfun->language = ggc_alloc_cleared_language_function (); + cfun->language = ggc_cleared_alloc<language_function> (); /* Begin the statement tree for this function. */ DECL_SAVED_TREE (fndecl) = push_stmt_list (); @@ -8803,7 +8800,7 @@ c_push_function_context (void) /* cfun->language might have been already allocated by the use of -Wunused-local-typedefs. In that case, just re-use it. */ if (p == NULL) - cfun->language = p = ggc_alloc_cleared_language_function (); + cfun->language = p = ggc_cleared_alloc<language_function> (); p->base.x_stmt_tree = c_stmt_tree; c_stmt_tree.x_cur_stmt_list = vec_safe_copy (c_stmt_tree.x_cur_stmt_list); diff --git a/gcc/c/c-lang.h b/gcc/c/c-lang.h index 7fcf333..e974906 100644 --- a/gcc/c/c-lang.h +++ b/gcc/c/c-lang.h @@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-common.h" #include "ggc.h" -struct GTY((variable_size)) lang_type { +struct GTY(()) lang_type { /* In a RECORD_TYPE, a sorted array of the fields of the type. */ struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s; /* In an ENUMERAL_TYPE, the min and max values. */ @@ -35,7 +35,7 @@ struct GTY((variable_size)) lang_type { tree objc_info; }; -struct GTY((variable_size)) lang_decl { +struct GTY(()) lang_decl { char dummy; }; diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 6e8554d..bfc7147 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -90,7 +90,7 @@ c_parse_init (void) if (!c_dialect_objc ()) mask |= D_OBJC | D_CXX_OBJC; - ridpointers = ggc_alloc_cleared_vec_tree ((int) RID_MAX); + ridpointers = ggc_cleared_vec_alloc<tree> ((int) RID_MAX); for (i = 0; i < num_c_common_reswords; i++) { /* If a keyword is disabled, do not enter it into the table @@ -14061,7 +14061,7 @@ c_parse_file (void) if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS) c_parser_pragma_pch_preprocess (&tparser); - the_parser = ggc_alloc_c_parser (); + the_parser = ggc_alloc<c_parser> (); *the_parser = tparser; if (tparser.tokens == &tparser.tokens_buf[0]) the_parser->tokens = &the_parser->tokens_buf[0]; |