Commit 2b41c040 by Kazu Hirata Committed by Kazu Hirata

decl2.c (pending_statics, [...]): Use VEC instead of VARRAY.

	* decl2.c (pending_statics, note_vague_linkage_var,
	cp_finish_file): Use VEC instead of VARRAY.
	(pending_statics_used): Remove.

From-SVN: r99329
parent 2b040821
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* decl2.c (ssdf_decls, start_static_storage_duration_function, * decl2.c (ssdf_decls, start_static_storage_duration_function,
generate_ctor_or_dtor_function): Use VEC instead of VARRAY. generate_ctor_or_dtor_function): Use VEC instead of VARRAY.
* decl2.c (pending_statics, note_vague_linkage_var,
cp_finish_file): Use VEC instead of VARRAY.
(pending_statics_used): Remove.
2005-05-05 Kazu Hirata <kazu@cs.umass.edu> 2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
* decl2.c (deferred_fns, note_vague_linkage_fn, * decl2.c (deferred_fns, note_vague_linkage_fn,
......
...@@ -86,9 +86,7 @@ static tree get_guard_bits (tree); ...@@ -86,9 +86,7 @@ static tree get_guard_bits (tree);
/* A list of static class variables. This is needed, because a /* A list of static class variables. This is needed, because a
static class variable can be declared inside the class without static class variable can be declared inside the class without
an initializer, and then initialized, statically, outside the class. */ an initializer, and then initialized, statically, outside the class. */
static GTY(()) varray_type pending_statics; static GTY(()) VEC(tree,gc) *pending_statics;
#define pending_statics_used \
(pending_statics ? pending_statics->elements_used : 0)
/* A list of functions which were declared inline, but which we /* A list of functions which were declared inline, but which we
may need to emit outline anyway. */ may need to emit outline anyway. */
...@@ -735,9 +733,7 @@ note_vague_linkage_fn (tree decl) ...@@ -735,9 +733,7 @@ note_vague_linkage_fn (tree decl)
static void static void
note_vague_linkage_var (tree var) note_vague_linkage_var (tree var)
{ {
if (!pending_statics) VEC_safe_push (tree, gc, pending_statics, var);
VARRAY_TREE_INIT (pending_statics, 32, "pending_statics");
VARRAY_PUSH_TREE (pending_statics, var);
} }
/* We have just processed the DECL, which is a static data member. /* We have just processed the DECL, which is a static data member.
...@@ -2779,6 +2775,7 @@ cp_finish_file (void) ...@@ -2779,6 +2775,7 @@ cp_finish_file (void)
do do
{ {
tree t; tree t;
tree decl;
reconsider = false; reconsider = false;
...@@ -2965,9 +2962,8 @@ cp_finish_file (void) ...@@ -2965,9 +2962,8 @@ cp_finish_file (void)
reconsider = true; reconsider = true;
/* Static data members are just like namespace-scope globals. */ /* Static data members are just like namespace-scope globals. */
for (i = 0; i < pending_statics_used; ++i) for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i)
{ {
tree decl = VARRAY_TREE (pending_statics, i);
if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)) if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl))
continue; continue;
import_export_decl (decl); import_export_decl (decl);
...@@ -2976,9 +2972,9 @@ cp_finish_file (void) ...@@ -2976,9 +2972,9 @@ cp_finish_file (void)
if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl)) if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl))
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
} }
if (pending_statics if (VEC_length (tree, pending_statics) != 0
&& wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0), && wrapup_global_declarations (VEC_address (tree, pending_statics),
pending_statics_used)) VEC_length (tree, pending_statics)))
reconsider = true; reconsider = true;
retries++; retries++;
...@@ -3049,9 +3045,9 @@ cp_finish_file (void) ...@@ -3049,9 +3045,9 @@ cp_finish_file (void)
/* Now, issue warnings about static, but not defined, functions, /* Now, issue warnings about static, but not defined, functions,
etc., and emit debugging information. */ etc., and emit debugging information. */
walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider); walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider);
if (pending_statics) if (VEC_length (tree, pending_statics) != 0)
check_global_declarations (&VARRAY_TREE (pending_statics, 0), check_global_declarations (VEC_address (tree, pending_statics),
pending_statics_used); VEC_length (tree, pending_statics));
finish_repo (); finish_repo ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment