* [COMMITED] ada: Make Original_Aspect_Pragma_Name more precise
@ 2022-09-26 9:15 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2022-09-26 9:15 UTC (permalink / raw)
To: gcc-patches; +Cc: Tucker Taft
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-26 9:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 9:15 [COMMITED] ada: Make Original_Aspect_Pragma_Name more precise Marc Poulhiès
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).