1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 with Types; use Types;
30 procedure Analyze_Abstract_Subprogram_Declaration (N : Node_Id);
31 procedure Analyze_Function_Call (N : Node_Id);
32 procedure Analyze_Operator_Symbol (N : Node_Id);
33 procedure Analyze_Parameter_Association (N : Node_Id);
34 procedure Analyze_Procedure_Call (N : Node_Id);
35 procedure Analyze_Return_Statement (N : Node_Id);
36 procedure Analyze_Subprogram_Declaration (N : Node_Id);
37 procedure Analyze_Subprogram_Body (N : Node_Id);
39 function Analyze_Spec (N : Node_Id) return Entity_Id;
40 -- Analyze subprogram specification in both subprogram declarations
41 -- and body declarations.
43 procedure Check_Delayed_Subprogram (Designator : Entity_Id);
44 -- Designator can be a E_Subrpgram_Type, E_Procedure or E_Function. If a
45 -- type in its profile depends on a private type without a full
46 -- declaration, indicate that the subprogram is delayed.
48 procedure Check_Discriminant_Conformance
52 -- Check that the discriminants of a full type N fully conform to
53 -- the discriminants of the corresponding partial view Prev.
54 -- Prev_Loc indicates the source location of the partial view,
55 -- which may be different than Prev in the case of private types.
57 procedure Check_Fully_Conformant
60 Err_Loc : Node_Id := Empty);
61 -- Check that two callable entitites (subprograms, entries, literals)
62 -- are fully conformant, post error message if not (RM 6.3.1(17)) with
63 -- the flag being placed on the Err_Loc node if it is specified, and
64 -- on the appropriate component of the New_Id construct if not. Note:
65 -- when checking spec/body conformance, New_Id must be the body entity
66 -- and Old_Id is the spec entity (the code in the implementation relies
67 -- on this ordering, and in any case, this makes sense, since if flags
68 -- are to be placed on the construct, they clearly belong on the body.
70 procedure Check_Mode_Conformant
73 Err_Loc : Node_Id := Empty;
74 Get_Inst : Boolean := False);
75 -- Check that two callable entitites (subprograms, entries, literals)
76 -- are mode conformant, post error message if not (RM 6.3.1(15)) with
77 -- the flag being placed on the Err_Loc node if it is specified, and
78 -- on the appropriate component of the New_Id construct if not. The
79 -- argument Get_Inst is set to True when this is a check against a
80 -- formal access-to-subprogram type, indicating that mapping of types
83 procedure Check_Subtype_Conformant
86 Err_Loc : Node_Id := Empty);
87 -- Check that two callable entitites (subprograms, entries, literals)
88 -- are subtype conformant, post error message if not (RM 6.3.1(16))
89 -- the flag being placed on the Err_Loc node if it is specified, and
90 -- on the appropriate component of the New_Id construct if not.
92 procedure Check_Type_Conformant
95 Err_Loc : Node_Id := Empty);
96 -- Check that two callable entitites (subprograms, entries, literals)
97 -- are type conformant, post error message if not (RM 6.3.1(14)) with
98 -- the flag being placed on the Err_Loc node if it is specified, and
99 -- on the appropriate component of the New_Id construct if not.
101 procedure Create_Extra_Formals (E : Entity_Id);
102 -- For each parameter of a subprogram or entry that requires an additional
103 -- formal (such as for access parameters and indefinite discriminated
104 -- parameters), creates the appropriate formal and attach it to its
105 -- associated parameter. Each extra formal will also be appended to
106 -- the end of Subp's parameter list (with each subsequent extra formal
107 -- being attached to the preceding extra formal).
109 function Find_Corresponding_Spec (N : Node_Id) return Entity_Id;
110 -- Use the subprogram specification in the body to retrieve the previous
111 -- subprogram declaration, if any.
113 function Fully_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
114 -- Determine whether two callable entities (subprograms, entries,
115 -- literals) are fully conformant (RM 6.3.1(17))
117 function Fully_Conformant_Expressions
121 -- Determines if two (non-empty) expressions are fully conformant
122 -- as defined by (RM 6.3.1(18-21))
124 function Mode_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
125 -- Determine whether two callable entities (subprograms, entries,
126 -- literals) are mode conformant (RM 6.3.1(15))
128 procedure New_Overloaded_Entity
130 Derived_Type : Entity_Id := Empty);
131 -- Process new overloaded entity. Overloaded entities are created
132 -- by enumeration type declarations, subprogram specifications,
133 -- entry declarations, and (implicitly) by type derivations.
134 -- If Derived_Type is not Empty, then it indicates that this
135 -- is subprogram derived for that type.
137 procedure Process_Formals (T : List_Id; Related_Nod : Node_Id);
138 -- Enter the formals in the scope of the subprogram or entry, and
139 -- analyze default expressions if any. The implicit types created for
140 -- access parameter are attached to the Related_Nod which comes from the
143 procedure Set_Actual_Subtypes (N : Node_Id; Subp : Entity_Id);
144 -- If the formals of a subprogram are unconstrained, build a subtype
145 -- declaration that uses the bounds or discriminants of the actual to
146 -- construct an actual subtype for them. This is an optimization that
147 -- is done only in some cases where the actual subtype cannot change
148 -- during execution of the subprogram. By setting the actual subtype
149 -- once, we avoid recomputing it unnecessarily.
151 procedure Set_Formal_Mode (Formal_Id : Entity_Id);
152 -- Set proper Ekind to reflect formal mode (in, out, in out)
154 function Subtype_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
155 -- Determine whether two callable entities (subprograms, entries,
156 -- literals) are subtype conformant (RM6.3.1(16))
158 function Type_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
159 -- Determine whether two callable entities (subprograms, entries,
160 -- literals) are type conformant (RM6.3.1(14))
162 procedure Valid_Operator_Definition (Designator : Entity_Id);
163 -- Verify that an operator definition has the proper number of formals