]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] SCOs: generate 'P' decisions for [Type_]Invariant pragmas
authorMatthieu Eyraud <eyraud@adacore.com>
Wed, 7 Jul 2021 17:33:25 +0000 (19:33 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 21 Sep 2021 15:25:02 +0000 (15:25 +0000)
gcc/ada/

* par_sco.adb (Traverse_One): Add support for pragma Invariant /
Type_Invariant.

gcc/ada/par_sco.adb

index b4f76091f4441c09590451601db46d57a1f77809..513275a495afea7664c3baffff24a30441813629 100644 (file)
@@ -2248,6 +2248,8 @@ package body Par_SCO is
                         | Name_Loop_Invariant
                         | Name_Postcondition
                         | Name_Precondition
+                        | Name_Type_Invariant
+                        | Name_Invariant
                      =>
                         --  For Assert/Check/Precondition/Postcondition, we
                         --  must generate a P entry for the decision. Note
@@ -2256,7 +2258,10 @@ package body Par_SCO is
                         --  on when we output the decision line in Put_SCOs,
                         --  depending on setting by Set_SCO_Pragma_Enabled.
 
-                        if Nam = Name_Check then
+                        if Nam = Name_Check
+                           or else Nam = Name_Type_Invariant
+                           or else Nam = Name_Invariant
+                        then
                            Next (Arg);
                         end if;
 
@@ -2285,8 +2290,7 @@ package body Par_SCO is
                      --  never disabled.
 
                      --  Should generate P decisions (not X) for assertion
-                     --  related pragmas: [Type_]Invariant,
-                     --  [{Static,Dynamic}_]Predicate???
+                     --  related pragmas: [{Static,Dynamic}_]Predicate???
 
                      when others =>
                         Process_Decisions_Defer (N, 'X');