summaryrefslogtreecommitdiffstats
path: root/gcc/cp
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-21 09:18:28 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-21 09:18:28 +0000
commit046bfc77364f8647fa26398c54a063d9d7f93022 (patch)
tree8e91b85f58e03d07731dc2f61c43d3032ebb939b /gcc/cp
parenta89ef955863b1fcc19f862bf6c15b02650040f67 (diff)
downloadppe42-gcc-046bfc77364f8647fa26398c54a063d9d7f93022.tar.gz
ppe42-gcc-046bfc77364f8647fa26398c54a063d9d7f93022.zip
* vec.h: Update API to separate allocation mechanism from type.
(VEC_safe_grow): New. * vec.c (calculate_allocation): New. (vec_gc_o_reserve, vec_heap_o_reserve): Adjust. (vec_gc_free, vec_heap_free): Remove. * gengtype-lex.l (DEF_VEC_): Process mult-argument macros. Adjust. (VEC): Likewise. (mangle_macro_name): New. (struct macro_def): New. (struct macro): Add multiple argument values. (macro_expans_end): New. (push_macro_expansion): Chain on new macro. Process multiple args, create follow on expansion. Return follow on argument. (macro_input): Deal with multiple arguments. * tree.h: Define VEC(tree,heap) and VEC(tree,gc). (struct tree_binfo): Adjust. * basic-block.h: Define VEC(edge,gc). (struct edge_def): Adjust. (struct basic_block_def, struct edge_iterator): Likewise. (ei_container, ei_start_1, ei_last_1): Likewise. * cfg.c (connect_src, connect_dest): Likewise. * cfgrtl.c (force_nonfallthru_and_redirect) * dbxout.c (dbxout_type) * dwarf2out.c (gen_member_die) * lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc). (gcc_tree_to_linear_expression): Adjust. (gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest, lbv_to_gcc_expression, lle_to_gcc_expression, lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, perfect_nestify): Likewise. * lambda.h (gcc_loopnest_to_lambda_loopnest, lambda_loopnest_to_gcc_loopnest): Adjust prototypes. * profile.c (instrument_values): Adjust. * tree-cfg.c (modified_noreturn_calls): Adjust. (remove_fallthru_edge): Likewise. * tree-dump.c (dequeue_and_dump): Adjust. * tree-flow-inline.h (mark_stmt_modified): Adjust. * tree-flow.h (modified_noreturn_calls): Adjust. (tree_on_heap): Remove. (yay!) (register_new_def): Adjust. * tree-into-ssa.c: Define VEC(int,heap). (block_defs_stack): Adjust. (find_idf, insert_phi_nodes, register_new_def, rewrite_initialize_block, rewrite_finalize_block, register_new_update_single, rewrite_update_init_block, rewrite_update_fini_block, rewrite_blocks, ssa_rewrite_finalize_block, ssa_register_new_def, ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise. * tree-loop-linear.c (linear_transform_loops): Adjust. * tree-ssa-alias.c: Define VEC(fieldoff_t,heap). (push_fields_onto_fieldstack, create_overlap_variables_for): Adjust. * tree-ssa-dom.c (avail_exprs_stack, block_defs_stack, stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack, vrp_variables_stack): Adjust declarations. (tree_ssa_dominator_optimize): Adjust. (dom_opt_initialize_block, remove_local_expressions_from_table, restore_nonzero_vars_to_original_value, restore_vars_to_original_value, restore_currdefs_to_original_value, dom_opt_finalize_block, record_var_is_nonzero, record_cond, record_const_or_copy_1, optimize_stmt, update_rhs_and_lookup_avail_expr, lookup_avail_expr, record_range): Likewise. * tree-ssa-pre.c: Define VEC(basic_block,heap). (compute_antic_aux): Adjust. (inserted_exprs, create_expression_by_pieces, insert_into_preds_of_block, eliminate, mark_operand_necessary, remove_dead_inserted_code, fini_pre): Likewise. * tree-ssa-propagate.c (interesting_ssa_edges): Adjust. (varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist. ssa_prop_init): Likewise. * tree-ssa.c: Define VEC(bitmap,heap). (verify_name_tags): Adjust. * value-prof.c (rtl_divmod_values_to_profile): Adjust. (insn_prefetch_values_to_profile, rtl_find_values_to_profile, tree_divmod_values_to_profile, tree_find_values_to_profile, value_profile_transformations): Likewise. * value-prof.h: Define VEC(histogram_value,heap). * varasm.c: Remove alias_pair pointer typedef, define VEC(alias_pair,gc). (finish_aliases_1, finish_aliases_2, assemble_alias): Adjust. * config/pa/pa.c (typedef extern_symbol): Typedef the structure, not a pointer to it. Create an object vector. (extern_symbols): Turn into an object vector. (pa_hpux_asm_output_external, pa_hpux_file_end): Adjust. * cp/cp-tree.h: Adjust for new VEC API. Define VEC(tree_pair_s,gc). (struct save_scope): Adjust. (struct lang_type_class): Adjust. (unemitted_tinfo_decls): Adjust. * cp/class.c (add_method, resort_type_method_vec, finish_struct_methods, struct find_final_overrider_data, dfs_find_final_overrider_pre, find_final_overrider, get_vcall_index, warn_hidden, walk_subobject_offsets, check_methods, fixup_inline_methods, end_of_class, warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer, add_vcall_offset): Adjust. * cp/decl.c (xref_basetypes, finish_method): Adjust. * cp/decl2.c (check_classfn): Adjust. * cp/init.c (sort_mem_initializers, push_base_cleanups): Adjust. * cp/method.c (do_build_copy_constructor): Adjust. * cp/name-lookup.c (new_class_binding, store_binding, store_bindings, store_class_bindings): Adjust. * cp/name-lookup.h: Define VEC(cxx_saved_binding,gc), VEC(cp_class_binding,gc). (struct cp_binding_level): Adjust. * cp/parser.c: Define VEC(cp_token_position,heap). (struct cp_lexer): Adjust. (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy, cp_lexer_save_tokens): Adjust. * cp/pt.c (retrieve_specialization, check_explicit_specialization): Adjust. * cp/rtti.c (unemitted_tinfo_decls): Adjust. (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init, get_pseudo_ti_desc): Adjust. * cp/search.c (dfs_access_in_type, lookup_conversion_operator, lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible, dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust. * cp/semantics.c: Define VEC(deferred_access,gc). (push_deferring_access_checks): Adjust. * cp/typeck2.c (abstract_virtuals_error): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog39
-rw-r--r--gcc/cp/class.c38
-rw-r--r--gcc/cp/cp-tree.h15
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/init.c4
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/name-lookup.c14
-rw-r--r--gcc/cp/name-lookup.h8
-rw-r--r--gcc/cp/parser.c16
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/cp/rtti.c10
-rw-r--r--gcc/cp/search.c16
-rw-r--r--gcc/cp/semantics.c7
-rw-r--r--gcc/cp/typeck2.c2
15 files changed, 115 insertions, 68 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d8e77cca3ff..7c9747fad73 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,42 @@
+2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h: Adjust for new VEC API.
+ Define VEC(tree_pair_s,gc).
+ (struct save_scope): Adjust.
+ (struct lang_type_class): Adjust.
+ (unemitted_tinfo_decls): Adjust.
+ * class.c (add_method, resort_type_method_vec,
+ finish_struct_methods, struct find_final_overrider_data,
+ dfs_find_final_overrider_pre, find_final_overrider,
+ get_vcall_index, warn_hidden, walk_subobject_offsets,
+ check_methods, fixup_inline_methods, end_of_class,
+ warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
+ add_vcall_offset): Adjust.
+ * decl.c (xref_basetypes, finish_method): Adjust.
+ * decl2.c (check_classfn): Adjust.
+ * init.c (sort_mem_initializers, push_base_cleanups): Adjust.
+ * method.c (do_build_copy_constructor): Adjust.
+ * name-lookup.c (new_class_binding, store_binding,
+ store_bindings, store_class_bindings): Adjust.
+ * name-lookup.h: Define VEC(cxx_saved_binding,gc),
+ VEC(cp_class_binding,gc).
+ (struct cp_binding_level): Adjust.
+ * parser.c: Define VEC(cp_token_position,heap).
+ (struct cp_lexer): Adjust.
+ (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
+ cp_lexer_save_tokens): Adjust.
+ * pt.c (retrieve_specialization,
+ check_explicit_specialization): Adjust.
+ * rtti.c (unemitted_tinfo_decls): Adjust.
+ (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
+ get_pseudo_ti_desc): Adjust.
+ * search.c (dfs_access_in_type, lookup_conversion_operator,
+ lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
+ dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
+ * semantics.c: Define VEC(deferred_access,gc).
+ (push_deferring_access_checks): Adjust.
+ * typeck2.c (abstract_virtuals_error): Adjust.
+
2005-04-20 Ian Lance Taylor <ian@airs.com>
* cp-tree.def: Add STMT_EXPR.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index df0587e677a..2f2bd231a5c 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -887,7 +887,7 @@ add_method (tree type, tree method)
tree overload;
bool template_conv_p = false;
bool conv_p;
- VEC(tree) *method_vec;
+ VEC(tree,gc) *method_vec;
bool complete_p;
bool insert_p = false;
tree current_fns;
@@ -909,7 +909,7 @@ add_method (tree type, tree method)
allocate at least two (for constructors and destructors), and
we're going to end up with an assignment operator at some
point as well. */
- method_vec = VEC_alloc (tree, 8);
+ method_vec = VEC_alloc (tree, gc, 8);
/* Create slots for constructors and destructors. */
VEC_quick_push (tree, method_vec, NULL_TREE);
VEC_quick_push (tree, method_vec, NULL_TREE);
@@ -1052,7 +1052,7 @@ add_method (tree type, tree method)
{
/* We only expect to add few methods in the COMPLETE_P case, so
just make room for one more method in that case. */
- if (VEC_reserve (tree, method_vec, complete_p ? 1 : -1))
+ if (VEC_reserve (tree, gc, method_vec, complete_p ? -1 : 1))
CLASSTYPE_METHOD_VEC (type) = method_vec;
if (slot == VEC_length (tree, method_vec))
VEC_quick_push (tree, method_vec, overload);
@@ -1663,7 +1663,7 @@ resort_type_method_vec (void* obj,
gt_pointer_operator new_value,
void* cookie)
{
- VEC(tree) *method_vec = (VEC(tree) *) obj;
+ VEC(tree,gc) *method_vec = (VEC(tree,gc) *) obj;
int len = VEC_length (tree, method_vec);
size_t slot;
tree fn;
@@ -1695,7 +1695,7 @@ static void
finish_struct_methods (tree t)
{
tree fn_fields;
- VEC(tree) *method_vec;
+ VEC(tree,gc) *method_vec;
int slot, len;
method_vec = CLASSTYPE_METHOD_VEC (t);
@@ -1814,7 +1814,7 @@ typedef struct find_final_overrider_data_s {
/* The candidate overriders. */
tree candidates;
/* Path to most derived. */
- VEC (tree) *path;
+ VEC(tree,heap) *path;
} find_final_overrider_data;
/* Add the overrider along the current path to FFOD->CANDIDATES.
@@ -1873,7 +1873,7 @@ dfs_find_final_overrider_pre (tree binfo, void *data)
if (binfo == ffod->declaring_base)
dfs_find_final_overrider_1 (binfo, ffod, VEC_length (tree, ffod->path));
- VEC_safe_push (tree, ffod->path, binfo);
+ VEC_safe_push (tree, heap, ffod->path, binfo);
return NULL_TREE;
}
@@ -1922,12 +1922,12 @@ find_final_overrider (tree derived, tree binfo, tree fn)
ffod.fn = fn;
ffod.declaring_base = binfo;
ffod.candidates = NULL_TREE;
- ffod.path = VEC_alloc (tree, 30);
+ ffod.path = VEC_alloc (tree, heap, 30);
dfs_walk_all (derived, dfs_find_final_overrider_pre,
dfs_find_final_overrider_post, &ffod);
- VEC_free (tree, ffod.path);
+ VEC_free (tree, heap, ffod.path);
/* If there was no winner, issue an error message. */
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
@@ -1946,7 +1946,7 @@ find_final_overrider (tree derived, tree binfo, tree fn)
static tree
get_vcall_index (tree fn, tree type)
{
- VEC (tree_pair_s) *indices = CLASSTYPE_VCALL_INDICES (type);
+ VEC(tree_pair_s,gc) *indices = CLASSTYPE_VCALL_INDICES (type);
tree_pair_p p;
unsigned ix;
@@ -2350,7 +2350,7 @@ check_for_override (tree decl, tree ctype)
void
warn_hidden (tree t)
{
- VEC(tree) *method_vec = CLASSTYPE_METHOD_VEC (t);
+ VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (t);
tree fns;
size_t i;
@@ -3200,7 +3200,7 @@ walk_subobject_offsets (tree type,
if (abi_version_at_least (2) && CLASSTYPE_VBASECLASSES (type))
{
unsigned ix;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
/* Iterate through the virtual base classes of TYPE. In G++
3.2, we included virtual bases in the direct base class
@@ -3678,7 +3678,7 @@ check_methods (tree t)
{
TYPE_POLYMORPHIC_P (t) = 1;
if (DECL_PURE_VIRTUAL_P (x))
- VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x);
+ VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
}
/* All user-declared destructors are non-trivial. */
if (DECL_DESTRUCTOR_P (x))
@@ -4202,7 +4202,7 @@ static void
fixup_inline_methods (tree type)
{
tree method = TYPE_METHODS (type);
- VEC (tree) *friends;
+ VEC(tree,gc) *friends;
unsigned ix;
if (method && TREE_CODE (method) == TREE_VEC)
@@ -4370,7 +4370,7 @@ static tree
end_of_class (tree t, int include_virtuals_p)
{
tree result = size_zero_node;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
tree binfo;
tree base_binfo;
tree offset;
@@ -4417,7 +4417,7 @@ static void
warn_about_ambiguous_bases (tree t)
{
int i;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
tree basetype;
tree binfo;
tree base_binfo;
@@ -5129,7 +5129,7 @@ finish_struct (tree t, tree attributes)
CLASSTYPE_PURE_VIRTUALS (t) = NULL;
for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x))
if (DECL_PURE_VIRTUAL_P (x))
- VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x);
+ VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
complete_vars (t);
}
else
@@ -7130,7 +7130,7 @@ build_vtbl_initializer (tree binfo,
vtbl_init_data vid;
unsigned ix;
tree vbinfo;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
/* Initialize VID. */
memset (&vid, 0, sizeof (vid));
@@ -7598,7 +7598,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
offset. */
if (vid->binfo == TYPE_BINFO (vid->derived))
{
- tree_pair_p elt = VEC_safe_push (tree_pair_s,
+ tree_pair_p elt = VEC_safe_push (tree_pair_s, gc,
CLASSTYPE_VCALL_INDICES (vid->derived),
NULL);
elt->purpose = orig_fn;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a27ee193747..e7bf1106a83 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -656,7 +656,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
struct saved_scope GTY(())
{
- VEC(cxx_saved_binding) *old_bindings;
+ VEC(cxx_saved_binding,gc) *old_bindings;
tree old_namespace;
tree decl_ns_list;
tree class_name;
@@ -972,7 +972,8 @@ typedef struct tree_pair_s GTY (())
tree value;
} tree_pair_s;
typedef tree_pair_s *tree_pair_p;
-DEF_VEC_GC_O (tree_pair_s);
+DEF_VEC_O (tree_pair_s);
+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
@@ -1059,15 +1060,15 @@ struct lang_type_class GTY(())
unsigned dummy : 12;
tree primary_base;
- VEC (tree_pair_s) *vcall_indices;
+ VEC(tree_pair_s,gc) *vcall_indices;
tree vtables;
tree typeinfo_var;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
binding_table nested_udts;
tree as_base;
- VEC (tree) *pure_virtuals;
+ VEC(tree,gc) *pure_virtuals;
tree friend_classes;
- VEC (tree) * GTY((reorder ("resort_type_method_vec"))) methods;
+ VEC(tree,gc) * GTY((reorder ("resort_type_method_vec"))) methods;
tree key_method;
tree decl_list;
tree template_info;
@@ -4022,7 +4023,7 @@ extern void finish_repo (void);
/* in rtti.c */
/* A vector of all tinfo decls that haven't been emitted yet. */
-extern GTY(()) VEC(tree) *unemitted_tinfo_decls;
+extern GTY(()) VEC(tree,gc) *unemitted_tinfo_decls;
extern void init_rtti_processing (void);
extern tree build_typeid (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4fa6b0282f4..2a3c30cd71d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9340,7 +9340,7 @@ xref_basetypes (tree ref, tree base_list)
if (max_bases)
{
- BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, max_bases);
+ BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, gc, max_bases);
/* An aggregate cannot have baseclasses. */
CLASSTYPE_NON_AGGREGATE (ref) = 1;
@@ -9356,7 +9356,7 @@ xref_basetypes (tree ref, tree base_list)
if (max_vbases)
{
- CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, max_vbases);
+ CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, gc, max_vbases);
if (TYPE_FOR_JAVA (ref))
error ("Java class %qT cannot have virtual bases", ref);
@@ -10866,7 +10866,7 @@ finish_method (tree decl)
for String.cc in libg++. */
if (DECL_FRIEND_P (fndecl))
{
- VEC_safe_push (tree, CLASSTYPE_INLINE_FRIENDS (current_class_type),
+ VEC_safe_push (tree, gc, CLASSTYPE_INLINE_FRIENDS (current_class_type),
fndecl);
decl = void_type_node;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 0aa81117a7f..6cc68e249fe 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -622,7 +622,7 @@ check_classfn (tree ctype, tree function, tree template_parms)
ix = class_method_index_for_fn (complete_type (ctype), function);
if (ix >= 0)
{
- VEC(tree) *methods = CLASSTYPE_METHOD_VEC (ctype);
+ VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (ctype);
tree fndecls, fndecl = 0;
bool is_conv_op;
tree pushed_scope;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 726309acc6a..0abf1b25874 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -465,7 +465,7 @@ sort_mem_initializers (tree t, tree mem_inits)
tree base, binfo, base_binfo;
tree sorted_inits;
tree next_subobject;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
int i;
int uses_unions_p;
@@ -2867,7 +2867,7 @@ push_base_cleanups (void)
int i;
tree member;
tree expr;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
/* Run destructors for all virtual baseclasses. */
if (CLASSTYPE_VBASECLASSES (current_class_type))
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 9036f64c802..7e4e9566380 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -537,7 +537,7 @@ do_build_copy_constructor (tree fndecl)
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
tree binfo, base_binfo;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
/* Initialize all the base-classes with the parameter converted
to their type so that we get their copy constructor and not
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index fda7d345b1f..d2cf1ce3ca0 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -306,7 +306,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
{
cp_class_binding *old_base;
old_base = VEC_index (cp_class_binding, scope->class_shadowed, 0);
- if (VEC_reserve (cp_class_binding, scope->class_shadowed, -1))
+ if (VEC_reserve (cp_class_binding, gc, scope->class_shadowed, 1))
{
/* Fixup the current bindings, as they might have moved. */
size_t i;
@@ -325,7 +325,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
cb = VEC_quick_push (cp_class_binding, scope->class_shadowed, NULL);
}
else
- cb = VEC_safe_push (cp_class_binding, scope->class_shadowed, NULL);
+ cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL);
cb->identifier = name;
binding = &cb->base;
@@ -4741,7 +4741,7 @@ struct saved_scope *scope_chain;
*OLD_BINDINGS. */
static void
-store_binding (tree id, VEC(cxx_saved_binding) **old_bindings)
+store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings)
{
cxx_saved_binding *saved;
@@ -4753,7 +4753,7 @@ store_binding (tree id, VEC(cxx_saved_binding) **old_bindings)
IDENTIFIER_MARKED (id) = 1;
- saved = VEC_safe_push (cxx_saved_binding, *old_bindings, NULL);
+ saved = VEC_safe_push (cxx_saved_binding, gc, *old_bindings, NULL);
saved->identifier = id;
saved->binding = IDENTIFIER_BINDING (id);
saved->real_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
@@ -4761,7 +4761,7 @@ store_binding (tree id, VEC(cxx_saved_binding) **old_bindings)
}
static void
-store_bindings (tree names, VEC(cxx_saved_binding) **old_bindings)
+store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings)
{
tree t;
@@ -4784,8 +4784,8 @@ store_bindings (tree names, VEC(cxx_saved_binding) **old_bindings)
objects, rather than a TREE_LIST. */
static void
-store_class_bindings (VEC(cp_class_binding) *names,
- VEC(cxx_saved_binding) **old_bindings)
+store_class_bindings (VEC(cp_class_binding,gc) *names,
+ VEC(cxx_saved_binding,gc) **old_bindings)
{
size_t i;
cp_class_binding *cb;
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 451e6ecffa3..5aeb80b7338 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -89,7 +89,8 @@ typedef struct cxx_saved_binding GTY(())
tree real_type_value;
} cxx_saved_binding;
-DEF_VEC_GC_O(cxx_saved_binding);
+DEF_VEC_O(cxx_saved_binding);
+DEF_VEC_ALLOC_O(cxx_saved_binding,gc);
extern tree identifier_type_value (tree);
extern void set_identifier_type_value (tree, tree);
@@ -145,7 +146,8 @@ typedef struct cp_class_binding GTY(())
tree identifier;
} cp_class_binding;
-DEF_VEC_GC_O(cp_class_binding);
+DEF_VEC_O(cp_class_binding);
+DEF_VEC_ALLOC_O(cp_class_binding,gc);
/* For each binding contour we allocate a binding_level structure
which records the names defined in that contour.
@@ -200,7 +202,7 @@ struct cp_binding_level GTY(())
/* For the binding level corresponding to a class, the entities
declared in the class or its base classes. */
- VEC(cp_class_binding) *class_shadowed;
+ VEC(cp_class_binding,gc) *class_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and
is used for all binding levels. The TREE_PURPOSE is the name of
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 8a1137290e7..cb09fa1995f 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -66,7 +66,8 @@ typedef struct cp_token GTY (())
/* We use a stack of token pointer for saving token sets. */
typedef struct cp_token *cp_token_position;
-DEF_VEC_MALLOC_P (cp_token_position);
+DEF_VEC_P (cp_token_position);
+DEF_VEC_ALLOC_P (cp_token_position,heap);
static const cp_token eof_token =
{
@@ -104,7 +105,7 @@ typedef struct cp_lexer GTY (())
called. The top entry is the most recent position at which we
began saving tokens. If the stack is non-empty, we are saving
tokens. */
- VEC (cp_token_position) *GTY ((skip)) saved_tokens;
+ VEC(cp_token_position,heap) *GTY ((skip)) saved_tokens;
/* True if we should output debugging information. */
bool debugging_p;
@@ -260,7 +261,8 @@ cp_lexer_new_main (void)
/* Initially we are not debugging. */
lexer->debugging_p = false;
#endif /* ENABLE_CHECKING */
- lexer->saved_tokens = VEC_alloc (cp_token_position, CP_SAVED_TOKEN_STACK);
+ lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
+ CP_SAVED_TOKEN_STACK);
/* Create the buffer. */
alloc = CP_LEXER_BUFFER_SIZE;
@@ -314,7 +316,8 @@ cp_lexer_new_from_tokens (cp_token_cache *cache)
lexer->next_token = first == last ? (cp_token *)&eof_token : first;
lexer->last_token = last;
- lexer->saved_tokens = VEC_alloc (cp_token_position, CP_SAVED_TOKEN_STACK);
+ lexer->saved_tokens = VEC_alloc (cp_token_position, heap,
+ CP_SAVED_TOKEN_STACK);
#ifdef ENABLE_CHECKING
/* Initially we are not debugging. */
@@ -332,7 +335,7 @@ cp_lexer_destroy (cp_lexer *lexer)
{
if (lexer->buffer)
ggc_free (lexer->buffer);
- VEC_free (cp_token_position, lexer->saved_tokens);
+ VEC_free (cp_token_position, heap, lexer->saved_tokens);
ggc_free (lexer);
}
@@ -621,7 +624,8 @@ cp_lexer_save_tokens (cp_lexer* lexer)
if (cp_lexer_debugging_p (lexer))
fprintf (cp_lexer_debug_stream, "cp_lexer: saving tokens\n");
- VEC_safe_push (cp_token_position, lexer->saved_tokens, lexer->next_token);
+ VEC_safe_push (cp_token_position, heap,
+ lexer->saved_tokens, lexer->next_token);
}
/* Commit to the portion of the token stream most recently saved. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a832846050d..aaecabcbc45 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -822,7 +822,7 @@ retrieve_specialization (tree tmpl, tree args,
{
tree class_template;
tree class_specialization;
- VEC(tree) *methods;
+ VEC(tree,gc) *methods;
tree fns;
int idx;
@@ -1967,7 +1967,7 @@ check_explicit_specialization (tree declarator,
}
else
{
- VEC(tree) *methods;
+ VEC(tree,gc) *methods;
tree ovl;
/* For a type-conversion operator, we cannot do a
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 45f0b087a87..9368bfee998 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */
#define TINFO_REAL_NAME(NODE) TREE_PURPOSE (NODE)
/* A vector of all tinfo decls that haven't yet been emitted. */
-VEC (tree) *unemitted_tinfo_decls;
+VEC(tree,gc) *unemitted_tinfo_decls;
static tree build_headof (tree);
static tree ifnonnull (tree, tree);
@@ -119,7 +119,7 @@ init_rtti_processing (void)
= build_qualified_type (type_info_type, TYPE_QUAL_CONST);
type_info_ptr_type = build_pointer_type (const_type_info_type_node);
- unemitted_tinfo_decls = VEC_alloc (tree, 124);
+ unemitted_tinfo_decls = VEC_alloc (tree, gc, 124);
create_tinfo_types ();
}
@@ -364,7 +364,7 @@ get_tinfo_decl (tree type)
pushdecl_top_level_and_finish (d, NULL_TREE);
/* Add decl to the global array of tinfo decls. */
- VEC_safe_push (tree, unemitted_tinfo_decls, d);
+ VEC_safe_push (tree, gc, unemitted_tinfo_decls, d);
}
return d;
@@ -1003,7 +1003,7 @@ get_pseudo_ti_init (tree type, tree var_desc)
| (CLASSTYPE_DIAMOND_SHAPED_P (type) << 1));
tree binfo = TYPE_BINFO (type);
int nbases = BINFO_N_BASE_BINFOS (binfo);
- VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo);
+ VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_inits = NULL_TREE;
int ix;
@@ -1152,7 +1152,7 @@ get_pseudo_ti_desc (tree type)
else
{
tree binfo = TYPE_BINFO (type);
- VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo);
+ VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_binfo = BINFO_BASE_BINFO (binfo, 0);
int num_bases = BINFO_N_BASE_BINFOS (binfo);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index f6a9b577dfc..45668a14a94 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -641,7 +641,7 @@ dfs_access_in_type (tree binfo, void *data)
{
int i;
tree base_binfo;
- VEC (tree) *accesses;
+ VEC(tree,gc) *accesses;
/* Otherwise, scan our baseclasses, and pick the most favorable
access. */
@@ -1314,7 +1314,7 @@ lookup_conversion_operator (tree class_type, tree type)
{
int i;
tree fn;
- VEC(tree) *methods = CLASSTYPE_METHOD_VEC (class_type);
+ VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (class_type);
for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
VEC_iterate (tree, methods, i, fn); ++i)
@@ -1345,7 +1345,7 @@ lookup_conversion_operator (tree class_type, tree type)
int
lookup_fnfields_1 (tree type, tree name)
{
- VEC(tree) *method_vec;
+ VEC(tree,gc) *method_vec;
tree fn;
tree tmp;
size_t i;
@@ -1658,7 +1658,7 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
/* We are at the top of the hierarchy, and can use the
CLASSTYPE_VBASECLASSES list for unmarking the virtual
bases. */
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
unsigned ix;
tree base_binfo;
@@ -1766,7 +1766,7 @@ dfs_walk_once_accessible (tree binfo, bool friends_p,
/* We are at the top of the hierarchy, and can use the
CLASSTYPE_VBASECLASSES list for unmarking the virtual
bases. */
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
unsigned ix;
tree base_binfo;
@@ -2000,7 +2000,7 @@ dfs_get_pure_virtuals (tree binfo, void *data)
virtuals;
virtuals = TREE_CHAIN (virtuals))
if (DECL_PURE_VIRTUAL_P (BV_FN (virtuals)))
- VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (type),
+ VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (type),
BV_FN (virtuals));
}
@@ -2270,7 +2270,7 @@ lookup_conversions_r (tree binfo,
tree child_tpl_convs = NULL_TREE;
unsigned i;
tree base_binfo;
- VEC(tree) *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo));
+ VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo));
tree conv;
/* If we have no conversion operators, then don't look. */
@@ -2523,7 +2523,7 @@ binfo_for_vbase (tree base, tree t)
{
unsigned ix;
tree binfo;
- VEC (tree) *vbases;
+ VEC(tree,gc) *vbases;
for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0;
VEC_iterate (tree, vbases, ix, binfo); ix++)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ac678d5cdd5..20e94223b36 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -139,10 +139,11 @@ typedef struct deferred_access GTY(())
enum deferring_kind deferring_access_checks_kind;
} deferred_access;
-DEF_VEC_GC_O (deferred_access);
+DEF_VEC_O (deferred_access);
+DEF_VEC_ALLOC_O (deferred_access,gc);
/* Data for deferred access checking. */
-static GTY(()) VEC (deferred_access) *deferred_access_stack;
+static GTY(()) VEC(deferred_access,gc) *deferred_access_stack;
static GTY(()) unsigned deferred_access_no_check;
/* Save the current deferred access states and start deferred
@@ -159,7 +160,7 @@ push_deferring_access_checks (deferring_kind deferring)
{
deferred_access *ptr;
- ptr = VEC_safe_push (deferred_access, deferred_access_stack, NULL);
+ ptr = VEC_safe_push (deferred_access, gc, deferred_access_stack, NULL);
ptr->deferred_access_checks = NULL_TREE;
ptr->deferring_access_checks_kind = deferring;
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index daa23993425..81e34d76dbe 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -235,7 +235,7 @@ complete_type_check_abstract (tree type)
int
abstract_virtuals_error (tree decl, tree type)
{
- VEC (tree) *pure;
+ VEC(tree,gc) *pure;
/* This function applies only to classes. Any other entity can never
be abstract. */
OpenPOWER on IntegriCloud