OSDN Git Service

PR c++/27714
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_sel.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                              E X P _ S E L                               --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2005, Free Software Foundation, Inc.         --
10 --                                                                          --
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,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, USA.                                              --
21 --                                                                          --
22 -- GNAT was originally developed  by the GNAT team at  New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 --  Routines used in Chapter 9 for the expansion of dispatching triggers in
28 --  select statements (Ada 2005: AI-345)
29
30 with Types; use Types;
31
32 package Exp_Sel is
33
34    function Build_Abort_Block
35      (Loc         : Source_Ptr;
36       Abr_Blk_Ent : Entity_Id;
37       Cln_Blk_Ent : Entity_Id;
38       Blk         : Node_Id) return Node_Id;
39    --  Generate:
40    --    begin
41    --       Blk
42    --    exception
43    --       when Abort_Signal => Abort_Undefer;
44    --    end;
45    --  Abr_Blk_Ent is the name of the generated block, Cln_Blk_Ent is the name
46    --  of the encapsulated cleanup block, Blk is the actual block name.
47
48    function Build_B
49      (Loc   : Source_Ptr;
50       Decls : List_Id) return Entity_Id;
51    --  Generate:
52    --    B : Boolean := False;
53    --  Append the object declaration to the list and return its defining
54    --  identifier.
55
56    function Build_C
57      (Loc   : Source_Ptr;
58       Decls : List_Id) return Entity_Id;
59    --  Generate:
60    --    C : Ada.Tags.Prim_Op_Kind;
61    --  Append the object declaration to the list and return its defining
62    --  identifier.
63
64    function Build_Cleanup_Block
65      (Loc       : Source_Ptr;
66       Blk_Ent   : Entity_Id;
67       Stmts     : List_Id;
68       Clean_Ent : Entity_Id) return Node_Id;
69    --  Generate:
70    --    declare
71    --       procedure _clean is
72    --       begin
73    --          ...
74    --       end _clean;
75    --    begin
76    --       Stmts
77    --    at end
78    --       _clean;
79    --    end;
80    --  Blk_Ent is the name of the generated block, Stmts is the list of
81    --  encapsulated statements and Clean_Ent is the parameter to the
82    --  _clean procedure.
83
84    function Build_K
85      (Loc   : Source_Ptr;
86       Decls : List_Id;
87       Obj   : Entity_Id) return Entity_Id;
88    --  Generate
89    --    K : Ada.Tags.Tagged_Kind :=
90    --          Ada.Tags.Get_Tagged_Kind (Ada.Tags.Tag (Obj));
91    --  where Obj is the pointer to a secondary table. Append the object
92    --  declaration to the list and return its defining identifier.
93
94    function Build_S
95      (Loc  : Source_Ptr;
96       Decls : List_Id) return Entity_Id;
97    --  Generate:
98    --    S : Integer;
99    --  Append the object declaration to the list and return its defining
100    --  identifier.
101
102    function Build_S_Assignment
103      (Loc      : Source_Ptr;
104       S        : Entity_Id;
105       Obj      : Entity_Id;
106       Call_Ent : Entity_Id) return Node_Id;
107    --  Generate:
108    --    S := Ada.Tags.Get_Offset_Index (
109    --           Ada.Tags.Tag (Obj), DT_Position (Call_Ent));
110    --  where Obj is the pointer to a secondary table, Call_Ent is the entity
111    --  of the dispatching call name. Return the generated assignment.
112
113 end Exp_Sel;