annotate gcc/ada/sem_ch7.ads @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children 1830386684a0
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 7 --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, 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_Ch7 is
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 procedure Analyze_Package_Body (N : Node_Id);
kono
parents:
diff changeset
31 procedure Analyze_Package_Declaration (N : Node_Id);
kono
parents:
diff changeset
32 procedure Analyze_Package_Specification (N : Node_Id);
kono
parents:
diff changeset
33 procedure Analyze_Private_Type_Declaration (N : Node_Id);
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 procedure End_Package_Scope (P : Entity_Id);
kono
parents:
diff changeset
36 -- Calls Uninstall_Declarations, and then pops the scope stack
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 procedure Exchange_Declarations (Id : Entity_Id);
kono
parents:
diff changeset
39 -- Exchange private and full declaration on entry/exit from a package
kono
parents:
diff changeset
40 -- declaration or body. The semantic links of the respective nodes
kono
parents:
diff changeset
41 -- are preserved in the exchange.
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 procedure Install_Visible_Declarations (P : Entity_Id);
kono
parents:
diff changeset
44 procedure Install_Private_Declarations (P : Entity_Id);
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 -- On entrance to a package body, make declarations in package spec
kono
parents:
diff changeset
47 -- immediately visible.
kono
parents:
diff changeset
48 --
kono
parents:
diff changeset
49 -- When compiling the body of a package, both routines are called in
kono
parents:
diff changeset
50 -- succession. When compiling the body of a child package, the call
kono
parents:
diff changeset
51 -- to Install_Private_Declaration is immediate for private children,
kono
parents:
diff changeset
52 -- but is deferred until the compilation of the private part of the
kono
parents:
diff changeset
53 -- child for public child packages.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 function Unit_Requires_Body
kono
parents:
diff changeset
56 (Pack_Id : Entity_Id;
kono
parents:
diff changeset
57 Do_Abstract_States : Boolean := False) return Boolean;
kono
parents:
diff changeset
58 -- Determine whether package Pack_Id requires a body. A specification needs
kono
parents:
diff changeset
59 -- a body if it contains declarations that require completion in the body.
kono
parents:
diff changeset
60 -- A non-Ghost [generic] package does not require a body when it declares
kono
parents:
diff changeset
61 -- Ghost entities exclusively. When flag Do_Abstract_States is set to True,
kono
parents:
diff changeset
62 -- non-null abstract states are considered in determining the need for a
kono
parents:
diff changeset
63 -- body.
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 procedure May_Need_Implicit_Body (E : Entity_Id);
kono
parents:
diff changeset
66 -- If a package declaration contains tasks or RACWs and does not require
kono
parents:
diff changeset
67 -- a body, create an implicit body at the end of the current declarative
kono
parents:
diff changeset
68 -- part to activate those tasks or contain the bodies for the RACW
kono
parents:
diff changeset
69 -- calling stubs.
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 procedure New_Private_Type (N : Node_Id; Id : Entity_Id; Def : Node_Id);
kono
parents:
diff changeset
72 -- Common processing for private type declarations and for formal private
kono
parents:
diff changeset
73 -- type declarations. For private types, N and Def are the type declaration
kono
parents:
diff changeset
74 -- node; for formal private types, Def is the formal type definition.
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 procedure Uninstall_Declarations (P : Entity_Id);
kono
parents:
diff changeset
77 -- At the end of a package declaration or body, declarations in the visible
kono
parents:
diff changeset
78 -- part are no longer immediately visible, and declarations in the private
kono
parents:
diff changeset
79 -- part are not visible at all. For inner packages, place visible entities
kono
parents:
diff changeset
80 -- at the end of their homonym chains. For compilation units, make
kono
parents:
diff changeset
81 -- all entities invisible. In both cases, exchange private and visible
kono
parents:
diff changeset
82 -- declarations to restore order of elaboration.
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 end Sem_Ch7;