OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [ada/] [sem_aux.ads] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 281 jeremybenn
------------------------------------------------------------------------------
2
--                                                                          --
3
--                         GNAT COMPILER COMPONENTS                         --
4
--                                                                          --
5
--                              S E M _ A U X                               --
6
--                                                                          --
7
--                                 S p e c                                  --
8
--                                                                          --
9
--          Copyright (C) 1992-2009, 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
-- As a special exception,  if other files  instantiate  generics from this --
22
-- unit, or you link  this unit with other files  to produce an executable, --
23
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
24
-- covered  by the  GNU  General  Public  License.  This exception does not --
25
-- however invalidate  any other reasons why  the executable file  might be --
26
-- covered by the  GNU Public License.                                      --
27
--                                                                          --
28
-- GNAT was originally developed  by the GNAT team at  New York University. --
29
-- Extensive contributions were provided by Ada Core Technologies Inc.      --
30
--                                                                          --
31
------------------------------------------------------------------------------
32
 
33
--  Package containing utility procedures used throughout the compiler,
34
--  and also by ASIS so dependencies are limited to ASIS included packages.
35
 
36
--  Historical note. Many of the routines here were originally in Einfo, but
37
--  Einfo is supposed to be a relatively low level package dealing with the
38
--  content of entities in the tree, so this package is used for routines that
39
--  require more than minimal semantic knowledge.
40
 
41
with Alloc; use Alloc;
42
with Table;
43
with Types; use Types;
44
 
45
package Sem_Aux is
46
 
47
   --------------------------------
48
   -- Obsolescent Warnings Table --
49
   --------------------------------
50
 
51
   --  This table records entities for which a pragma Obsolescent with a
52
   --  message argument has been processed.
53
 
54
   type OWT_Record is record
55
      Ent : Entity_Id;
56
      --  The entity to which the pragma applies
57
 
58
      Msg : String_Id;
59
      --  The string containing the message
60
   end record;
61
 
62
   package Obsolescent_Warnings is new Table.Table (
63
     Table_Component_Type => OWT_Record,
64
     Table_Index_Type     => Int,
65
     Table_Low_Bound      => 0,
66
     Table_Initial        => Alloc.Obsolescent_Warnings_Initial,
67
     Table_Increment      => Alloc.Obsolescent_Warnings_Increment,
68
     Table_Name           => "Obsolescent_Warnings");
69
 
70
   procedure Initialize;
71
   --  Called at the start of compilation of each new main source file to
72
   --  initialize the allocation of the Obsolescent_Warnings table. Note that
73
   --  Initialize must not be called if Tree_Read is used.
74
 
75
   procedure Tree_Read;
76
   --  Initializes Obsolescent_Warnings table from current tree file using the
77
   --  relevant Table.Tree_Read routine.
78
 
79
   procedure Tree_Write;
80
   --  Writes out Obsolescent_Warnings table to current tree file using the
81
   --  relevant Table.Tree_Write routine.
82
 
83
   -----------------
84
   -- Subprograms --
85
   -----------------
86
 
87
   function Ancestor_Subtype (Typ : Entity_Id) return Entity_Id;
88
   --  The argument Id is a type or subtype entity. If the argument is a
89
   --  subtype then it returns the subtype or type from which the subtype was
90
   --  obtained, otherwise it returns Empty.
91
 
92
   function Available_View (Typ : Entity_Id) return Entity_Id;
93
   --  Typ is typically a type that has the With_Type flag set. Returns the
94
   --  non-limited view of the type, if available, otherwise the type itself.
95
   --  For class-wide types, there is no direct link in the tree, so we have
96
   --  to retrieve the class-wide type of the non-limited view of the Etype.
97
   --  Returns the argument unchanged if it is not one of these cases.
98
 
99
   function Constant_Value (Ent : Entity_Id) return Node_Id;
100
   --  Id is a variable, constant, named integer, or named real entity. This
101
   --  call obtains the initialization expression for the entity. Will return
102
   --  Empty for for a deferred constant whose full view is not available or
103
   --  in some other cases of internal entities, which cannot be treated as
104
   --  constants from the point of view of constant folding. Empty is also
105
   --  returned for variables with no initialization expression.
106
 
107
   function Enclosing_Dynamic_Scope (Ent : Entity_Id) return Entity_Id;
108
   --  For any entity, Ent, returns the closest dynamic scope in which the
109
   --  entity is declared or Standard_Standard for library-level entities
110
 
111
   function First_Discriminant (Typ : Entity_Id) return Entity_Id;
112
   --  Typ is a type with discriminants. The discriminants are the first
113
   --  entities declared in the type, so normally this is equivalent to
114
   --  First_Entity. The exception arises for tagged types, where the tag
115
   --  itself is prepended to the front of the entity chain, so the
116
   --  First_Discriminant function steps past the tag if it is present.
117
 
118
   function First_Stored_Discriminant (Typ : Entity_Id) return Entity_Id;
119
   --  Typ is a type with discriminants. Gives the first discriminant stored
120
   --  in an object of this type. In many cases, these are the same as the
121
   --  normal visible discriminants for the type, but in the case of renamed
122
   --  discriminants, this is not always the case.
123
   --
124
   --  For tagged types, and untagged types which are root types or derived
125
   --  types but which do not rename discriminants in their root type, the
126
   --  stored discriminants are the same as the actual discriminants of the
127
   --  type, and hence this function is the same as First_Discriminant.
128
   --
129
   --  For derived non-tagged types that rename discriminants in the root type
130
   --  this is the first of the discriminants that occur in the root type. To
131
   --  be precise, in this case stored discriminants are entities attached to
132
   --  the entity chain of the derived type which are a copy of the
133
   --  discriminants of the root type. Furthermore their Is_Completely_Hidden
134
   --  flag is set since although they are actually stored in the object, they
135
   --  are not in the set of discriminants that is visble in the type.
136
   --
137
   --  For derived untagged types, the set of stored discriminants are the real
138
   --  discriminants from Gigi's standpoint, i.e. those that will be stored in
139
   --  actual objects of the type.
140
 
141
   function First_Subtype (Typ : Entity_Id) return Entity_Id;
142
   --  Applies to all types and subtypes. For types, yields the first subtype
143
   --  of the type. For subtypes, yields the first subtype of the base type of
144
   --  the subtype.
145
 
146
   function First_Tag_Component (Typ : Entity_Id) return Entity_Id;
147
   --  Typ must be a tagged record type. This function returns the Entity for
148
   --  the first _Tag field in the record type.
149
 
150
   function Is_By_Copy_Type (Ent : Entity_Id) return Boolean;
151
   --  Ent is any entity. Returns True if Ent is a type entity where the type
152
   --  is required to be passed by copy, as defined in (RM 6.2(3)).
153
 
154
   function Is_By_Reference_Type (Ent : Entity_Id) return Boolean;
155
   --  Ent is any entity. Returns True if Ent is a type entity where the type
156
   --  is required to be passed by reference, as defined in (RM 6.2(4-9)).
157
 
158
   function Is_Derived_Type (Ent : Entity_Id) return Boolean;
159
   --  Determines if the given entity Ent is a derived type. Result is always
160
   --  false if argument is not a type.
161
 
162
   function Is_Indefinite_Subtype (Ent : Entity_Id) return Boolean;
163
   --  Ent is any entity. Determines if given entity is an unconstrained array
164
   --  type or subtype, a discriminated record type or subtype with no initial
165
   --  discriminant values or a class wide type or subtype and returns True if
166
   --  so. False for other type entities, or any entities that are not types.
167
 
168
   function Is_Inherently_Limited_Type (Ent : Entity_Id) return Boolean;
169
   --  Ent is any entity. True for a type that is "inherently" limited (i.e.
170
   --  cannot become nonlimited). From the Ada 2005 RM-7.5(8.1/2), "a type with
171
   --  a part that is of a task, protected, or explicitly limited record type".
172
   --  These are the types that are defined as return-by-reference types in Ada
173
   --  95 (see RM95-6.5(11-16)). In Ada 2005, these are the types that require
174
   --  build-in-place for function calls. Note that build-in-place is allowed
175
   --  for other types, too.
176
 
177
   function Is_Limited_Type (Ent : Entity_Id) return Boolean;
178
   --  Ent is any entity. Returns true if Ent is a limited type (limited
179
   --  private type, limited interface type, task type, protected type,
180
   --  composite containing a limited component, or a subtype of any of
181
   --  these types).
182
 
183
   function Nearest_Dynamic_Scope (Ent : Entity_Id) return Entity_Id;
184
   --  This is similar to Enclosing_Dynamic_Scope except that if Ent is itself
185
   --  a dynamic scope, then it is returned. Otherwise the result is the same
186
   --  as that returned by Enclosing_Dynamic_Scope.
187
 
188
   function Next_Tag_Component (Tag : Entity_Id) return Entity_Id;
189
   --  Tag must be an entity representing a _Tag field of a tagged record.
190
   --  The result returned is the next _Tag field in this record, or Empty
191
   --  if this is the last such field.
192
 
193
   function Number_Discriminants (Typ : Entity_Id) return Pos;
194
   --  Typ is a type with discriminants, yields number of discriminants in type
195
 
196
end Sem_Aux;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.