[Ada] Simplify membership tests with N_Subprogram_Call subtype
authorPiotr Trojanek <trojanek@adacore.com>
Sun, 29 Nov 2020 21:20:09 +0000 (22:20 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 16 Dec 2020 13:01:02 +0000 (08:01 -0500)
gcc/ada/

* exp_ch6.adb, exp_util.adb, sem_ch4.adb, sem_disp.adb,
sem_elab.adb: Simplify membership test.

gcc/ada/exp_ch6.adb
gcc/ada/exp_util.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_disp.adb
gcc/ada/sem_elab.adb

index afe7e8b..4e0559c 100644 (file)
@@ -3491,8 +3491,7 @@ package body Exp_Ch6 is
       --  of the dimension I/O packages.
 
       if Ada_Version >= Ada_2012
-        and then
-           Nkind (Call_Node) in N_Procedure_Call_Statement | N_Function_Call
+        and then Nkind (Call_Node) in N_Subprogram_Call
         and then Present (Parameter_Associations (Call_Node))
       then
          Expand_Put_Call_With_Symbol (Call_Node);
index bcfedfb..0e458a3 100644 (file)
@@ -12247,8 +12247,7 @@ package body Exp_Util is
                --  and view swaps, the parent type is taken from the formal
                --  parameter of the subprogram being called.
 
-               if Nkind (Context) in
-                    N_Function_Call | N_Procedure_Call_Statement
+               if Nkind (Context) in N_Subprogram_Call
                  and then No (Type_Map.Get (Entity (Name (Context))))
                then
                   New_Ref :=
index 7b358d4..9f7652b 100644 (file)
@@ -8088,8 +8088,7 @@ package body Sem_Ch4 is
             --  resolution does not depend on the type of the parameter that
             --  includes the indexing operation.
 
-            elsif Nkind (Parent (Par)) in
-                    N_Function_Call | N_Procedure_Call_Statement
+            elsif Nkind (Parent (Par)) in N_Subprogram_Call
               and then Is_Entity_Name (Name (Parent (Par)))
             then
                declare
index cf54337..36efa42 100644 (file)
@@ -625,7 +625,7 @@ package body Sem_Disp is
                   Par := Parent (Par);
                end if;
 
-               if Nkind (Par) in N_Function_Call | N_Procedure_Call_Statement
+               if Nkind (Par) in N_Subprogram_Call
                  and then Is_Entity_Name (Name (Par))
                then
                   declare
index 399aeb4..89b6e13 100644 (file)
@@ -3744,7 +3744,7 @@ package body Sem_Elab is
 
       Set_Is_Dispatching_Call
         (Marker,
-         Nkind (N) in N_Function_Call | N_Procedure_Call_Statement
+         Nkind (N) in N_Subprogram_Call
            and then Present (Controlling_Argument (N)));
 
       Set_Is_Elaboration_Checks_OK_Node
@@ -19368,7 +19368,7 @@ package body Sem_Elab is
 
    function Is_Call_Of_Generic_Formal (N : Node_Id) return Boolean is
    begin
-      return Nkind (N) in N_Function_Call | N_Procedure_Call_Statement
+      return Nkind (N) in N_Subprogram_Call
 
         --  Always return False if debug flag -gnatd.G is set