Commit 1197b8ba by Eric Botcazou Committed by Arnaud Charlet

decl.c (gnat_to_gnu_entity): Rework comment.

2005-03-29  Eric Botcazou  <ebotcazou@adacore.com>

	* decl.c (gnat_to_gnu_entity) <E_Variable>: Rework comment.
	* trans.c (tree_transform) <N_Identifier>: Use correct predicates.

From-SVN: r97191
parent bf7c85c9
...@@ -776,13 +776,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -776,13 +776,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
} }
/* Otherwise, make this into a constant pointer to the object we /* Otherwise, make this into a constant pointer to the object we
are to rename. are to rename and attach the object to the pointer. We need
to stabilize too since the renaming evaluation may directly
Stabilize it since in this case the renaming evaluation may reference the renamed object instead of the pointer we will
directly dereference the initial value we make here instead attach it to. We don't want variables in the expression to
of the pointer we will assign it to. We don't want variables be evaluated every time the renaming is used, since their
in the expression to be evaluated every time the renaming is value may change in between. */
used, since their value may change in between. */
else else
{ {
bool has_side_effects = TREE_SIDE_EFFECTS (gnu_expr); bool has_side_effects = TREE_SIDE_EFFECTS (gnu_expr);
......
...@@ -410,8 +410,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) ...@@ -410,8 +410,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
&& (! DECL_RENAMING_GLOBAL_P (gnu_result) && (! DECL_RENAMING_GLOBAL_P (gnu_result)
|| global_bindings_p ()) || global_bindings_p ())
/* Make sure it's an lvalue like INDIRECT_REF. */ /* Make sure it's an lvalue like INDIRECT_REF. */
&& (TREE_CODE_CLASS (TREE_CODE (renamed_obj)) == 'd' && (DECL_P (renamed_obj) || REFERENCE_CLASS_P (renamed_obj)))
|| TREE_CODE_CLASS (TREE_CODE (renamed_obj)) == 'r'))
gnu_result = renamed_obj; gnu_result = renamed_obj;
else else
gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE,
......
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