aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2025-08-22 11:31:56 +0300
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-09-11 11:10:49 +0200
commitb69dbe06f91248457e7b532d5c8fffc4f73b1f76 (patch)
treeab78c38e6d0bc424ef487d6672b491ab3ee6643e
parent4183b13f048bec3985799a2aa4fe94f9770c7070 (diff)
downloadgcc-b69dbe06f91248457e7b532d5c8fffc4f73b1f76.zip
gcc-b69dbe06f91248457e7b532d5c8fffc4f73b1f76.tar.gz
gcc-b69dbe06f91248457e7b532d5c8fffc4f73b1f76.tar.bz2
ada: Create a ghost region for pragma annotate
Create a ghost region for pragma annotate so that we are able to analyze the entity references correctly inside the pragma. gcc/ada/ChangeLog: * sem_prag.adb: Create a ghost region for pragma annotate before analyzing its arguments.
-rw-r--r--gcc/ada/sem_prag.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 753ccda..661d440 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -14149,6 +14149,9 @@ package body Sem_Prag is
Expr : Node_Id;
Nam_Arg : Node_Id;
+ Saved_Ghost_Config : constant Ghost_Config_Type := Ghost_Config;
+ -- Save the Ghost-related attributes to restore on exit
+
--------------------------
-- Inferred_String_Type --
--------------------------
@@ -14226,6 +14229,10 @@ package body Sem_Prag is
end if;
end if;
+ -- Set the ghost mode before analyzing all of the arguments
+
+ Set_Ghost_Mode (N);
+
-- Continue the processing with last argument removed for now
Check_Arg_Is_Identifier (Arg1);
@@ -14271,6 +14278,8 @@ package body Sem_Prag is
Next (Arg);
end loop;
end if;
+
+ Restore_Ghost_Region (Saved_Ghost_Config);
end Annotate;
-------------------------------------------------