public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5664] [Ada] Replace low-level detection of subprograms with high-level wrapper
Date: Wed,  1 Dec 2021 10:25:59 +0000 (GMT)	[thread overview]
Message-ID: <20211201102559.B2BC73858029@sourceware.org> (raw)

https://gcc.gnu.org/g:0f3dfe41cb296ff2a53b6b917aa10ff5a78c24fe

commit r12-5664-g0f3dfe41cb296ff2a53b6b917aa10ff5a78c24fe
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Nov 10 12:41:19 2021 +0100

    [Ada] Replace low-level detection of subprograms with high-level wrapper
    
    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.

Diff:
---
 gcc/ada/exp_aggr.adb | 2 +-
 gcc/ada/sem_cat.adb  | 2 +-
 gcc/ada/sem_ch10.adb | 2 +-
 gcc/ada/sem_ch12.adb | 2 +-
 gcc/ada/sem_elim.adb | 2 +-
 gcc/ada/sem_util.adb | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index f3d83a566ce..af39ba58e14 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -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
 
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index 92aa7ecadf5..6270b7c7aa5 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -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
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index f586461b4a8..f4ce099884b 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -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.
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index d46d65c3914..a37224a7b18 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -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;
 
diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb
index c08686d0b09..bd3c2ef3235 100644
--- a/gcc/ada/sem_elim.adb
+++ b/gcc/ada/sem_elim.adb
@@ -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;
 
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index bd8c88da865..f8e9888fdd6 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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


                 reply	other threads:[~2021-12-01 10:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201102559.B2BC73858029@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).