OSDN Git Service

2006-02-13 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_dist.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             E X P _ D I S T                              --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2006, 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 --  This package contains utility routines used for the generation of the
28 --  stubs relevant to the distribution annex.
29
30 with Types; use Types;
31
32 package Exp_Dist is
33
34    procedure Add_RAST_Features (Vis_Decl : Node_Id);
35    --  Build and add bodies for dereference and 'Access subprograms for a
36    --  remote access to subprogram type. Vis_Decl is the declaration node for
37    --  the RAS type.
38
39    procedure Add_RACW_Features (RACW_Type : Entity_Id);
40    --  Add RACW features. If the RACW and the designated type are not in the
41    --  same scope, then Add_RACW_Primitive_Declarations_And_Bodies is called
42    --  automatically since we do know the primitive list already.
43
44    procedure Add_RACW_Primitive_Declarations_And_Bodies
45      (Designated_Type : Entity_Id;
46       Insertion_Node  : Node_Id;
47       Decls           : List_Id);
48    --  Add primitive for the stub type, and the RPC receiver. The declarations
49    --  are inserted after insertion_Node, while the bodies are appened at the
50    --  end of Decls.
51
52    procedure Remote_Types_Tagged_Full_View_Encountered
53      (Full_View : Entity_Id);
54    --  When a full view with a private view is encountered in a Remote_Types
55    --  package and corresponds to a tagged type, then this procedure is called
56    --  to generate the needed RACW features if it is needed.
57
58    procedure RACW_Type_Is_Asynchronous (RACW_Type : Entity_Id);
59    --  This subprogram must be called when it is detected that the RACW type
60    --  is asynchronous.
61
62    procedure Expand_Calling_Stubs_Bodies (Unit_Node : Node_Id);
63    --  Call the expansion phase for the calling stubs. The code will be added
64    --  at the end of the compilation unit, which is a package spec.
65
66    procedure Expand_Receiving_Stubs_Bodies (Unit_Node : Node_Id);
67    --  Call the expansion phase for the calling stubs. The code will be added
68    --  at the end of the compilation unit, which may be either a package spec
69    --  or a package body.
70
71    procedure Expand_All_Calls_Remote_Subprogram_Call (N : Node_Id);
72    --  Rewrite a call to a subprogram located in a Remote_Call_Interface
73    --  package on which the pragma All_Calls_Remote applies so that it
74    --  goes through the PCS. N is either an N_Procedure_Call_Statement
75    --  or an N_Function_Call node.
76
77    procedure Build_Passive_Partition_Stub (U : Node_Id);
78    --  Build stub for a shared passive package. U is the analyzed
79    --  compilation unit for a package declaration.
80
81    function Build_Subprogram_Id
82      (Loc : Source_Ptr;
83       E   : Entity_Id) return Node_Id;
84    --  Build a literal representing the remote subprogram identifier of E
85
86    function Copy_Specification
87      (Loc         : Source_Ptr;
88       Spec        : Node_Id;
89       Object_Type : Entity_Id := Empty;
90       Stub_Type   : Entity_Id := Empty;
91       New_Name    : Name_Id   := No_Name) return Node_Id;
92    --  Build a subprogram specification from another one, or from
93    --  an access-to-subprogram definition. If Object_Type is not Empty
94    --  and any access to Object_Type is found, then it is replaced by an
95    --  access to Stub_Type. If New_Name is given, then it will be used as
96    --  the name for the newly created spec.
97
98    function Underlying_RACW_Type
99      (RAS_Typ : Entity_Id) return Entity_Id;
100    --  Given a remote access-to-subprogram type or its equivalent
101    --  record type, return the RACW type generated to implement it.
102
103 end Exp_Dist;