annotate gcc/ada/exp_sel.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 -- E X P _ S E L --
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 -- Routines used in Chapter 9 for the expansion of dispatching triggers in
kono
parents:
diff changeset
27 -- select statements (Ada 2005: AI-345)
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 with Types; use Types;
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 package Exp_Sel is
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 function Build_Abort_Block
kono
parents:
diff changeset
34 (Loc : Source_Ptr;
kono
parents:
diff changeset
35 Abr_Blk_Ent : Entity_Id;
kono
parents:
diff changeset
36 Cln_Blk_Ent : Entity_Id;
kono
parents:
diff changeset
37 Blk : Node_Id) return Node_Id;
kono
parents:
diff changeset
38 -- Generate:
kono
parents:
diff changeset
39 -- begin
kono
parents:
diff changeset
40 -- Blk
kono
parents:
diff changeset
41 -- exception
kono
parents:
diff changeset
42 -- when Abort_Signal => Abort_Undefer / null;
kono
parents:
diff changeset
43 -- end;
kono
parents:
diff changeset
44 -- Abr_Blk_Ent is the name of the generated block, Cln_Blk_Ent is the name
kono
parents:
diff changeset
45 -- of the encapsulated cleanup block, Blk is the actual block name.
kono
parents:
diff changeset
46 -- The exception handler code is built by Build_Abort_Block_Handler.
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 function Build_Abort_Block_Handler (Loc : Source_Ptr) return Node_Id;
kono
parents:
diff changeset
49 -- Generate if front-end exception:
kono
parents:
diff changeset
50 -- when others =>
kono
parents:
diff changeset
51 -- Abort_Undefer;
kono
parents:
diff changeset
52 -- or if back-end exception:
kono
parents:
diff changeset
53 -- when others =>
kono
parents:
diff changeset
54 -- null;
kono
parents:
diff changeset
55 -- This is an exception handler to stop propagation of aborts, without
kono
parents:
diff changeset
56 -- modifying the deferal level.
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 function Build_B
kono
parents:
diff changeset
59 (Loc : Source_Ptr;
kono
parents:
diff changeset
60 Decls : List_Id) return Entity_Id;
kono
parents:
diff changeset
61 -- Generate:
kono
parents:
diff changeset
62 -- B : Boolean := False;
kono
parents:
diff changeset
63 -- Append the object declaration to the list and return its defining
kono
parents:
diff changeset
64 -- identifier.
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 function Build_C
kono
parents:
diff changeset
67 (Loc : Source_Ptr;
kono
parents:
diff changeset
68 Decls : List_Id) return Entity_Id;
kono
parents:
diff changeset
69 -- Generate:
kono
parents:
diff changeset
70 -- C : Ada.Tags.Prim_Op_Kind;
kono
parents:
diff changeset
71 -- Append the object declaration to the list and return its defining
kono
parents:
diff changeset
72 -- identifier.
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 function Build_Cleanup_Block
kono
parents:
diff changeset
75 (Loc : Source_Ptr;
kono
parents:
diff changeset
76 Blk_Ent : Entity_Id;
kono
parents:
diff changeset
77 Stmts : List_Id;
kono
parents:
diff changeset
78 Clean_Ent : Entity_Id) return Node_Id;
kono
parents:
diff changeset
79 -- Generate:
kono
parents:
diff changeset
80 -- declare
kono
parents:
diff changeset
81 -- procedure _clean is
kono
parents:
diff changeset
82 -- begin
kono
parents:
diff changeset
83 -- ...
kono
parents:
diff changeset
84 -- end _clean;
kono
parents:
diff changeset
85 -- begin
kono
parents:
diff changeset
86 -- Stmts
kono
parents:
diff changeset
87 -- at end
kono
parents:
diff changeset
88 -- _clean;
kono
parents:
diff changeset
89 -- end;
kono
parents:
diff changeset
90 -- Blk_Ent is the name of the generated block, Stmts is the list of
kono
parents:
diff changeset
91 -- encapsulated statements and Clean_Ent is the parameter to the
kono
parents:
diff changeset
92 -- _clean procedure.
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 function Build_K
kono
parents:
diff changeset
95 (Loc : Source_Ptr;
kono
parents:
diff changeset
96 Decls : List_Id;
kono
parents:
diff changeset
97 Obj : Entity_Id) return Entity_Id;
kono
parents:
diff changeset
98 -- Generate
kono
parents:
diff changeset
99 -- K : Ada.Tags.Tagged_Kind :=
kono
parents:
diff changeset
100 -- Ada.Tags.Get_Tagged_Kind (Ada.Tags.Tag (Obj));
kono
parents:
diff changeset
101 -- where Obj is the pointer to a secondary table. Append the object
kono
parents:
diff changeset
102 -- declaration to the list and return its defining identifier.
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 function Build_S
kono
parents:
diff changeset
105 (Loc : Source_Ptr;
kono
parents:
diff changeset
106 Decls : List_Id) return Entity_Id;
kono
parents:
diff changeset
107 -- Generate:
kono
parents:
diff changeset
108 -- S : Integer;
kono
parents:
diff changeset
109 -- Append the object declaration to the list and return its defining
kono
parents:
diff changeset
110 -- identifier.
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 function Build_S_Assignment
kono
parents:
diff changeset
113 (Loc : Source_Ptr;
kono
parents:
diff changeset
114 S : Entity_Id;
kono
parents:
diff changeset
115 Obj : Entity_Id;
kono
parents:
diff changeset
116 Call_Ent : Entity_Id) return Node_Id;
kono
parents:
diff changeset
117 -- Generate:
kono
parents:
diff changeset
118 -- S := Ada.Tags.Get_Offset_Index (
kono
parents:
diff changeset
119 -- Ada.Tags.Tag (Obj), DT_Position (Call_Ent));
kono
parents:
diff changeset
120 -- where Obj is the pointer to a secondary table, Call_Ent is the entity
kono
parents:
diff changeset
121 -- of the dispatching call name. Return the generated assignment.
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 end Exp_Sel;