OSDN Git Service

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