Commit 125121e2 by Kazu Hirata Committed by Kazu Hirata

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

	* decl2.c (deferred_fns, note_vague_linkage_fn,
	cp_finish_file): Use VEC instead of VARRAY.

From-SVN: r99290
parent bd96cd55
2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
* decl2.c (deferred_fns, note_vague_linkage_fn,
cp_finish_file): Use VEC instead of VARRAY.
2005-05-05 Mark Mitchell <mark@codesourcery.com> 2005-05-05 Mark Mitchell <mark@codesourcery.com>
PR c++/21352 PR c++/21352
......
...@@ -92,9 +92,7 @@ static GTY(()) varray_type pending_statics; ...@@ -92,9 +92,7 @@ static GTY(()) varray_type pending_statics;
/* 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. */
static GTY(()) varray_type deferred_fns; static GTY(()) VEC(tree,gc) *deferred_fns;
#define deferred_fns_used \
(deferred_fns ? deferred_fns->elements_used : 0)
/* Flag used when debugging spew.c */ /* Flag used when debugging spew.c */
...@@ -732,9 +730,7 @@ note_vague_linkage_fn (tree decl) ...@@ -732,9 +730,7 @@ note_vague_linkage_fn (tree decl)
{ {
DECL_DEFERRED_FN (decl) = 1; DECL_DEFERRED_FN (decl) = 1;
DECL_DEFER_OUTPUT (decl) = 1; DECL_DEFER_OUTPUT (decl) = 1;
if (!deferred_fns) VEC_safe_push (tree, gc, deferred_fns, decl);
VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns");
VARRAY_PUSH_TREE (deferred_fns, decl);
} }
} }
...@@ -2747,6 +2743,7 @@ cp_finish_file (void) ...@@ -2747,6 +2743,7 @@ cp_finish_file (void)
location_t locus; location_t locus;
unsigned ssdf_count = 0; unsigned ssdf_count = 0;
int retries = 0; int retries = 0;
tree decl;
locus = input_location; locus = input_location;
at_eof = 1; at_eof = 1;
...@@ -2910,10 +2907,8 @@ cp_finish_file (void) ...@@ -2910,10 +2907,8 @@ cp_finish_file (void)
/* Go through the set of inline functions whose bodies have not /* Go through the set of inline functions whose bodies have not
been emitted yet. If out-of-line copies of these functions been emitted yet. If out-of-line copies of these functions
are required, emit them. */ are required, emit them. */
for (i = 0; i < deferred_fns_used; ++i) for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
{ {
tree decl = VARRAY_TREE (deferred_fns, i);
/* Does it need synthesizing? */ /* Does it need synthesizing? */
if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl) if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
&& (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl))) && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl)))
...@@ -2998,10 +2993,8 @@ cp_finish_file (void) ...@@ -2998,10 +2993,8 @@ cp_finish_file (void)
while (reconsider); while (reconsider);
/* All used inline functions must have a definition at this point. */ /* All used inline functions must have a definition at this point. */
for (i = 0; i < deferred_fns_used; ++i) for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
{ {
tree decl = VARRAY_TREE (deferred_fns, i);
if (/* Check online inline functions that were actually used. */ if (/* Check online inline functions that were actually used. */
TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl) TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl)
/* But not defined. */ /* But not defined. */
......
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