Preserve_Comes_From_Source (Orig_Id, Orig_Decl);
Set_Comes_From_Source (New_Id, False);
+
+ -- Preserve aliased indication
+
+ Set_Is_Aliased (Orig_Id, Is_Aliased (New_Id));
end Replace_Renaming_Declaration_Id;
---------------------------------
then
return Is_Aliased_View (Expression (Obj));
+ -- The dereference of an access-to-object value denotes an aliased view,
+ -- but this routine uses the rules of the language so we need to exclude
+ -- rewritten constructs that introduce artificial dereferences.
+
elsif Nkind (Obj) = N_Explicit_Dereference then
- return Nkind (Original_Node (Obj)) /= N_Function_Call;
+ return not Is_Captured_Function_Call (Obj)
+ and then not
+ (Nkind (Parent (Obj)) = N_Object_Renaming_Declaration
+ and then Is_Return_Object (Defining_Entity (Parent (Obj))));
else
return False;
procedure Set_Debug_Info_Defining_Id (N : Node_Id) is
begin
- if Comes_From_Source (Defining_Identifier (N)) then
+ if Comes_From_Source (Defining_Identifier (N))
+ or else Debug_Generated_Code
+ then
Set_Debug_Info_Needed (Defining_Identifier (N));
end if;
end Set_Debug_Info_Defining_Id;
-- associated name (i.e. the Node_Id associated with its name).
procedure Set_Debug_Info_Defining_Id (N : Node_Id);
- -- Call Set_Debug_Info_Needed on Defining_Identifier (N) if it comes
- -- from source.
+ -- Call Set_Debug_Info_Needed on Defining_Identifier (N) if it comes from
+ -- source or we are in -gnatD mode, where we are debugging generated code.
procedure Set_Debug_Info_Needed (T : Entity_Id);
-- Sets the Debug_Info_Needed flag on entity T , and also on any entities