OSDN Git Service

Daily bump.
[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 --                                                                          --
10 --          Copyright (C) 1992-2000 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- GNAT was originally developed  by the GNAT team at  New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
25 --                                                                          --
26 ------------------------------------------------------------------------------
27
28 --  Semantic processing for distribution annex facilities
29
30 with Types; use Types;
31
32 package Sem_Dist is
33
34    procedure Add_Stub_Constructs (N : Node_Id);
35    --  Create the stubs constructs for a remote call interface package
36    --  specification or body or for a shared passive specification. For
37    --  caller stubs, expansion takes place directly in the specification and
38    --  no additional compilation unit is created.
39
40    function Is_All_Remote_Call (N : Node_Id) return Boolean;
41    --  Check whether a function or procedure call should be expanded into
42    --  a remote call, because the entity is declared in a package decl that
43    --  is not currently in scope, and the proper pragmas apply.
44
45    procedure Process_Partition_Id (N : Node_Id);
46    --  Replace attribute reference with call to runtime function. The result
47    --  is converted to the context type, because the attribute yields a
48    --  universal integer value.
49
50    procedure Process_Remote_AST_Attribute (N : Node_Id; New_Type : Entity_Id);
51    --  Given N, an access attribute reference node whose prefix is a
52    --  remote subprogram, rewrite N with a call to a conversion function
53    --  whose return type is New_Type.
54
55    procedure Process_Remote_AST_Declaration (N : Node_Id);
56    --  Given N, an access to subprogram type declaration node in RCI or
57    --  remote types unit, build a new record (fat pointer) type declaration
58    --  using the old Defining_Identifier of N and a link to the old
59    --  declaration node N whose Defining_Identifier is changed.
60    --  We also construct declarations of two subprograms in the unit
61    --  specification which handle remote access to subprogram type
62    --  (fat pointer) dereference and the unit receiver that handles
63    --  remote calls (from remote access to subprogram type values.)
64
65    function Remote_AST_E_Dereference (P : Node_Id) return Boolean;
66    --  If the prefix of an explicit dereference is a record type that
67    --  represent the fat pointer for an Remote access to subprogram, in
68    --  the context of a call, rewrite the enclosing call node into a
69    --  remote call, the first actual of which is the fat pointer. Return
70    --  true if the context is correct and the transformation took place.
71
72    function Remote_AST_I_Dereference (P : Node_Id) return Boolean;
73    --  If P is a record type that represents the fat pointer for a remote
74    --  access to subprogram, and P is the prefix of a call, insert an
75    --  explicit dereference and perform the transformation described for
76    --  the previous function.
77
78    function Remote_AST_Null_Value
79      (N    : Node_Id;
80       Typ  : Entity_Id)
81       return Boolean;
82    --  If N is a null value and Typ a remote access to subprogram type,
83    --  this function will check if null needs to be replaced with an
84    --  aggregate and will return True in this case. Otherwise, it will
85    --  return False.
86
87    function Get_Subprogram_Id (E : Entity_Id) return Int;
88    --  Given a subprogram defined in a RCI package, get its subprogram id
89    --  which will be used for remote calls.
90
91    function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id;
92    --  Return the N_Package_Specification corresponding to a scope E
93
94 end Sem_Dist;