]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Replace low-level detection of subprograms with high-level wrapper
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 10 Nov 2021 11:41:19 +0000 (12:41 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Dec 2021 10:24:40 +0000 (10:24 +0000)
gcc/ada/

* exp_aggr.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb,
sem_elim.adb, sem_util.adb: Replace uses of Subprogram_Kind with
Is_Subprogram.

gcc/ada/exp_aggr.adb
gcc/ada/sem_cat.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_elim.adb
gcc/ada/sem_util.adb

index f3d83a566ced6c2a37ecad3cddff9f4639b6270f..af39ba58e1463623923ba849819e5b30802dcf30 100644 (file)
@@ -9248,7 +9248,7 @@ package body Exp_Aggr is
 
             when N_Object_Declaration =>
                return not Constant_Present (C)
-                 and then Ekind (Current_Scope) in Subprogram_Kind;
+                 and then Is_Subprogram (Current_Scope);
 
             --  False for all other contexts
 
index 92aa7ecadf52bf7f1093debb64354d898c1ae5c8..6270b7c7aa55bff911ea8fb3746e7a51129fe51e 100644 (file)
@@ -807,7 +807,7 @@ package body Sem_Cat is
       end if;
 
       if not Is_Remote_Call_Interface (E) then
-         if Ekind (E) in Subprogram_Kind then
+         if Is_Subprogram (E) then
             Declaration := Unit_Declaration_Node (E);
 
             if Nkind (Declaration) in
index f586461b4a8492205f95e87a9a89ea2ccfd1a8f2..f4ce099884b74aa00cd197994ac60c6ca85d3af2 100644 (file)
@@ -5271,7 +5271,7 @@ package body Sem_Ch10 is
             end if;
 
             if Is_Generic_Instance (Uname)
-              and then Ekind (Uname) in Subprogram_Kind
+              and then Is_Subprogram (Uname)
             then
                --  Set flag as well on the visible entity that denotes the
                --  instance, which renames the current one.
index d46d65c391429551251129d34c4c22d6313a50f7..a37224a7b18db31395dac9283e0ff1bf23ec9e1b 100644 (file)
@@ -5298,7 +5298,7 @@ package body Sem_Ch12 is
 
          Scop := Scope (E);
          while Scop /= Standard_Standard loop
-            if Ekind (Scop) in Subprogram_Kind and then Is_Inlined (Scop) then
+            if Is_Subprogram (Scop) and then Is_Inlined (Scop) then
                return True;
             end if;
 
index c08686d0b099786e27f979234299219f9f82637c..bd3c2ef3235fcffe13a86fb0c9f2c2ae3bd1a20c 100644 (file)
@@ -247,7 +247,7 @@ package body Sem_Elim is
 
       --  Elimination of objects and types is not implemented yet
 
-      elsif Ekind (E) not in Subprogram_Kind then
+      elsif not Is_Subprogram (E) then
          return;
       end if;
 
index bd8c88da8656b26bd26a073c1192fe2bfe8459e0..f8e9888fdd6272c02f5d2ce7ec4eb1e851740e70 100644 (file)
@@ -29476,7 +29476,7 @@ package body Sem_Util is
                   --  Since we are only interested in the formal case, avoid
                   --  the anonymous access result type.
 
-                  if Ekind (Def_Ent) in Subprogram_Kind
+                  if Is_Subprogram (Def_Ent)
                     and then not (Ekind (Def_Ent) = E_Function
                                    and then Etype (Def_Ent) = Typ)
                   then