Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / ada / exp_disp.ads
blob34bcffc5c592a94e039748d2670c10aacda5e9b3
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E X P _ D I S P --
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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, 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 ------------------------------------------------------------------------------
27 -- This package contains routines involved in tagged types and dynamic
28 -- dispatching expansion
30 with Types; use Types;
31 package Exp_Disp is
33 type DT_Access_Action is
34 (CW_Membership,
35 DT_Entry_Size,
36 DT_Prologue_Size,
37 Get_Expanded_Name,
38 Get_External_Tag,
39 Get_Prim_Op_Address,
40 Get_RC_Offset,
41 Get_Remotely_Callable,
42 Get_TSD,
43 Inherit_DT,
44 Inherit_TSD,
45 Register_Tag,
46 Set_Expanded_Name,
47 Set_External_Tag,
48 Set_Prim_Op_Address,
49 Set_RC_Offset,
50 Set_Remotely_Callable,
51 Set_TSD,
52 TSD_Entry_Size,
53 TSD_Prologue_Size);
55 function Fill_DT_Entry
56 (Loc : Source_Ptr;
57 Prim : Entity_Id)
58 return Node_Id;
59 -- Generate the code necessary to fill the appropriate entry of the
60 -- dispatch table of Prim's controlling type with Prim's address.
62 function Make_DT_Access_Action
63 (Typ : Entity_Id;
64 Action : DT_Access_Action;
65 Args : List_Id)
66 return Node_Id;
67 -- Generate a call to one of the Dispatch Table Access Subprograms defined
68 -- in Ada.Tags or in Interfaces.Cpp
70 function Make_DT (Typ : Entity_Id) return List_Id;
71 -- Expand the declarations for the Dispatch Table (or the Vtable in
72 -- the case of type whose ancestor is a CPP_Class)
74 procedure Set_All_DT_Position (Typ : Entity_Id);
75 -- Set the DT_Position field for each primitive operation. In the CPP
76 -- Class case check that no pragma CPP_Virtual is missing and that the
77 -- DT_Position are coherent
79 procedure Expand_Dispatching_Call (Call_Node : Node_Id);
80 -- Expand the call to the operation through the dispatch table and perform
81 -- the required tag checks when appropriate. For CPP types the call is
82 -- done through the Vtable (tag checks are not relevant)
84 procedure Set_Default_Constructor (Typ : Entity_Id);
85 -- Typ is a CPP_Class type. Create the Init procedure of that type to
86 -- be the default constructor (i.e. the function returning this type,
87 -- having a pragma CPP_Constructor and no parameter)
89 function Get_Remotely_Callable (Obj : Node_Id) return Node_Id;
90 -- Return an expression that holds True if the object can be transmitted
91 -- onto another partition according to E.4 (18)
93 end Exp_Disp;