[multiple changes]
[gcc.git] / gcc / ada / sem_util.ads
index 044047bc86248b21d63a267e504a4eecb5b6d00e..84d04903c72e1468697f322f594d139583cf4779 100644 (file)
@@ -53,7 +53,7 @@ package Sem_Util is
    --  Add pragma Prag to the contract of an entry, a package [body], a
    --  subprogram [body] or variable denoted by Id. The following are valid
    --  pragmas:
-   --    Abstract_States
+   --    Abstract_State
    --    Async_Readers
    --    Async_Writers
    --    Contract_Cases
@@ -421,10 +421,14 @@ package Sem_Util is
    --  attribute, except in the case of formal private and derived types.
    --  Possible optimization???
 
-   function Corresponding_Spec_Of (Subp_Decl : Node_Id) return Entity_Id;
-   --  Return the corresponding spec of Subp_Decl when it denotes a body [stub]
-   --  or the defining entity of subprogram declaration Subp_Decl in all other
-   --  cases.
+   function Corresponding_Spec_Of (Decl : Node_Id) return Entity_Id;
+   --  Return the corresponding spec of Decl when it denotes a package or a
+   --  subprogram [stub], or the defining entity of Decl.
+
+   procedure Create_Generic_Contract (Unit : Node_Id);
+   --  Create a contract node for a generic package, generic subprogram or a
+   --  generic body denoted by Unit by collecting all source contract-related
+   --  pragmas in the contract of the unit.
 
    function Current_Entity (N : Node_Id) return Entity_Id;
    pragma Inline (Current_Entity);
@@ -1283,6 +1287,10 @@ package Sem_Util is
    --  means that the result returned is not crucial, but should err on the
    --  side of thinking things are fully initialized if it does not know.
 
+   function Is_Generic_Declaration_Or_Body (Decl : Node_Id) return Boolean;
+   --  Determine whether arbitrary declaration Decl denotes a generic package,
+   --  a generic subprogram or a generic body.
+
    function Is_Inherited_Operation (E : Entity_Id) return Boolean;
    --  E is a subprogram. Return True is E is an implicit operation inherited
    --  by a derived type declaration.
@@ -1333,6 +1341,14 @@ package Sem_Util is
    --  the Is_Variable sense) with an untagged type target are considered view
    --  conversions and hence variables.
 
+   function Is_Package_Contract_Annotation (Item : Node_Id) return Boolean;
+   --  Determine whether aspect specification or pragma Item is one of the
+   --  following package contract annotations:
+   --    Abstract_State
+   --    Initial_Condition
+   --    Initializes
+   --    Refined_State
+
    function Is_Partially_Initialized_Type
      (Typ              : Entity_Id;
       Include_Implicit : Boolean := True) return Boolean;
@@ -1411,6 +1427,24 @@ package Sem_Util is
    --  the N_Statement_Other_Than_Procedure_Call subtype from Sinfo).
    --  Note that a label is *not* a statement, and will return False.
 
+   function Is_Subprogram_Contract_Annotation (Item : Node_Id) return Boolean;
+   --  Determine whether aspect specification or pragma Item is one of the
+   --  following subprogram contract annotations:
+   --    Contract_Cases
+   --    Depends
+   --    Extensions_Visible
+   --    Global
+   --    Post
+   --    Post_Class
+   --    Postcondition
+   --    Pre
+   --    Pre_Class
+   --    Precondition
+   --    Refined_Depends
+   --    Refined_Global
+   --    Refined_Post
+   --    Test_Case
+
    function Is_Subprogram_Stub_Without_Prior_Declaration
      (N : Node_Id) return Boolean;
    --  Return True if N is a subprogram stub with no prior subprogram