annotate gcc/ada/sem_ch10.ads @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S E M _ C H 1 0 --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 with Types; use Types;
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 package Sem_Ch10 is
kono
parents:
diff changeset
29 procedure Analyze_Compilation_Unit (N : Node_Id);
kono
parents:
diff changeset
30 procedure Analyze_With_Clause (N : Node_Id);
kono
parents:
diff changeset
31 procedure Analyze_Subprogram_Body_Stub (N : Node_Id);
kono
parents:
diff changeset
32 procedure Analyze_Package_Body_Stub (N : Node_Id);
kono
parents:
diff changeset
33 procedure Analyze_Task_Body_Stub (N : Node_Id);
kono
parents:
diff changeset
34 procedure Analyze_Protected_Body_Stub (N : Node_Id);
kono
parents:
diff changeset
35 procedure Analyze_Subunit (N : Node_Id);
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 procedure Install_Context (N : Node_Id; Chain : Boolean := True);
kono
parents:
diff changeset
38 -- Installs the entities from the context clause of the given compilation
kono
parents:
diff changeset
39 -- unit into the visibility chains. This is done before analyzing a unit.
kono
parents:
diff changeset
40 -- For a child unit, install context of parents as well. The flag Chain is
kono
parents:
diff changeset
41 -- used to control the "chaining" or linking of use-type and use-package
kono
parents:
diff changeset
42 -- clauses to avoid circularities when reinstalling context clauses.
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 procedure Install_Private_With_Clauses (P : Entity_Id);
kono
parents:
diff changeset
45 -- Install the private with_clauses of a compilation unit, when compiling
kono
parents:
diff changeset
46 -- its private part, compiling a private child unit, or compiling the
kono
parents:
diff changeset
47 -- private declarations of a public child unit.
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 function Is_Legal_Shadow_Entity_In_Body (T : Entity_Id) return Boolean;
kono
parents:
diff changeset
50 -- Assuming that type T is an incomplete type coming from a limited with
kono
parents:
diff changeset
51 -- view, determine whether the package where T resides is imported through
kono
parents:
diff changeset
52 -- a regular with clause in the current package body.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 procedure Remove_Context (N : Node_Id);
kono
parents:
diff changeset
55 -- Removes the entities from the context clause of the given compilation
kono
parents:
diff changeset
56 -- unit from the visibility chains. This is done on exit from a unit as
kono
parents:
diff changeset
57 -- part of cleaning up the visibility chains for the caller. A special
kono
parents:
diff changeset
58 -- case is that the call from the Main_Unit can be ignored, since at the
kono
parents:
diff changeset
59 -- end of the main unit the visibility table won't be needed in any case.
kono
parents:
diff changeset
60 -- For a child unit, remove parents and their context as well.
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 procedure Remove_Private_With_Clauses (Comp_Unit : Node_Id);
kono
parents:
diff changeset
63 -- The private_with_clauses of a compilation unit are visible in the
kono
parents:
diff changeset
64 -- private part of a nested package, even if this package appears in
kono
parents:
diff changeset
65 -- the visible part of the enclosing compilation unit. This Ada 2005
kono
parents:
diff changeset
66 -- rule imposes extra steps in order to install/remove the private_with
kono
parents:
diff changeset
67 -- clauses of an enclosing unit.
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 procedure Load_Needed_Body
kono
parents:
diff changeset
70 (N : Node_Id;
kono
parents:
diff changeset
71 OK : out Boolean;
kono
parents:
diff changeset
72 Do_Analyze : Boolean := True);
kono
parents:
diff changeset
73 -- Load and analyze the body of a context unit that is generic, or that
kono
parents:
diff changeset
74 -- contains generic units or inlined units. The body becomes part of the
kono
parents:
diff changeset
75 -- semantic dependency set of the unit that needs it. The returned result
kono
parents:
diff changeset
76 -- in OK is True if the load is successful, and False if the requested file
kono
parents:
diff changeset
77 -- cannot be found. If the flag Do_Analyze is false, the unit is loaded and
kono
parents:
diff changeset
78 -- parsed only. This allows a selective analysis in some inlining cases
kono
parents:
diff changeset
79 -- where a full analysis would lead so circularities in the back-end.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 end Sem_Ch10;