OSDN Git Service

2005-03-08 Geert Bosch <bosch@adacore.com>
[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-2004 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 ------------------------------------------------------------------------------
26
27 --  Semantic processing for distribution annex facilities
28
29 with Types; use Types;
30
31 package Sem_Dist is
32
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.
38
39    function Build_RAS_Primitive_Specification
40      (Subp_Spec          : Node_Id;
41       Remote_Object_Type : Node_Id) return Node_Id;
42    --  Build a subprogram specification for the primitive operation of the
43    --  Remote_Object_Type used to implement a remote access-to-subprogram
44    --  type whose parameter profile is given by specification Subp_Spec.
45
46    function Is_All_Remote_Call (N : Node_Id) return Boolean;
47    --  Check whether a function or procedure call should be expanded into
48    --  a remote call, because the entity is declared in a package decl that
49    --  is not currently in scope, and the proper pragmas apply.
50
51    procedure Process_Partition_Id (N : Node_Id);
52    --  Replace attribute reference with call to runtime function. The result
53    --  is converted to the context type, because the attribute yields a
54    --  universal integer value.
55
56    procedure Process_Remote_AST_Attribute (N : Node_Id; New_Type : Entity_Id);
57    --  Given N, an access attribute reference node whose prefix is a
58    --  remote subprogram, rewrite N with a call to a conversion function
59    --  whose return type is New_Type.
60
61    procedure Process_Remote_AST_Declaration (N : Node_Id);
62    --  Given N, an access to subprogram type declaration node in RCI or
63    --  remote types unit, build a new record (fat pointer) type declaration
64    --  using the old Defining_Identifier of N and a link to the old
65    --  declaration node N whose Defining_Identifier is changed.
66    --  We also construct declarations of two subprograms in the unit
67    --  specification which handle remote access to subprogram type
68    --  (fat pointer) dereference and the unit receiver that handles
69    --  remote calls (from remote access to subprogram type values.)
70
71    function Remote_AST_E_Dereference (P : Node_Id) return Boolean;
72    --  If the prefix of an explicit dereference is a record type that
73    --  represent the fat pointer for an Remote access to subprogram, in
74    --  the context of a call, rewrite the enclosing call node into a
75    --  remote call, the first actual of which is the fat pointer. Return
76    --  true if the context is correct and the transformation took place.
77
78    function Remote_AST_I_Dereference (P : Node_Id) return Boolean;
79    --  If P is a record type that represents the fat pointer for a remote
80    --  access to subprogram, and P is the prefix of a call, insert an
81    --  explicit dereference and perform the transformation described for
82    --  the previous function.
83
84    function Remote_AST_Null_Value
85      (N   : Node_Id;
86       Typ : Entity_Id) return Boolean;
87    --  If N is a null value and Typ a remote access to subprogram type,
88    --  this function will check if null needs to be replaced with an
89    --  aggregate and will return True in this case. Otherwise, it will
90    --  return False.
91
92    function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id;
93    --  Return the N_Package_Specification corresponding to a scope E
94
95 end Sem_Dist;