summaryrefslogtreecommitdiff
path: root/gcc/ada/einfo.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/einfo.ads')
-rw-r--r--gcc/ada/einfo.ads146
1 files changed, 90 insertions, 56 deletions
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 804900b2ca2..f9dda49eb66 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -6,9 +6,9 @@
-- --
-- S p e c --
-- --
--- $Revision: 1.6 $
+-- $Revision: 1.654 $
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -33,6 +33,7 @@
-- --
------------------------------------------------------------------------------
+with Snames; use Snames;
with Types; use Types;
with Uintp; use Uintp;
with Urealp; use Urealp;
@@ -270,17 +271,18 @@ package Einfo is
-- are so noted by the notation [base type only]. These are cases where the
-- attribute of any subtype is the same as the attribute of the base type.
-- The attribute can be referenced on a subtype (and automatically retrieves
--- the value from the base type), and if an attempt is made to set them on
--- other than a subtype, they will instead be set on the corresponding base
--- type.
+-- the value from the base type). However, it is an error to try to set the
+-- attribute on other than the base type, and if assertions are enabled,
+-- an attempt to set the attribute on a subtype will raise an assert error.
-- Other attributes are noted as applying the implementation base type only.
-- These are representation attributes which must always apply to a full
-- non-private type, and where the attributes are always on the full type.
-- The attribute can be referenced on a subtype (and automatically retries
--- the value from the implementation base type), and if an attempt is made
--- to set them on other than a subtype, they will instead be set on the
--- corresponding implementation base type.
+-- the value from the implementation base type). However, it is an error
+-- to try to set the attribute on other than the implementation base type,
+-- and if assertions are enabled, an attempt to set the attribute on a
+-- subtype will raise an assert error.
-- Accept_Address (Elist21)
-- Present in entries. If an accept has a statement sequence, then an
@@ -309,7 +311,7 @@ package Einfo is
-- rather irregular, and the semantic checks that depend on the nominal
-- subtype being unconstrained use flag Is_Constr_Subt_For_U_Nominal(qv).
--- Access_Disp_Table (Node16) [base type only]
+-- Access_Disp_Table (Node16) [implementation base type only]
-- Present in record type entities. For a tagged type, points to the
-- dispatch table associated with the tagged type. For a non-tagged
-- record, contains Empty.
@@ -367,10 +369,12 @@ package Einfo is
-- the node whose elaboration generated the Itype. This is used for
-- copying trees, to determine whether or not to copy an Itype.
--- Associated_Storage_Pool (Node22)
+-- Associated_Storage_Pool (Node22) [root type only]
-- Present in simple and general access type entities. References the
-- storage pool to be used for the corresponding collection. A value of
--- Empty means that the default pool is to be used.
+-- Empty means that the default pool is to be used. This is present
+-- only in the root type, since derived types must have the same pool
+-- as the parent type.
-- Associated_Final_Chain (Node23)
-- Present in simple and general access type entities. References the
@@ -400,7 +404,7 @@ package Einfo is
-- for finalization purposes, The block entity has an implicit label
-- declaration in the enclosing declarative part, and has otherwise
-- no direct connection in the tree with the block statement. The
--- link is to the identifier (which is an occurrence of the entity)
+-- link is to the identifier (which is an occurence of the entity)
-- and not to the block_statement itself, because the statement may
-- be rewritten, e.g. in the process of removing dead code.
@@ -511,9 +515,7 @@ package Einfo is
-- for details of these values.
-- Component_Type (Node20) [implementation base type only]
--- Present in array types and subtypes, and also in the special
--- enumeration table type created for enumeration type. References
--- the entity for the component type.
+-- Present in array types and string types. References component type.
-- Constant_Value (synthesized)
-- Applies to constants, named integers, and named reals. Obtains
@@ -1360,9 +1362,15 @@ package Einfo is
-- Pure_Function was given for the entity. In some cases, we need to
-- know that Is_Pure was explicitly set using this pragma.
+-- Has_Pragma_Unreferenced (Flag180)
+-- Present in all entities. Set if a valid pragma Unreferenced applies
+-- to the pragma, indicating that no warning should be given if the
+-- entity has no references, but a warning should be given if it is
+-- in fact referenced.
+
-- Has_Primitive_Operations (Flag120) [base type only]
-- Present in all type entities. Set if at least one primitive operation
--- is defined on the type. This flag is not yet properly set ???
+-- is defined for the type.
-- Has_Private_Ancestor (synthesized)
-- Applies to all type and subtype entities. Returns True if at least
@@ -1386,7 +1394,7 @@ package Einfo is
-- the flag Has_Fully_Qualified_Name, which is set if the name does
-- indeed include the fully qualified name.
--- Has_Record_Rep_Clause (Flag65)
+-- Has_Record_Rep_Clause (Flag65) [implementation base type only]
-- Present in record types. Set if a record representation clause has
-- been given for this record type. Used to prevent more than one such
-- clause for a given record type. Note that this is initially cleared
@@ -1412,7 +1420,7 @@ package Einfo is
-- initially cleared for a derived type, even though the Small for such
-- a type is inherited from a Small clause given for the parent type.
--- Has_Specified_Layout (Flag100)
+-- Has_Specified_Layout (Flag100) [implementation base type only]
-- Present in all type entities. Set for a record type or subtype if
-- the record layout has been specified by a record representation
-- clause. Note that this differs from the flag Has_Record_Rep_Clause
@@ -1575,7 +1583,7 @@ package Einfo is
-- Present in all type entities and in procedure entities. Set
-- if a pragma Asynchronous applies to the entity.
--- Is_Bit_Packed_Array (Flag122)
+-- Is_Bit_Packed_Array (Flag122) [implementation base type only]
-- Present in all entities. This flag is set for a packed array
-- type that is bit packed (i.e. the component size is known by the
-- front end and is in the range 1-7, 9-15, or 17-31). Is_Packed is
@@ -1718,7 +1726,8 @@ package Einfo is
-- Is_Eliminated (Flag124)
-- Present in type entities, subprogram entities, and object entities.
-- Indicates that the corresponding entity has been eliminated by use
--- of pragma Eliminate.
+-- of pragma Eliminate. Also used to mark subprogram entities whose
+-- declaration and body are within unreachable code that is removed.
-- Is_Enumeration_Type (synthesized)
-- Present in all entities, true for enumeration types and subtypes
@@ -2012,7 +2021,9 @@ package Einfo is
-- if the type appears in the Packed_Array_Type field of some other type
-- entity. It is used by Gigi to activate the special processing for such
-- types (unchecked conversions that would not otherwise be allowed are
--- allowed for such types).
+-- allowed for such types). If the Is_Packed_Array_Type flag is set in
+-- an entity, then the Original_Array_Type field of this entity points
+-- to the original array type for which this is the packed array type.
-- Is_Potentially_Use_Visible (Flag9)
-- Present in all entities. Set if entity is potentially use visible,
@@ -2251,7 +2262,9 @@ package Einfo is
-- Mechanism (Uint8) (returned as Mechanism_Type)
-- Present in functions and non-generic formal parameters. Indicates
-- the mechanism to be used for the function return or for the formal
--- parameter. See separate section on passing mechanisms.
+-- parameter. See separate section on passing mechanisms. This field
+-- is also set (to the default value of zero) in a subprogram body
+-- entity but not used in this context.
-- Modulus (Uint17) [base type only]
-- Present in modular types. Contains the modulus. For the binary
@@ -2382,7 +2395,8 @@ package Einfo is
-- Present in access types. Set if a storage size clause applies to
-- the variable with a compile time known value of zero. This flag is
-- used to generate warnings if any attempt is made to allocate an
--- instance of such an access type.
+-- instance of such an access type. This is set only in the root
+-- type, since derived types must have the same pool.
-- No_Return (Flag113)
-- Present in procedure and generic procedure entries. Indicates that
@@ -2426,6 +2440,13 @@ package Einfo is
-- Applies to subprograms and subprogram types. Yields the number of
-- formals as a value of type Pos.
+-- Original_Array_Type (Node21)
+-- Present in modular types and array types and subtypes. Set only
+-- if the Is_Packed_Array_Type flag is set, indicating that the type
+-- is the implementation type for a packed array, and in this case it
+-- points to the original array type for which this is the packed
+-- array implementation type.
+
-- Object_Ref (Node17)
-- Present in protected bodies. This is an implicit prival for the
-- Protection object associated with a protected object. See Prival
@@ -2466,7 +2487,7 @@ package Einfo is
-- Parameter_Mode (synthesized)
-- Applies to formal parameter entities. This is a synonym for Ekind,
-- used when obtaining the formal kind of a formal parameter (the result
--- is one of E_[In/Out/In_Out]_Parameter)
+-- is one of E_[In/Out/In_Out]_Paramter)
-- Parent_Subtype (Node19)
-- Present in E_Record_Type. Points to the subtype to use for a
@@ -2616,7 +2637,7 @@ package Einfo is
-- returns the result by reference, either because its return typ is a
-- by-reference-type or because it uses explicitly the secondary stack.
--- Reverse_Bit_Order (Flag164)
+-- Reverse_Bit_Order (Flag164) [base type only]
-- Present in all record type entities. Set if a valid pragma an
-- attribute represention clause for Bit_Order has reversed the order
-- of bits from the default value. When this flag is set, a component
@@ -3668,10 +3689,11 @@ package Einfo is
-- Has_Homonym (Flag56)
-- Has_Pragma_Elaborate_Body (Flag150)
-- Has_Pragma_Inline (Flag157)
+ -- Has_Pragma_Unreferenced (Flag180)
-- Has_Private_Declaration (Flag155)
-- Has_Qualified_Name (Flag161)
-- Has_Unknown_Discriminants (Flag72)
- -- Is_Bit_Packed_Array (Flag122)
+ -- Is_Bit_Packed_Array (Flag122) (base type only)
-- Is_Child_Unit (Flag73)
-- Is_Compilation_Unit (Flag149)
-- Is_Completely_Hidden (Flag103)
@@ -3745,12 +3767,12 @@ package Einfo is
-- Discard_Names (Flag88)
-- Finalize_Storage_Only (Flag158) (base type only)
-- From_With_Type (Flag159)
- -- Has_Aliased_Components (Flag135)
+ -- Has_Aliased_Components (Flag135) (base type only)
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86) (base type only)
-- Has_Complex_Representation (Flag140) (base type only)
-- Has_Discriminants (Flag5)
- -- Has_Non_Standard_Rep (Flag75)
+ -- Has_Non_Standard_Rep (Flag75) (base type only)
-- Has_Object_Size_Clause (Flag172)
-- Has_Primitive_Operations (Flag120) (base type only)
-- Has_Size_Clause (Flag29)
@@ -3778,7 +3800,7 @@ package Einfo is
-- Is_Volatile (Flag16)
-- Size_Depends_On_Discriminant (Flag177)
-- Size_Known_At_Compile_Time (Flag92)
- -- Strict_Alignment (Flag145)
+ -- Strict_Alignment (Flag145) (base type only)
-- Suppress_Init_Proc (Flag105) (base type only)
-- Alignment_Clause (synth)
@@ -3811,15 +3833,15 @@ package Einfo is
-- E_Access_Type
-- E_Access_Subtype
- -- Storage_Size_Variable (Node15) (root type only)
+ -- Storage_Size_Variable (Node15) (base type only)
-- Master_Id (Node17)
-- Directly_Designated_Type (Node20)
- -- Associated_Storage_Pool (Node22)
+ -- Associated_Storage_Pool (Node22) (base type only)
-- Associated_Final_Chain (Node23)
-- Has_Pragma_Controlled (Flag27) (base type only)
- -- Has_Storage_Size_Clause (Flag23) (root type only)
+ -- Has_Storage_Size_Clause (Flag23) (base type only)
-- Is_Access_Constant (Flag69)
- -- No_Pool_Assigned (Flag131) (root type only)
+ -- No_Pool_Assigned (Flag131) (base type only)
-- (plus type attributes)
-- E_Access_Attribute_Type
@@ -3840,6 +3862,7 @@ package Einfo is
-- First_Index (Node17)
-- Related_Array_Object (Node19)
-- Component_Type (Node20) (base type only)
+ -- Original_Array_Type (Node21)
-- Component_Size (Uint22) (base type only)
-- Packed_Array_Type (Node23)
-- Component_Alignment (special) (base type only)
@@ -4089,7 +4112,7 @@ package Einfo is
-- Storage_Size_Variable (Node15) (base type only)
-- Master_Id (Node17)
-- Directly_Designated_Type (Node20)
- -- Associated_Storage_Pool (Node22)
+ -- Associated_Storage_Pool (Node22) (base type only)
-- Associated_Final_Chain (Node23)
-- (plus type attributes)
@@ -4163,6 +4186,7 @@ package Einfo is
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- Modulus (Uint17) (base type only)
+ -- Original_Array_Type (Node21)
-- Scalar_Range (Node20)
-- Non_Binary_Modulus (Flag58) (base type only)
-- Has_Biased_Representation (Flag139)
@@ -4352,13 +4376,13 @@ package Einfo is
-- Parent_Subtype (Node19)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
- -- Corresponding_Remote_Type (Node22) (base type only)
+ -- Corresponding_Remote_Type (Node22)
-- Girder_Constraint (Elist23)
-- Component_Alignment (special) (base type only)
-- C_Pass_By_Copy (Flag125) (base type only)
-- Has_Controlled_Component (Flag43) (base type only)
-- Has_External_Tag_Rep_Clause (Flag110)
- -- Has_Record_Rep_Clause (Flag65)
+ -- Has_Record_Rep_Clause (Flag65) (base type only)
-- Is_Concurrent_Record_Type (Flag20)
-- Is_Constrained (Flag12)
-- Is_Controlled (Flag42) (base type only)
@@ -4383,7 +4407,7 @@ package Einfo is
-- Has_Completion (Flag26)
-- Has_Completion_In_Body (Flag71)
-- Has_Controlled_Component (Flag43) (base type only)
- -- Has_Record_Rep_Clause (Flag65)
+ -- Has_Record_Rep_Clause (Flag65) (base type only)
-- Has_External_Tag_Rep_Clause (Flag110)
-- Is_Concurrent_Record_Type (Flag20)
-- Is_Constrained (Flag12)
@@ -4416,11 +4440,11 @@ package Einfo is
-- String_Literal_Low_Bound (Node15)
-- String_Literal_Length (Uint16)
-- First_Index (Node17) (always Empty)
- -- Component_Type (Node20) (base type only)
-- Packed_Array_Type (Node23)
-- (plus type attributes)
-- E_Subprogram_Body
+ -- Mechanism (Uint8)
-- First_Entity (Node17)
-- Last_Entity (Node20)
-- Scope_Depth_Value (Uint22)
@@ -4845,6 +4869,7 @@ package Einfo is
function Has_Pragma_Inline (Id : E) return B;
function Has_Pragma_Pack (Id : E) return B;
function Has_Pragma_Pure_Function (Id : E) return B;
+ function Has_Pragma_Unreferenced (Id : E) return B;
function Has_Primitive_Operations (Id : E) return B;
function Has_Qualified_Name (Id : E) return B;
function Has_Record_Rep_Clause (Id : E) return B;
@@ -4955,6 +4980,7 @@ package Einfo is
function Normalized_Position_Max (Id : E) return U;
function Not_Source_Assigned (Id : E) return B;
function Object_Ref (Id : E) return E;
+ function Original_Array_Type (Id : E) return E;
function Original_Record_Component (Id : E) return E;
function Packed_Array_Type (Id : E) return E;
function Parent_Subtype (Id : E) return E;
@@ -5137,15 +5163,15 @@ package Einfo is
-- possible, so we do not need a separate Known_Static calls in
-- these cases. The not set (unknown values are as follows:
- -- Alignment Uint_0
- -- Component_Size Uint_0
+ -- Alignment Uint_0 or No_Uint
+ -- Component_Size Uint_0 or No_Uint
-- Component_Bit_Offset No_Uint
- -- Digits_Value Uint_0
- -- Esize Uint_0
+ -- Digits_Value Uint_0 or No_Uint
+ -- Esize Uint_0 or No_Uint
-- Normalized_First_Bit No_Uint
-- Normalized_Position No_Uint
-- Normalized_Position_Max No_Uint
- -- RM_Size Uint_0
+ -- RM_Size Uint_0 or No_Uint
-- It would be cleaner to use No_Uint in all these cases, but historically
-- we chose to use Uint_0 at first, and the change over will take time ???
@@ -5166,6 +5192,7 @@ package Einfo is
function Known_Static_Component_Bit_Offset (E : Entity_Id) return B;
function Known_Static_Component_Size (E : Entity_Id) return B;
function Known_Static_Esize (E : Entity_Id) return B;
+ function Known_Static_Normalized_First_Bit (E : Entity_Id) return B;
function Known_Static_Normalized_Position (E : Entity_Id) return B;
function Known_Static_Normalized_Position_Max (E : Entity_Id) return B;
function Known_Static_RM_Size (E : Entity_Id) return B;
@@ -5301,6 +5328,7 @@ package Einfo is
procedure Set_Has_Pragma_Inline (Id : E; V : B := True);
procedure Set_Has_Pragma_Pack (Id : E; V : B := True);
procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True);
+ procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True);
procedure Set_Has_Primitive_Operations (Id : E; V : B := True);
procedure Set_Has_Private_Declaration (Id : E; V : B := True);
procedure Set_Has_Qualified_Name (Id : E; V : B := True);
@@ -5416,6 +5444,7 @@ package Einfo is
procedure Set_Normalized_Position_Max (Id : E; V : U);
procedure Set_Not_Source_Assigned (Id : E; V : B := True);
procedure Set_Object_Ref (Id : E; V : E);
+ procedure Set_Original_Array_Type (Id : E; V : E);
procedure Set_Original_Record_Component (Id : E; V : E);
procedure Set_Packed_Array_Type (Id : E; V : E);
procedure Set_Parent_Subtype (Id : E; V : E);
@@ -5590,6 +5619,20 @@ package Einfo is
procedure Append_Entity (Id : Entity_Id; V : Entity_Id);
-- Add an entity to the list of entities declared in the scope V
+ function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id;
+ -- Searches the Rep_Item chain for the given entity E, for an instance
+ -- of a representation pragma with the given name Nam. If found then
+ -- the value returned is the N_Pragma node, otherwise Empty is returned.
+
+ function Get_Attribute_Definition_Clause
+ (E : Entity_Id;
+ Id : Attribute_Id)
+ return Node_Id;
+ -- Searches the Rep_Item chain for a given entity E, for an instance
+ -- of an attribute definition clause with the given attibute Id Id. If
+ -- found, the value returned is the N_Attribute_Definition_Clause node,
+ -- otherwise Empty is returned.
+
function Is_Entity_Name (N : Node_Id) return Boolean;
-- Test if the node N is the name of an entity (i.e. is an identifier,
-- expanded name, or an attribute reference that returns an entity).
@@ -5769,6 +5812,7 @@ package Einfo is
pragma Inline (Has_Pragma_Inline);
pragma Inline (Has_Pragma_Pack);
pragma Inline (Has_Pragma_Pure_Function);
+ pragma Inline (Has_Pragma_Unreferenced);
pragma Inline (Has_Primitive_Operations);
pragma Inline (Has_Private_Declaration);
pragma Inline (Has_Qualified_Name);
@@ -5920,6 +5964,7 @@ package Einfo is
pragma Inline (Normalized_Position_Max);
pragma Inline (Not_Source_Assigned);
pragma Inline (Object_Ref);
+ pragma Inline (Original_Array_Type);
pragma Inline (Original_Record_Component);
pragma Inline (Packed_Array_Type);
pragma Inline (Parameter_Mode);
@@ -5988,19 +6033,6 @@ package Einfo is
pragma Inline (Init_Esize);
pragma Inline (Init_RM_Size);
- pragma Inline (Known_Alignment);
- pragma Inline (Known_Component_Bit_Offset);
- pragma Inline (Known_Component_Size);
- pragma Inline (Known_Esize);
-
- pragma Inline (Known_Static_Component_Size);
- pragma Inline (Known_Static_Esize);
-
- pragma Inline (Unknown_Alignment);
- pragma Inline (Unknown_Component_Bit_Offset);
- pragma Inline (Unknown_Component_Size);
- pragma Inline (Unknown_Esize);
-
pragma Inline (Set_Accept_Address);
pragma Inline (Set_Access_Disp_Table);
pragma Inline (Set_Actual_Subtype);
@@ -6115,6 +6147,7 @@ package Einfo is
pragma Inline (Set_Has_Pragma_Inline);
pragma Inline (Set_Has_Pragma_Pack);
pragma Inline (Set_Has_Pragma_Pure_Function);
+ pragma Inline (Set_Has_Pragma_Unreferenced);
pragma Inline (Set_Has_Primitive_Operations);
pragma Inline (Set_Has_Private_Declaration);
pragma Inline (Set_Has_Qualified_Name);
@@ -6230,6 +6263,7 @@ package Einfo is
pragma Inline (Set_Normalized_Position_Max);
pragma Inline (Set_Not_Source_Assigned);
pragma Inline (Set_Object_Ref);
+ pragma Inline (Set_Original_Array_Type);
pragma Inline (Set_Original_Record_Component);
pragma Inline (Set_Packed_Array_Type);
pragma Inline (Set_Parent_Subtype);