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: Tucker Taft <taft@adacore.com>
Subject: [COMMITED] ada: Make Original_Aspect_Pragma_Name more precise
Date: Mon, 26 Sep 2022 11:15:11 +0200	[thread overview]
Message-ID: <20220926091511.273296-1-poulhies@adacore.com> (raw)

From: Tucker Taft <taft@adacore.com>

This commit makes Original_Aspect_Pragma_Name more precise in cases
where there is a second level of indirection caused by pragmas being
turned into Check pragmas.

gcc/ada/

	* sem_util.adb (Original_Aspect_Pragma_Name): Check for Check
	pragmas.
---
 gcc/ada/sem_util.adb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index c43a008ae5d..9ae082ca2e1 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -26559,6 +26559,14 @@ package body Sem_Util is
          Item_Nam :=
            Chars (Original_Node (Pragma_Identifier (Original_Node (Item))));
 
+         if Item_Nam = Name_Check then
+            --  Pragma "Check" preserves the original pragma name as its first
+            --  argument.
+            Item_Nam :=
+              Chars (Expression (First (Pragma_Argument_Associations
+                (Original_Node (Item)))));
+         end if;
+
       else
          pragma Assert (Nkind (Item) = N_Aspect_Specification);
          Item_Nam := Chars (Identifier (Item));
-- 
2.25.1


                 reply	other threads:[~2022-09-26  9:15 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=20220926091511.273296-1-poulhies@adacore.com \
    --to=poulhies@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=taft@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).