diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-05-25 14:00:28 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-05-25 14:00:28 +0000 |
commit | ea292448322b87fcd3f8da04467420b49f609053 (patch) | |
tree | ad069168b45b5aa8b35d5e2c20ccbc3558fcf80d /gcc/ada/gcc-interface/utils.c | |
parent | 288cbbbdacf90e3da12df2fd0cffba69f66369ac (diff) | |
download | gcc-ea292448322b87fcd3f8da04467420b49f609053.zip gcc-ea292448322b87fcd3f8da04467420b49f609053.tar.gz gcc-ea292448322b87fcd3f8da04467420b49f609053.tar.bz2 |
ada-tree.h (DECL_RENAMING_GLOBAL_P): Rename into...
* gcc-interface/ada-tree.h (DECL_RENAMING_GLOBAL_P): Rename into...
(DECL_GLOBAL_NONCONSTANT_RENAMING_P): ...this.
* gcc-interface/gigi.h (record_global_renaming_pointer): Delete.
(invalidate_global_renaming_pointers): Likewise.
(record_global_nonconstant_renaming): New.
(invalidate_global_nonconstant_renamings): Likewise.
(get_inner_constant_reference): Likewise.
(gnat_constant_reference_p): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Adjust to above
and register the renaming pointer only if the object is non-constant.
(elaborate_expression_1): Call get_inner_constant_reference instead
of get_inner_reference.
* gcc-interface/trans.c (fold_constant_decl_in_expr): Minor tweak.
(Identifier_to_gnu): Adjust to above and do not recheck the renamed
object before substituting it.
(Compilation_Unit_to_gnu): Adjust to above renaming. Minor tweaks.
(gnat_to_gnu) <N_Object_Renaming_Declaration>: Do not return the
result at the global level.
(N_Exception_Renaming_Declaration): Likewise.
* gcc-interface/utils.c (global_renaming_pointers): Rename into...
(global_nonconstant_renamings): ...this.
(destroy_gnat_utils): Adjust to above renaming.
(record_global_renaming_pointer): Rename into...
(record_global_nonconstant_renaming): ...this.
(invalidate_global_renaming_pointers): Rename into...
(invalidate_global_nonconstant_renamings): ...this and do not recheck
the renamed object before invalidating.
* gcc-interface/utils2.c (gnat_stabilize_reference): Minor tweak.
(get_inner_constant_reference): New public function.
(gnat_constant_reference_p): New predicate.
From-SVN: r223644
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 5968857..184c7d5 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -233,8 +233,8 @@ static GTY(()) vec<tree, va_gc> *global_decls; /* An array of builtin function declarations. */ static GTY(()) vec<tree, va_gc> *builtin_decls; -/* An array of global renaming pointers. */ -static GTY(()) vec<tree, va_gc> *global_renaming_pointers; +/* An array of global non-constant renamings. */ +static GTY(()) vec<tree, va_gc> *global_nonconstant_renamings; /* A chain of unused BLOCK nodes. */ static GTY((deletable)) tree free_block_chain; @@ -323,8 +323,8 @@ destroy_gnat_utils (void) pad_type_hash_table->empty (); pad_type_hash_table = NULL; - /* Invalidate the global renaming pointers. */ - invalidate_global_renaming_pointers (); + /* Invalidate the global non-constant renamings. */ + invalidate_global_nonconstant_renamings (); } /* GNAT_ENTITY is a GNAT tree node for an entity. Associate GNU_DECL, a GCC @@ -2718,34 +2718,31 @@ process_attributes (tree *node, struct attrib **attr_list, bool in_place, *attr_list = NULL; } -/* Record DECL as a global renaming pointer. */ +/* Record DECL as a global non-constant renaming. */ void -record_global_renaming_pointer (tree decl) +record_global_nonconstant_renaming (tree decl) { gcc_assert (!DECL_LOOP_PARM_P (decl) && DECL_RENAMED_OBJECT (decl)); - vec_safe_push (global_renaming_pointers, decl); + vec_safe_push (global_nonconstant_renamings, decl); } -/* Invalidate the global renaming pointers that are not constant, lest their - renamed object contains SAVE_EXPRs tied to an elaboration routine. Note - that we should not blindly invalidate everything here because of the need - to propagate constant values through renaming. */ +/* Invalidate the global non-constant renamings, lest their renamed object + contains SAVE_EXPRs tied to an elaboration routine. */ void -invalidate_global_renaming_pointers (void) +invalidate_global_nonconstant_renamings (void) { unsigned int i; tree iter; - if (global_renaming_pointers == NULL) + if (global_nonconstant_renamings == NULL) return; - FOR_EACH_VEC_ELT (*global_renaming_pointers, i, iter) - if (!TREE_CONSTANT (DECL_RENAMED_OBJECT (iter))) - SET_DECL_RENAMED_OBJECT (iter, NULL_TREE); + FOR_EACH_VEC_ELT (*global_nonconstant_renamings, i, iter) + SET_DECL_RENAMED_OBJECT (iter, NULL_TREE); - vec_free (global_renaming_pointers); + vec_free (global_nonconstant_renamings); } /* Return true if VALUE is a known to be a multiple of FACTOR, which must be |