public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Yannick Moy <moy@adacore.com>
Subject: [COMMITTED 14/16] ada: Skip subprogram body entities inside scopes
Date: Fri, 14 Jun 2024 09:36:30 +0200	[thread overview]
Message-ID: <20240614073633.2089692-14-poulhies@adacore.com> (raw)
In-Reply-To: <20240614073633.2089692-1-poulhies@adacore.com>

From: Yannick Moy <moy@adacore.com>

Entities of kind E_Subprogram_Body, used on bodies of subprograms for
which there is a separate declaration, have been added in the entities
linked from a scope in order to get the representation information on
their enclosed object and type declarations. Skip these entities in gigi.

gcc/ada/

	* gcc-interface/trans.cc (elaborate_all_entities_for_package)
	(process_freeze_entity): Skip entities of kind E_Subprogram_Body.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/gcc-interface/trans.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index 5256095dfeb..e68fb3fd776 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -9321,6 +9321,10 @@ elaborate_all_entities_for_package (Entity_Id gnat_package)
       if (kind == E_Package_Body)
 	continue;
 
+      /* Skip subprogram bodies.  */
+      if (kind == E_Subprogram_Body)
+	continue;
+
       /* Skip limited views that point back to the main unit.  */
       if (IN (kind, Incomplete_Kind)
 	  && From_Limited_With (gnat_entity)
@@ -9427,6 +9431,10 @@ process_freeze_entity (Node_Id gnat_node)
   if (Is_Subprogram (gnat_entity) && Present (Interface_Alias (gnat_entity)))
     return;
 
+  /* Skip subprogram bodies.  */
+  if (kind == E_Subprogram_Body)
+    return;
+
   /* Check for an old definition if this isn't an object with address clause,
      since the saved GCC tree is the address expression in that case.  */
   gnu_old
-- 
2.45.1


  parent reply	other threads:[~2024-06-14  7:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  7:36 [COMMITTED 01/16] ada: Remove unused name of aspect from Snames Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 02/16] ada: Allow implicit dereferenced for uses of 'Super Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 03/16] ada: Couple of small cleanups in semantic analysis of aspects Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 04/16] ada: Missing initialization of multidimensional array using sliding Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 05/16] ada: Minor tweaks to processing of Aggregate aspect Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 06/16] ada: Crash checking accessibility level on private type Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 07/16] ada: Add prototype for mutably tagged types Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 08/16] ada: Minor tweak in Snames Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 09/16] ada: Simplify handling of VxWorks-specific error codes for ENOENT Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 10/16] ada: Bad tree built for Obj.Discrim_Dep_Component'Loop_Entry in assertion Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 11/16] ada: Fix parts of classification of aspects Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 12/16] ada: Typo and indentation fix Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 13/16] ada: Do not create null GCC thunks Marc Poulhiès
2024-06-14  7:36 ` Marc Poulhiès [this message]
2024-06-14  7:36 ` [COMMITTED 15/16] ada: Fix return mechanism reported by -gnatRm Marc Poulhiès
2024-06-14  7:36 ` [COMMITTED 16/16] ada: Do not include target-specific makefile fragments Marc Poulhiès

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=20240614073633.2089692-14-poulhies@adacore.com \
    --to=poulhies@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=moy@adacore.com \
    /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).