diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-12-05 00:37:56 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-12-05 00:37:56 +0000 |
commit | 2c0f17dc4f33028746fa39329f1779a98ad8b0ac (patch) | |
tree | c4f652f2cc6a310cb0e76fe3419381d06cbe82ad /gcc | |
parent | a6873608446d86909cf4a60fea355091b1297e8d (diff) | |
download | gcc-2c0f17dc4f33028746fa39329f1779a98ad8b0ac.zip gcc-2c0f17dc4f33028746fa39329f1779a98ad8b0ac.tar.gz gcc-2c0f17dc4f33028746fa39329f1779a98ad8b0ac.tar.bz2 |
decl2.c (pending_statics_used): Make it a macro.
* decl2.c (pending_statics_used): Make it a macro.
(saved_inlines_used): Likewise.
(finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
(mark_inline_for_output): Likewise.
(ssdf_decls_used): Remove.
(start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
(generate_ctor_or_dtor_function): Adjust accordingly.
From-SVN: r30778
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 29 |
2 files changed, 19 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a8b5235..fa7e6c8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +1999-12-04 Mark Mitchell <mark@codesourcery.com> + + * decl2.c (pending_statics_used): Make it a macro. + (saved_inlines_used): Likewise. + (finish_static_data_member_decl): Use VARRAY_PUSH_TREE. + (mark_inline_for_output): Likewise. + (ssdf_decls_used): Remove. + (start_static_storage_duration_function): Use VARRAY_PUSH_TREE. + (generate_ctor_or_dtor_function): Adjust accordingly. + 1999-11-24 Geoffrey Keating <geoffk@cygnus.com> Greg McGary <gkm@gnu.org> diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index fb3c181..ca142a8 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -100,12 +100,14 @@ tree pending_vtables; static class variable can be declared inside the class without an initializer, and then initialized, staticly, outside the class. */ static varray_type pending_statics; -static size_t pending_statics_used; +#define pending_statics_used \ + (pending_statics ? pending_statics->elements_used : 0) /* A list of functions which were declared inline, but which we may need to emit outline anyway. */ static varray_type saved_inlines; -static size_t saved_inlines_used; +#define saved_inlines_used \ + (saved_inlines ? saved_inlines->elements_used : 0) /* Same, but not reset. Local temp variables and global temp variables can have the same name. */ @@ -1484,12 +1486,7 @@ finish_static_data_member_decl (decl, init, asmspec_tree, flags) { if (!pending_statics) VARRAY_TREE_INIT (pending_statics, 32, "pending_statics"); - - if (pending_statics_used == pending_statics->num_elements) - VARRAY_GROW (pending_statics, - 2 * pending_statics->num_elements); - VARRAY_TREE (pending_statics, pending_statics_used) = decl; - ++pending_statics_used; + VARRAY_PUSH_TREE (pending_statics, decl); } /* Static consts need not be initialized in the class definition. */ @@ -1966,12 +1963,8 @@ mark_inline_for_output (decl) DECL_SAVED_INLINE (decl) = 1; if (!saved_inlines) VARRAY_TREE_INIT (saved_inlines, 32, "saved_inlines"); - - if (saved_inlines_used == saved_inlines->num_elements) - VARRAY_GROW (saved_inlines, - 2 * saved_inlines->num_elements); - VARRAY_TREE (saved_inlines, saved_inlines_used) = decl; - ++saved_inlines_used; + + VARRAY_PUSH_TREE (saved_inlines, decl); } /* Hand off a unique name which can be used for variable we don't really @@ -2896,7 +2889,6 @@ static tree ssdf_decl; /* All the static storage duration functions created in this translation unit. */ static varray_type ssdf_decls; -static size_t ssdf_decls_used; /* A map from priority levels to information about that priority level. There may be many such levels, so efficient lookup is @@ -2969,10 +2961,7 @@ start_static_storage_duration_function () get_priority_info (DEFAULT_INIT_PRIORITY); } - if (ssdf_decls_used == ssdf_decls->num_elements) - VARRAY_GROW (ssdf_decls, 2 * ssdf_decls_used); - VARRAY_TREE (ssdf_decls, ssdf_decls_used) = ssdf_decl; - ++ssdf_decls_used; + VARRAY_PUSH_TREE (ssdf_decls, ssdf_decl); /* Create the argument list. */ initialize_p_decl = build_decl (PARM_DECL, @@ -3324,7 +3313,7 @@ generate_ctor_or_dtor_function (constructor_p, priority) /* Call the static storage duration function with appropriate arguments. */ - for (i = 0; i < ssdf_decls_used; ++i) + for (i = 0; i < ssdf_decls->elements_used; ++i) { arguments = tree_cons (NULL_TREE, build_int_2 (priority, 0), NULL_TREE); |