2003-05-31 Bud Davis <bdavis9659@comcast.net>
[official-gcc.git] / gcc / ada / sem_dist.ads
blob1ce18bfe9a63850592594083b1d4bbd0da60b1da
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S E M _ D I S T --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2000 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 -- Semantic processing for distribution annex facilities
29 with Types; use Types;
31 package Sem_Dist is
33 procedure Add_Stub_Constructs (N : Node_Id);
34 -- Create the stubs constructs for a remote call interface package
35 -- specification or body or for a shared passive specification. For
36 -- caller stubs, expansion takes place directly in the specification and
37 -- no additional compilation unit is created.
39 function Is_All_Remote_Call (N : Node_Id) return Boolean;
40 -- Check whether a function or procedure call should be expanded into
41 -- a remote call, because the entity is declared in a package decl that
42 -- is not currently in scope, and the proper pragmas apply.
44 procedure Process_Partition_Id (N : Node_Id);
45 -- Replace attribute reference with call to runtime function. The result
46 -- is converted to the context type, because the attribute yields a
47 -- universal integer value.
49 procedure Process_Remote_AST_Attribute (N : Node_Id; New_Type : Entity_Id);
50 -- Given N, an access attribute reference node whose prefix is a
51 -- remote subprogram, rewrite N with a call to a conversion function
52 -- whose return type is New_Type.
54 procedure Process_Remote_AST_Declaration (N : Node_Id);
55 -- Given N, an access to subprogram type declaration node in RCI or
56 -- remote types unit, build a new record (fat pointer) type declaration
57 -- using the old Defining_Identifier of N and a link to the old
58 -- declaration node N whose Defining_Identifier is changed.
59 -- We also construct declarations of two subprograms in the unit
60 -- specification which handle remote access to subprogram type
61 -- (fat pointer) dereference and the unit receiver that handles
62 -- remote calls (from remote access to subprogram type values.)
64 function Remote_AST_E_Dereference (P : Node_Id) return Boolean;
65 -- If the prefix of an explicit dereference is a record type that
66 -- represent the fat pointer for an Remote access to subprogram, in
67 -- the context of a call, rewrite the enclosing call node into a
68 -- remote call, the first actual of which is the fat pointer. Return
69 -- true if the context is correct and the transformation took place.
71 function Remote_AST_I_Dereference (P : Node_Id) return Boolean;
72 -- If P is a record type that represents the fat pointer for a remote
73 -- access to subprogram, and P is the prefix of a call, insert an
74 -- explicit dereference and perform the transformation described for
75 -- the previous function.
77 function Remote_AST_Null_Value
78 (N : Node_Id;
79 Typ : Entity_Id)
80 return Boolean;
81 -- If N is a null value and Typ a remote access to subprogram type,
82 -- this function will check if null needs to be replaced with an
83 -- aggregate and will return True in this case. Otherwise, it will
84 -- return False.
86 function Get_Subprogram_Id (E : Entity_Id) return Int;
87 -- Given a subprogram defined in a RCI package, get its subprogram id
88 -- which will be used for remote calls.
90 function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id;
91 -- Return the N_Package_Specification corresponding to a scope E
93 end Sem_Dist;