]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Avoid performing policy checks on ignored ghost pragmas
authorViljar Indus <indus@adacore.com>
Wed, 30 Jul 2025 09:34:13 +0000 (12:34 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 9 Sep 2025 12:39:52 +0000 (14:39 +0200)
These pragamas are already disabled if the relative ghost entity
is disabled.

gcc/ada/ChangeLog:

* ghost.adb (Is_OK_Pragma): mark the context of ignored ghost
pragmas as OK.

gcc/ada/ghost.adb

index 574f7f2cda407d9317e1f86f90ce17b12a635392..695970fbdd2e5c81d66be83dcb97310e7acb1df9 100644 (file)
@@ -453,6 +453,13 @@ package body Ghost is
                return False;
             end if;
 
+            --  if the entitiy associated with the pragma is ignored then we do
+            --  not need to analyze the pragma.
+
+            if Is_Ignored_Ghost_Pragma (Prag) then
+               return True;
+            end if;
+
             Prag_Id  := Get_Pragma_Id (Prag);
             Prag_Nam := Original_Aspect_Pragma_Name (Prag);