1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
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. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- Semantic processing for distribution annex facilities
29 with Snames; use Snames;
30 with Types; use Types;
34 function Get_PCS_Name return PCS_Names;
35 -- Return the name of a literal of type System.Partition_Interface.
36 -- DSA_Implementation_Type indicating what PCS is currently in use.
38 function Get_PCS_Version return Int;
39 -- Return the version number of the PCS API implemented by the PCS.
40 -- The consistency of this version with the one expected by Exp_Dist
41 -- (Gnatvsn.PCS_Version_Number) in Rtsfind.Check_RPC.
42 -- If no PCS version information is available, 0 is returned.
44 procedure Add_Stub_Constructs (N : Node_Id);
45 -- Create the stubs constructs for a remote call interface package
46 -- specification or body or for a shared passive specification. For caller
47 -- stubs, expansion takes place directly in the specification and no
48 -- additional compilation unit is created.
50 function Build_RAS_Primitive_Specification
52 Remote_Object_Type : Node_Id) return Node_Id;
53 -- Build a subprogram specification for the primitive operation of the
54 -- Remote_Object_Type used to implement a remote access-to-subprogram
55 -- type whose parameter profile is given by specification Subp_Spec.
57 function Is_All_Remote_Call (N : Node_Id) return Boolean;
58 -- Check whether a function or procedure call should be expanded into
59 -- a remote call, because the entity is declared in a package decl that
60 -- is not currently in scope, and the proper pragmas apply.
62 procedure Process_Partition_Id (N : Node_Id);
63 -- Replace attribute reference with call to runtime function. The result
64 -- is converted to the context type, because the attribute yields a
65 -- universal integer value.
67 procedure Process_Remote_AST_Attribute (N : Node_Id; New_Type : Entity_Id);
68 -- Given N, an access attribute reference node whose prefix is a
69 -- remote subprogram, rewrite N with a call to a conversion function
70 -- whose return type is New_Type.
72 procedure Process_Remote_AST_Declaration (N : Node_Id);
73 -- Given N, an access to subprogram type declaration node in RCI or remote
74 -- types unit, build a new record (fat pointer) type declaration using the
75 -- old Defining_Identifier of N and a link to the old declaration node N
76 -- whose Defining_Identifier is changed. We also construct declarations of
77 -- two subprograms in the unit specification which handle remote access to
78 -- subprogram type (fat pointer) dereference and the unit receiver that
79 -- handles remote calls (from remote access to subprogram type values.)
81 function Remote_AST_E_Dereference (P : Node_Id) return Boolean;
82 -- If the prefix of an explicit dereference is a record type that
83 -- represent the fat pointer for an Remote access to subprogram, in the
84 -- context of a call, rewrite the enclosing call node into remote call,
85 -- the first actual of which is the fat pointer. Return true if the
86 -- context is correct and the transformation took place.
88 function Remote_AST_I_Dereference (P : Node_Id) return Boolean;
89 -- If P is a record type that represents the fat pointer for a remote
90 -- access to subprogram, and P is the prefix of a call, insert an explicit
91 -- dereference and perform the transformation described for the previous
94 function Remote_AST_Null_Value
96 Typ : Entity_Id) return Boolean;
97 -- If N is a null value and Typ a remote access to subprogram type, this
98 -- function will check if null needs to be replaced with an aggregate and
99 -- will return True in this case. Otherwise, it will return False.
101 function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id;
102 -- Return the N_Package_Specification corresponding to a scope E