static void set_expr_location_from_node (tree, Node_Id, bool = false);
static void set_gnu_expr_location_from_node (tree, Node_Id);
static bool set_end_locus_from_node (tree, Node_Id);
-static int lvalue_required_p (Node_Id, tree, bool, bool, bool);
+static int lvalue_required_p (Node_Id, tree, bool, bool);
static tree build_raise_check (int, enum exception_info_kind);
static tree create_init_temporary (const char *, tree, tree *, Node_Id);
is the type that will be used for GNAT_NODE in the translated GNU tree.
CONSTANT indicates whether the underlying object represented by GNAT_NODE
is constant in the Ada sense. If it is, ADDRESS_OF_CONSTANT indicates
- whether its value is the address of a constant and ALIASED whether it is
- aliased. If it isn't, ADDRESS_OF_CONSTANT and ALIASED are ignored.
+ whether its value is the address of another constant. If it isn't, then
+ ADDRESS_OF_CONSTANT is ignored.
The function climbs up the GNAT tree starting from the node and returns 1
upon encountering a node that effectively requires an lvalue downstream.
static int
lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant,
- bool address_of_constant, bool aliased)
+ bool address_of_constant)
{
Node_Id gnat_parent = Parent (gnat_node), gnat_temp;
if (Prefix (gnat_parent) != gnat_node)
return 0;
- aliased |= Has_Aliased_Components (Etype (gnat_node));
return lvalue_required_p (gnat_parent, gnu_type, constant,
- address_of_constant, aliased);
+ address_of_constant);
case N_Selected_Component:
- aliased |= Is_Aliased (Entity (Selector_Name (gnat_parent)));
return lvalue_required_p (gnat_parent, gnu_type, constant,
- address_of_constant, aliased);
+ address_of_constant);
case N_Object_Renaming_Declaration:
/* We need to preserve addresses through a renaming. */
an intermediate conversion that is meant to be purely formal. */
return lvalue_required_p (gnat_parent,
get_unpadded_type (Etype (gnat_parent)),
- constant, address_of_constant, aliased);
+ constant, address_of_constant);
case N_Allocator:
/* We should only reach here through the N_Qualified_Expression case.
if (constant && address_of_constant)
return lvalue_required_p (gnat_parent,
get_unpadded_type (Etype (gnat_parent)),
- true, false, true);
+ true, false);
/* ... fall through ... */
&& !Is_Imported (gnat_temp)
&& Present (Address_Clause (gnat_temp)))
{
- require_lvalue = lvalue_required_p (gnat_node, gnu_result_type, true,
- false, Is_Aliased (gnat_temp));
+ require_lvalue
+ = lvalue_required_p (gnat_node, gnu_result_type, true, false);
use_constant_initializer = !require_lvalue;
}
else if (TREE_CODE (gnu_result) == CONST_DECL
&& !(DECL_CONST_ADDRESS_P (gnu_result)
&& lvalue_required_p (gnat_node, gnu_result_type, true,
- true, false)))
+ true)))
gnu_result = DECL_INITIAL (gnu_result);
/* If it's a renaming pointer, get to the renamed object. */
if ((!constant_only || address_of_constant) && require_lvalue < 0)
require_lvalue
= lvalue_required_p (gnat_node, gnu_result_type, true,
- address_of_constant, Is_Aliased (gnat_temp));
+ address_of_constant);
/* Finally retrieve the initializer if this is deemed valid. */
if ((constant_only && !address_of_constant) || !require_lvalue)
{
if (require_lvalue < 0)
require_lvalue
- = lvalue_required_p (gnat_node, gnu_result_type, true, false,
- Is_Aliased (gnat_temp));
+ = lvalue_required_p (gnat_node, gnu_result_type, true, false);
if (!require_lvalue)
gnu_result = fold_constant_decl_in_expr (gnu_result);
}
|| kind == N_Indexed_Component
|| kind == N_Selected_Component)
&& TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE
- && !lvalue_required_p (gnat_node, gnu_result_type, false, false, false))
+ && !lvalue_required_p (gnat_node, gnu_result_type, false, false))
{
gnu_result
= build_binary_op (NE_EXPR, gnu_result_type,