1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2023, 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 3, 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 COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Types
; use Types
;
29 procedure Analyze_Compilation_Unit
(N
: Node_Id
);
30 procedure Analyze_With_Clause
(N
: Node_Id
);
31 procedure Analyze_Subprogram_Body_Stub
(N
: Node_Id
);
32 procedure Analyze_Package_Body_Stub
(N
: Node_Id
);
33 procedure Analyze_Task_Body_Stub
(N
: Node_Id
);
34 procedure Analyze_Protected_Body_Stub
(N
: Node_Id
);
35 procedure Analyze_Subunit
(N
: Node_Id
);
37 procedure Decorate_Type
40 Is_Tagged
: Boolean := False;
41 Materialize
: Boolean := False);
42 -- Perform minimal decoration of a type or its corresponding shadow
43 -- entity denoted by Ent. Scop is the proper scope. Flag Is_Tagged
44 -- should be set when Ent is a tagged type. Flag Materialize should be
45 -- set when Ent is a tagged type and its class-wide type needs to appear
48 procedure Install_Context
(N
: Node_Id
; Chain
: Boolean := True);
49 -- Installs the entities from the context clause of the given compilation
50 -- unit into the visibility chains. This is done before analyzing a unit.
51 -- For a child unit, install context of parents as well. The flag Chain is
52 -- used to control the "chaining" or linking of use-type and use-package
53 -- clauses to avoid circularities when reinstalling context clauses.
55 procedure Install_Private_With_Clauses
(P
: Entity_Id
);
56 -- Install the private with_clauses of a compilation unit, when compiling
57 -- its private part, compiling a private child unit, or compiling the
58 -- private declarations of a public child unit.
60 function Is_Legal_Shadow_Entity_In_Body
(T
: Entity_Id
) return Boolean;
61 -- Assuming that type T is an incomplete type coming from a limited with
62 -- view, determine whether the package where T resides is imported through
63 -- a regular with clause in the current package body.
65 function Is_Visible_Through_Renamings
67 Error_Node
: Node_Id
:= Empty
) return Boolean;
68 -- Check if some package installed though normal with-clauses has a
69 -- renaming declaration of package P. AARM 10.1.2(21/2). Errors are
70 -- reported on Error_Node (if present); otherwise no error is reported.
72 procedure Load_Needed_Body
75 -- Load and analyze the body of a context unit that is generic, or that
76 -- contains generic units or inlined units. The body becomes part of the
77 -- semantic dependency set of the unit that needs it. The returned result
78 -- in OK is True if the load is successful, and False if the requested file
81 procedure Remove_Context
(N
: Node_Id
);
82 -- Removes the entities from the context clause of the given compilation
83 -- unit from the visibility chains. This is done on exit from a unit as
84 -- part of cleaning up the visibility chains for the caller. A special
85 -- case is that the call from the Main_Unit can be ignored, since at the
86 -- end of the main unit the visibility table won't be needed in any case.
87 -- For a child unit, remove parents and their context as well.
89 procedure Remove_Private_With_Clauses
(Comp_Unit
: Node_Id
);
90 -- The private_with_clauses of a compilation unit are visible in the
91 -- private part of a nested package, even if this package appears in
92 -- the visible part of the enclosing compilation unit. This Ada 2005
93 -- rule imposes extra steps in order to install/remove the private_with
94 -- clauses of an enclosing unit.