-- not know what procedure is being called if the procedure might be
-- overloaded, so it is premature to go setting referenced flags or
-- making calls to Generate_Reference. We will wait till Resolve_Actuals
- -- for that processing
+ -- for that processing.
+ -- Note: there is a similar routine Sem_Util.Is_Actual_Parameter, but
+ -- it works for both function and procedure calls, while here we are
+ -- only concerned with procedure calls (and with entry calls as well,
+ -- but they are parsed as procedure calls and only later rewritten to
+ -- entry calls).
function Known_But_Invisible (E : Entity_Id) return Boolean;
-- This function determines whether a reference to the entity E, which
function Is_Actual_Parameter return Boolean is
begin
- return
- Nkind (N) = N_Identifier
- and then
- (Nkind (Parent (N)) = N_Procedure_Call_Statement
- or else
- (Nkind (Parent (N)) = N_Parameter_Association
- and then N = Explicit_Actual_Parameter (Parent (N))
- and then Nkind (Parent (Parent (N))) =
- N_Procedure_Call_Statement));
+ if Nkind (N) = N_Identifier then
+ case Nkind (Parent (N)) is
+ when N_Procedure_Call_Statement =>
+ return Is_List_Member (N)
+ and then List_Containing (N) =
+ Parameter_Associations (Parent (N));
+
+ when N_Parameter_Association =>
+ return N = Explicit_Actual_Parameter (Parent (N))
+ and then Nkind (Parent (Parent (N))) =
+ N_Procedure_Call_Statement;
+
+ when others =>
+ return False;
+ end case;
+ else
+ return False;
+ end if;
end Is_Actual_Parameter;
-------------------------