diff options
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/ada-tree.h | 14 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 2 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 12 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 8 |
4 files changed, 16 insertions, 20 deletions
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h index 5ea386f..d43eefa 100644 --- a/gcc/ada/gcc-interface/ada-tree.h +++ b/gcc/ada/gcc-interface/ada-tree.h @@ -32,13 +32,9 @@ union GTY((desc ("0"), desc ("tree_node_structure (&%h)"))) generic; }; -/* Ada uses the lang_decl and lang_type fields to hold a tree. - - FIXME: the variable_size annotation here is needed because these types are - variable-sized in some other front-ends. Due to gengtype deficiency, the - GTY options of such types have to agree across all front-ends. */ -struct GTY((variable_size)) lang_type { tree t; }; -struct GTY((variable_size)) lang_decl { tree t; }; +/* Ada uses the lang_decl and lang_type fields to hold a tree. */ +struct GTY(()) lang_type { tree t; }; +struct GTY(()) lang_decl { tree t; }; /* Macros to get and set the tree in TYPE_LANG_SPECIFIC. */ #define GET_TYPE_LANG_SPECIFIC(NODE) \ @@ -49,7 +45,7 @@ do { \ tree tmp = (X); \ if (!TYPE_LANG_SPECIFIC (NODE)) \ TYPE_LANG_SPECIFIC (NODE) \ - = ggc_alloc_lang_type (sizeof (struct lang_type)); \ + = ggc_alloc<struct lang_type> (); \ TYPE_LANG_SPECIFIC (NODE)->t = tmp; \ } while (0) @@ -62,7 +58,7 @@ do { \ tree tmp = (X); \ if (!DECL_LANG_SPECIFIC (NODE)) \ DECL_LANG_SPECIFIC (NODE) \ - = ggc_alloc_lang_decl (sizeof (struct lang_decl)); \ + = ggc_alloc<struct lang_decl> (); \ DECL_LANG_SPECIFIC (NODE)->t = tmp; \ } while (0) diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index e18583c..ff1210e 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -7578,7 +7578,7 @@ annotate_value (tree gnu_size) h = (struct tree_int_map **) htab_find_slot (annotate_value_cache, &in, INSERT); gcc_assert (!*h); - *h = ggc_alloc_tree_int_map (); + *h = ggc_alloc<tree_int_map> (); (*h)->base.from = gnu_size; (*h)->to = ret; } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 26194b6..c691a16 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2000,7 +2000,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) if (!pa) { - pa = ggc_alloc_cleared_parm_attr_d (); + pa = ggc_cleared_alloc<parm_attr_d> (); pa->id = gnat_param; pa->dim = Dimension; vec_safe_push (f_parm_attr_cache, pa); @@ -2522,7 +2522,7 @@ push_range_check_info (tree var) if (iter) { - struct range_check_info_d *rci = ggc_alloc_range_check_info_d (); + struct range_check_info_d *rci = ggc_alloc<range_check_info_d> (); vec_safe_push (iter->checks, rci); return rci; } @@ -2600,7 +2600,7 @@ static tree Loop_Statement_to_gnu (Node_Id gnat_node) { const Node_Id gnat_iter_scheme = Iteration_Scheme (gnat_node); - struct loop_info_d *gnu_loop_info = ggc_alloc_cleared_loop_info_d (); + struct loop_info_d *gnu_loop_info = ggc_cleared_alloc<loop_info_d> (); tree gnu_loop_stmt = build4 (LOOP_STMT, void_type_node, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE); tree gnu_loop_label = create_artificial_label (input_location); @@ -3617,7 +3617,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) /* Initialize the information structure for the function. */ allocate_struct_function (gnu_subprog_decl, false); - gnu_subprog_language = ggc_alloc_cleared_language_function (); + gnu_subprog_language = ggc_cleared_alloc<language_function> (); DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language = gnu_subprog_language; set_cfun (NULL); @@ -5140,7 +5140,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node) /* Save away what we've made so far and record this potential elaboration procedure. */ - info = ggc_alloc_elab_info (); + info = ggc_alloc<elab_info> (); set_current_block_context (gnu_elab_proc_decl); gnat_poplevel (); DECL_SAVED_TREE (gnu_elab_proc_decl) = end_stmt_group (); @@ -7439,7 +7439,7 @@ start_stmt_group (void) if (group) stmt_group_free_list = group->previous; else - group = ggc_alloc_stmt_group (); + group = ggc_alloc<stmt_group> (); group->previous = current_stmt_group; group->stmt_list = group->block = group->cleanups = NULL_TREE; diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index b9b9dc1..cc6f874 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -245,10 +245,10 @@ void init_gnat_utils (void) { /* Initialize the association of GNAT nodes to GCC trees. */ - associate_gnat_to_gnu = ggc_alloc_cleared_vec_tree (max_gnat_nodes); + associate_gnat_to_gnu = ggc_cleared_vec_alloc<tree> (max_gnat_nodes); /* Initialize the association of GNAT nodes to GCC trees as dummies. */ - dummy_node_table = ggc_alloc_cleared_vec_tree (max_gnat_nodes); + dummy_node_table = ggc_cleared_vec_alloc<tree> (max_gnat_nodes); /* Initialize the hash table of padded types. */ pad_type_hash_table @@ -428,7 +428,7 @@ gnat_pushlevel (void) free_binding_level = free_binding_level->chain; } else - newlevel = ggc_alloc_gnat_binding_level (); + newlevel = ggc_alloc<gnat_binding_level> (); /* Use a free BLOCK, if any; otherwise, allocate one. */ if (free_block_chain) @@ -1182,7 +1182,7 @@ maybe_pad_type (tree type, tree size, unsigned int align, goto built; } - h = ggc_alloc_pad_type_hash (); + h = ggc_alloc<pad_type_hash> (); h->hash = hashcode; h->type = record; loc = htab_find_slot_with_hash (pad_type_hash_table, h, hashcode, |