]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Cleanup related to lock-free protected subprograms
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 3 Oct 2022 14:45:49 +0000 (16:45 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 6 Oct 2022 09:22:49 +0000 (11:22 +0200)
Cleanup code and documentation; semantics is unaffected.

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst
(Lock_Free): Remove inconsistent periods that end item
descriptions.
* sem_ch9.adb
(Allows_Lock_Free_Implementation): Remove unnecessary guard
against an empty list of parameters; replace low-level entity kind
membership test with a high-level query; refill error message.
* gnat_rm.texi: Regenerate.

gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst
gcc/ada/gnat_rm.texi
gcc/ada/sem_ch9.adb

index 53836c9fbcf202b36a752be390cde91a4eaadfbf..6752d48d15948ae9d95cf0c45dedfdff8f7aaaa3 100644 (file)
@@ -3744,10 +3744,10 @@ In addition, each protected subprogram body must satisfy:
 
 * May reference only one protected component
 * May not reference nonconstant entities outside the protected subprogram
-  scope.
+  scope
 * May not contain address representation items, allocators, or quantified
-  expressions.
-* May not contain delay, goto, loop, or procedure-call statements.
+  expressions
+* May not contain delay, goto, loop, or procedure-call statements
 * May not contain exported and imported entities
 * May not dereferenced access values
 * Function calls and attribute references must be static
index e13dba037ffd2b4d5a207a7a8131c5032970fb28..e79cdeeacfea6920cbe193991adc784b85957e91 100644 (file)
@@ -5243,14 +5243,14 @@ May reference only one protected component
 
 @item 
 May not reference nonconstant entities outside the protected subprogram
-scope.
+scope
 
 @item 
 May not contain address representation items, allocators, or quantified
-expressions.
+expressions
 
 @item 
-May not contain delay, goto, loop, or procedure-call statements.
+May not contain delay, goto, loop, or procedure-call statements
 
 @item 
 May not contain exported and imported entities
index cae0f233c52a4c50c56f58f8d261510f5ad3ab34..6506358a02b778d0a2bf59cfe733e9e166beb4cb 100644 (file)
@@ -178,8 +178,6 @@ package body Sem_Ch9 is
                elsif Nkind (Decl) = N_Subprogram_Declaration
                  and then
                    Nkind (Specification (Decl)) = N_Procedure_Specification
-                 and then
-                   Present (Parameter_Specifications (Specification (Decl)))
                then
                   declare
                      Par_Specs : constant List_Id   :=
@@ -477,7 +475,7 @@ package body Sem_Ch9 is
                         --  Prohibit references to non-constant entities
                         --  outside the protected subprogram scope.
 
-                        if Ekind (Id) in Assignable_Kind
+                        if Is_Assignable (Id)
                           and then not
                             Scope_Within_Or_Same (Scope (Id), Sub_Id)
                           and then not
@@ -487,8 +485,8 @@ package body Sem_Ch9 is
                         then
                            if Lock_Free_Given then
                               Error_Msg_NE
-                                ("reference to global variable& not " &
-                                 "allowed", N, Id);
+                                ("reference to global variable& not allowed",
+                                 N, Id);
                               return Skip;
                            end if;
 
This page took 0.093256 seconds and 5 git commands to generate.