FSF GCC merge 02/23/03
[official-gcc.git] / gcc / ada / exp_disp.ads
blob1f9c73b358cd0b5b39b3a09450aed0465ddade1b
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E X P _ D I S P --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 -- --
26 ------------------------------------------------------------------------------
28 -- This package contains routines involved in tagged types and dynamic
29 -- dispatching expansion
31 with Types; use Types;
32 package Exp_Disp is
34 type DT_Access_Action is
35 (CW_Membership,
36 DT_Entry_Size,
37 DT_Prologue_Size,
38 Get_Expanded_Name,
39 Get_External_Tag,
40 Get_Prim_Op_Address,
41 Get_RC_Offset,
42 Get_Remotely_Callable,
43 Get_TSD,
44 Inherit_DT,
45 Inherit_TSD,
46 Register_Tag,
47 Set_Expanded_Name,
48 Set_External_Tag,
49 Set_Prim_Op_Address,
50 Set_RC_Offset,
51 Set_Remotely_Callable,
52 Set_TSD,
53 TSD_Entry_Size,
54 TSD_Prologue_Size);
56 function Fill_DT_Entry
57 (Loc : Source_Ptr;
58 Prim : Entity_Id)
59 return Node_Id;
60 -- Generate the code necessary to fill the appropriate entry of the
61 -- dispatch table of Prim's controlling type with Prim's address.
63 function Make_DT_Access_Action
64 (Typ : Entity_Id;
65 Action : DT_Access_Action;
66 Args : List_Id)
67 return Node_Id;
68 -- Generate a call to one of the Dispatch Table Access Subprograms defined
69 -- in Ada.Tags or in Interfaces.Cpp
71 function Make_DT (Typ : Entity_Id) return List_Id;
72 -- Expand the declarations for the Dispatch Table (or the Vtable in
73 -- the case of type whose ancestor is a CPP_Class)
75 procedure Set_All_DT_Position (Typ : Entity_Id);
76 -- Set the DT_Position field for each primitive operation. In the CPP
77 -- Class case check that no pragma CPP_Virtual is missing and that the
78 -- DT_Position are coherent
80 procedure Expand_Dispatch_Call (Call_Node : Node_Id);
81 -- Expand the call to the operation through the dispatch table and perform
82 -- the required tag checks when appropriate. For CPP types the call is
83 -- done through the Vtable (tag checks are not relevant)
85 procedure Set_Default_Constructor (Typ : Entity_Id);
86 -- Typ is a CPP_Class type. Create the Init procedure of that type to
87 -- be the default constructor (i.e. the function returning this type,
88 -- having a pragma CPP_Constructor and no parameter)
90 function Get_Remotely_Callable (Obj : Node_Id) return Node_Id;
91 -- Return an expression that holds True if the object can be transmitted
92 -- onto another partition according to E.4 (18)
94 end Exp_Disp;