[Ada] Adapt Is_Actual_Parameter to also work for entry parameters

Message ID 20210616084355.GA95770@adacore.com
State New
Headers show
Series
  • [Ada] Adapt Is_Actual_Parameter to also work for entry parameters
Related show

Commit Message

Pierre-Marie de Rodat June 16, 2021, 8:43 a.m.
Routine Is_Actual_Parameter now also detects entry parameters; this
change is harmless for GNAT and allows this routine to be reused in
GNATprove.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_util.ads (Is_Actual_Parameter): Update comment.
	* sem_util.adb (Is_Actual_Parameter): Also detect entry parameters.

Patch

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -15467,7 +15467,9 @@  package body Sem_Util is
          when N_Parameter_Association =>
             return N = Explicit_Actual_Parameter (Parent (N));
 
-         when N_Subprogram_Call =>
+         when N_Entry_Call_Statement
+            | N_Subprogram_Call
+         =>
             return Is_List_Member (N)
               and then
                 List_Containing (N) = Parameter_Associations (Parent (N));


diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1726,7 +1726,7 @@  package Sem_Util is
    --  subprogram call.
 
    function Is_Actual_Parameter (N : Node_Id) return Boolean;
-   --  Determines if N is an actual parameter in a subprogram call
+   --  Determines if N is an actual parameter in a subprogram or entry call
 
    function Is_Actual_Tagged_Parameter (N : Node_Id) return Boolean;
    --  Determines if N is an actual parameter of a formal of tagged type in a