einfo.ads, einfo.adb: Create a limited view of an incomplete type...

2007-08-14  Ed Schonberg  <schonberg@adacore.com>
	    Robert Dewar  <dewar@adacore.com>
	    Javier Miranda  <miranda@adacore.com>
	    Gary Dismukes  <dismukes@adacore.com>

	* einfo.ads, einfo.adb: Create a limited view of an incomplete type,
	to make treatment of limited views uniform for all visible declarations
	in a limited_withed package.
	Improve warnings for in out parameters
	(Set_Related_Interaface/Related_Interface): Allow the use of this
	attribute with constants.
	(Write_Field26_Name): Handle attribute Related_Interface in constants.
	Warn on duplicate pragma Preelaborable_Initialialization

	* sem_ch6.ads, sem_ch6.adb (Analyze_Subprogram_Body): Force the
	generation of a freezing node to ensure proper management of null
	excluding access types in the backend.
	(Create_Extra_Formals): Test base type of the formal when checking for
	the need to add an extra accessibility-level formal. Pass the entity E
	on all calls to Add_Extra_Formal (rather than Scope (Formal) as was
	originally being done in a couple of cases), to ensure that the
	Extra_Formals list gets set on the entity E when the first entity is
	added.
	(Conforming_Types): Add missing calls to Base_Type to the code that
	handles anonymous access types. This is required to handle the
	general case because Process_Formals builds internal subtype entities
	to handle null-excluding access types.
	(Make_Controlling_Function_Wrappers): Create wrappers for constructor
	functions that need it, even when not marked Requires_Overriding.
	Improve warnings for in out parameters
	(Analyze_Function_Return): Warn for disallowed null return
	Warn on return from procedure with unset out parameter
	Ensure consistent use of # in error messages
	(Check_Overriding_Indicator): Add in parameter Is_Primitive.
	(Analyze_Function_Return): Move call to Apply_Constraint_Check before
	the implicit conversion of the expression done for anonymous access
	types. This is required to generate the code of the null excluding
	check (if required).

	* sem_warn.ads, sem_warn.adb (Check_References.Publicly_Referenceable):
	A formal parameter is never publicly referenceable outside of its body.
	(Check_References): For an unreferenced formal parameter in an accept
	statement, use the same warning circuitry as for subprogram formal
	parameters.
	(Warn_On_Unreferenced_Entity): New subprogram, taken from
	Output_Unreferenced_Messages, containing the part of that routine that
	is now reused for entry formals as described above.
	(Goto_Spec_Entity): New function
	(Check_References): Do not give IN OUT warning for dispatching operation
	Improve warnings for in out parameters
	(Test_Ref): Check that the entity is not undefinite before calling
	Scope_Within, in order to avoid infinite loops.
	Warn on return from procedure with unset out parameter
	Improved warnings for unused variables

From-SVN: r127415
This commit is contained in:
Ed Schonberg 2007-08-14 10:38:20 +02:00 committed by Arnaud Charlet
parent b99282c4c1
commit 5d37ba92f6
4 changed files with 765 additions and 521 deletions

View File

@ -474,15 +474,12 @@ package body Einfo is
-- Has_Up_Level_Access Flag215
-- Universal_Aliasing Flag216
-- Suppress_Value_Tracking_On_Call Flag217
-- Is_Primitive Flag218
-- Has_Initial_Value Flag219
-- Has_Dispatch_Table Flag220
-- (unused) Flag77
-- (unused) Flag218
-- (unused) Flag219
-- (unused) Flag220
-- (unused) Flag221
-- (unused) Flag222
-- Has_Pragma_Preelab_Init Flag221
-- Used_As_Generic_Actual Flag222
-- (unused) Flag223
-- (unused) Flag224
-- (unused) Flag225
@ -1194,6 +1191,12 @@ package body Einfo is
return Flag5 (Id);
end Has_Discriminants;
function Has_Dispatch_Table (Id : E) return B is
begin
pragma Assert (Is_Tagged_Type (Id));
return Flag220 (Id);
end Has_Dispatch_Table;
function Has_Enumeration_Rep_Clause (Id : E) return B is
begin
pragma Assert (Is_Enumeration_Type (Id));
@ -1231,6 +1234,13 @@ package body Einfo is
return Flag56 (Id);
end Has_Homonym;
function Has_Initial_Value (Id : E) return B is
begin
pragma Assert
(Ekind (Id) = E_Variable or else Is_Formal (Id));
return Flag219 (Id);
end Has_Initial_Value;
function Has_Machine_Radix_Clause (Id : E) return B is
begin
pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
@ -1297,6 +1307,11 @@ package body Einfo is
return Flag121 (Implementation_Base_Type (Id));
end Has_Pragma_Pack;
function Has_Pragma_Preelab_Init (Id : E) return B is
begin
return Flag221 (Id);
end Has_Pragma_Preelab_Init;
function Has_Pragma_Pure (Id : E) return B is
begin
return Flag203 (Id);
@ -1830,6 +1845,15 @@ package body Einfo is
return Flag59 (Id);
end Is_Preelaborated;
function Is_Primitive (Id : E) return B is
begin
pragma Assert
(Is_Overloadable (Id)
or else Ekind (Id) = E_Generic_Function
or else Ekind (Id) = E_Generic_Procedure);
return Flag218 (Id);
end Is_Primitive;
function Is_Primitive_Wrapper (Id : E) return B is
begin
pragma Assert (Ekind (Id) = E_Procedure);
@ -2297,7 +2321,8 @@ package body Einfo is
function Related_Interface (Id : E) return E is
begin
pragma Assert (Ekind (Id) = E_Component);
pragma Assert
(Ekind (Id) = E_Component or else Ekind (Id) = E_Constant);
return Node26 (Id);
end Related_Interface;
@ -2506,6 +2531,11 @@ package body Einfo is
return Node16 (Id);
end Unset_Reference;
function Used_As_Generic_Actual (Id : E) return B is
begin
return Flag222 (Id);
end Used_As_Generic_Actual;
function Uses_Sec_Stack (Id : E) return B is
begin
return Flag95 (Id);
@ -3428,6 +3458,13 @@ package body Einfo is
Set_Flag5 (Id, V);
end Set_Has_Discriminants;
procedure Set_Has_Dispatch_Table (Id : E; V : B := True) is
begin
pragma Assert (Ekind (Id) = E_Record_Type
and then Is_Tagged_Type (Id));
Set_Flag220 (Id, V);
end Set_Has_Dispatch_Table;
procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
begin
pragma Assert (Is_Enumeration_Type (Id));
@ -3465,6 +3502,13 @@ package body Einfo is
Set_Flag56 (Id, V);
end Set_Has_Homonym;
procedure Set_Has_Initial_Value (Id : E; V : B := True) is
begin
pragma Assert
(Ekind (Id) = E_Variable or else Ekind (Id) = E_Out_Parameter);
Set_Flag219 (Id, V);
end Set_Has_Initial_Value;
procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
begin
pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
@ -3542,6 +3586,11 @@ package body Einfo is
Set_Flag121 (Id, V);
end Set_Has_Pragma_Pack;
procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True) is
begin
Set_Flag221 (Id, V);
end Set_Has_Pragma_Preelab_Init;
procedure Set_Has_Pragma_Pure (Id : E; V : B := True) is
begin
Set_Flag203 (Id, V);
@ -4097,6 +4146,15 @@ package body Einfo is
Set_Flag59 (Id, V);
end Set_Is_Preelaborated;
procedure Set_Is_Primitive (Id : E; V : B := True) is
begin
pragma Assert
(Is_Overloadable (Id)
or else Ekind (Id) = E_Generic_Function
or else Ekind (Id) = E_Generic_Procedure);
Set_Flag218 (Id, V);
end Set_Is_Primitive;
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
begin
pragma Assert (Ekind (Id) = E_Procedure);
@ -4574,7 +4632,8 @@ package body Einfo is
procedure Set_Related_Interface (Id : E; V : E) is
begin
pragma Assert (Ekind (Id) = E_Component);
pragma Assert
(Ekind (Id) = E_Component or else Ekind (Id) = E_Constant);
Set_Node26 (Id, V);
end Set_Related_Interface;
@ -4793,6 +4852,11 @@ package body Einfo is
Set_Flag95 (Id, V);
end Set_Uses_Sec_Stack;
procedure Set_Used_As_Generic_Actual (Id : E; V : B := True) is
begin
Set_Flag222 (Id, V);
end Set_Used_As_Generic_Actual;
procedure Set_Vax_Float (Id : E; V : B := True) is
begin
pragma Assert (Id = Base_Type (Id));
@ -4918,7 +4982,7 @@ package body Einfo is
begin
Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
Set_Uint11 (Id, No_Uint); -- Component_First_Bit
Set_Uint11 (Id, No_Uint); -- Component_Bit_Offset
Set_Uint12 (Id, Uint_0); -- Esize
Set_Uint14 (Id, No_Uint); -- Normalized_Position
end Init_Component_Location;
@ -5161,7 +5225,10 @@ package body Einfo is
if Is_Incomplete_Type (Id)
and then Present (Non_Limited_View (Id))
then
return Non_Limited_View (Id);
-- The non-limited view may itself be an incomplete type, in
-- which case get its full view.
return Get_Full_View (Non_Limited_View (Id));
elsif Is_Class_Wide_Type (Id)
and then Is_Incomplete_Type (Etype (Id))
@ -5327,7 +5394,6 @@ package body Einfo is
P := Parent (P);
end if;
end loop;
end Declaration_Node;
---------------------
@ -5681,6 +5747,28 @@ package body Einfo is
return Empty;
end Get_Attribute_Definition_Clause;
-------------------
-- Get_Full_View --
-------------------
function Get_Full_View (T : Entity_Id) return Entity_Id is
begin
if Ekind (T) = E_Incomplete_Type
and then Present (Full_View (T))
then
return Full_View (T);
elsif Is_Class_Wide_Type (T)
and then Ekind (Root_Type (T)) = E_Incomplete_Type
and then Present (Full_View (Root_Type (T)))
then
return Class_Wide_Type (Full_View (Root_Type (T)));
else
return T;
end if;
end Get_Full_View;
--------------------
-- Get_Rep_Pragma --
--------------------
@ -6565,6 +6653,11 @@ package body Einfo is
elsif Ekind (T) = E_Class_Wide_Subtype then
return Etype (Base_Type (T));
-- ??? T comes from Base_Type, how can it be a subtype?
-- Also Base_Type is supposed to be idempotent, so either way
-- this is equivalent to "return Etype (T)" and should be merged
-- with the E_Class_Wide_Type case.
-- All other cases
else
@ -7007,6 +7100,7 @@ package body Einfo is
W ("Has_Fully_Qualified_Name", Flag173 (Id));
W ("Has_Gigi_Rep_Item", Flag82 (Id));
W ("Has_Homonym", Flag56 (Id));
W ("Has_Initial_Value", Flag219 (Id));
W ("Has_Machine_Radix_Clause", Flag83 (Id));
W ("Has_Master_Entity", Flag21 (Id));
W ("Has_Missing_Return", Flag142 (Id));
@ -7019,6 +7113,7 @@ package body Einfo is
W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
W ("Has_Pragma_Inline", Flag157 (Id));
W ("Has_Pragma_Pack", Flag121 (Id));
W ("Has_Pragma_Preelab_Init", Flag221 (Id));
W ("Has_Pragma_Pure", Flag203 (Id));
W ("Has_Pragma_Pure_Function", Flag179 (Id));
W ("Has_Pragma_Unreferenced", Flag180 (Id));
@ -7172,8 +7267,10 @@ package body Einfo is
W ("Suppress_Init_Proc", Flag105 (Id));
W ("Suppress_Style_Checks", Flag165 (Id));
W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
W ("Is_Primitive", Flag218 (Id));
W ("Treat_As_Volatile", Flag41 (Id));
W ("Universal_Aliasing", Flag216 (Id));
W ("Used_As_Generic_Actual", Flag222 (Id));
W ("Uses_Sec_Stack", Flag95 (Id));
W ("Vax_Float", Flag151 (Id));
W ("Warnings_Off", Flag96 (Id));
@ -7741,9 +7838,9 @@ package body Einfo is
end case;
end Write_Field17_Name;
-----------------------
------------------------
-- Write_Field18_Name --
-----------------------
------------------------
procedure Write_Field18_Name (Id : Entity_Id) is
begin
@ -7770,8 +7867,7 @@ package body Einfo is
when Fixed_Point_Kind =>
Write_Str ("Delta_Value");
when E_Constant |
E_Variable =>
when Object_Kind =>
Write_Str ("Renamed_Object");
when E_Exception |
@ -8114,7 +8210,8 @@ package body Einfo is
procedure Write_Field26_Name (Id : Entity_Id) is
begin
case Ekind (Id) is
when E_Component =>
when E_Component |
E_Constant =>
Write_Str ("Related_Interface");
when E_Generic_Package |

View File

@ -193,7 +193,7 @@ package Einfo is
-- Object_Size of this first-named subtype to the given value padded up
-- to an appropriate boundary. It is a consequence of the default rules
-- above that this Object_Size will apply to all further subtypes. On the
-- otyher hand, Value_Size is affected only for the first subtype, any
-- other hand, Value_Size is affected only for the first subtype, any
-- dynamic subtypes obtained from it directly, and any statically matching
-- subtypes. The Value_Size of any other static subtypes is not affected.
@ -245,6 +245,10 @@ package Einfo is
-- and Value_Size are the same (and equivalent to the RM attribute Size).
-- Only Size may be specified for such types.
-- All size attributes are stored as Uint values. Negative values are used to
-- reference GCC expressions for the case of non-static sizes, as explained
-- in Repinfo.
-----------------------
-- Entity Attributes --
-----------------------
@ -347,7 +351,8 @@ package Einfo is
-- Present in all entities. Set if the Address or Unrestricted_Access
-- attribute is applied directly to the entity, i.e. the entity is the
-- entity of the prefix of the attribute reference. Used by Gigi to
-- make sure that the address can be meaningfully taken.
-- make sure that the address can be meaningfully taken, and also in
-- the case of subprograms to control output of certain warnings.
-- Alias (Node18)
-- Present in overloaded entities (literals, subprograms, entries) and
@ -1388,6 +1393,14 @@ package Einfo is
-- and incomplete types), indicates if the corresponding type or subtype
-- has a known discriminant part. Always false for all other types.
-- Has_Dispatch_Table (Flag220)
-- Present in E_Record_Types that are tagged. Set to indicate that the
-- corresponding dispatch table is already built. This flag is used to
-- avoid duplicate construction of library level dispatch tables (because
-- the declaration of library level objects cause premature construction
-- of the table); otherwise the code that builds the table is added at
-- the end of the list of declarations of the package.
-- Has_Entries (synthesized)
-- Applies to concurrent types. True if any entries are declared
-- within the task or protected definition for the type.
@ -1446,7 +1459,16 @@ package Einfo is
-- Has_Homonym (Flag56)
-- Present in all entities. Set if an entity has a homonym in the same
-- scope. Used by Gigi to generate unique names for such entities.
--
-- Has_Initial_Value (Flag219)
-- Present in entities for variables and out parameters. Set if there
-- is an explicit initial value expression in the declaration of the
-- variable. Note that this is set only if this initial value is
-- explicit, it is not set for the case of implicit initialization
-- of access types or controlled types. Always set to False for out
-- parameters. Also present in entities for in and in-out parameters,
-- but always false in these cases.
--
-- Has_Interrupt_Handler (synthesized)
-- Applies to all protected type entities. Set if the protected type
-- definition contains at least one procedure to which a pragma
@ -1546,6 +1568,10 @@ package Einfo is
-- was given for the entity. In some cases, we need to test whether
-- Is_Pure was explicitly set using this pragma.
-- Has_Pragma_Preelab_Init (Flag221)
-- Present in type and subtype entities. If set indicates that a valid
-- pragma Preelaborable_Initialization applies to the type.
-- Has_Pragma_Pure_Function (Flag179)
-- Present in all entities. If set, indicates that a valid pragma
-- Pure_Function was given for the entity. In some cases, we need to
@ -2144,9 +2170,12 @@ package Einfo is
-- Is_Internal (Flag17)
-- Present in all entities. Set to indicate an entity created during
-- semantic processing (e.g. an implicit type, or a temporary). The
-- only current use of this flag is to indicate that temporaries
-- current uses of this flag are: 1) to indicate that temporaries
-- generated for the result of an inlined function call need not be
-- initialized, even when scalars are initialized or normalized.
-- initialized, even when scalars are initialized or normalized, and
-- 2) to indicate object declarations generated by the expander that are
-- implicitly imported or exported, so that they can be appropriately
-- marked in Sprint output.
-- Is_Interrupt_Handler (Flag89)
-- Present in procedures. Set if a pragma Interrupt_Handler applies
@ -2388,6 +2417,12 @@ package Einfo is
-- flag is set does not necesarily mean that no elaboration code is
-- generated for the package.
-- Is_Primitive (Flag218)
-- Present in overloadable entities and in generic subprograms. Set to
-- indicate that this is a primitive operation of some type, which may be
-- a tagged type or a non-tagged type. Used to verify overriding
-- indicators in bodies.
-- Is_Primitive_Wrapper (Flag195)
-- Present in E_Procedures. Primitive wrappers are Expander-generated
-- procedures that wrap entries of protected or task types implementing
@ -2757,13 +2792,15 @@ package Einfo is
-- entities when the return type is an array type, and a call can be
-- interpreted as an indexing of the result of the call. It is also
-- used to resolve various cases of entry calls.
--
-- Never_Set_In_Source (Flag115)
-- Present in all entities, but relevant only for variables and
-- parameters. This flag is set if the object is never assigned
-- a value in user source code, either by assignment or by the
-- use of an initial value, or by some other means.
-- parameters. This flag is set if the object is never assigned a value
-- in user source code, either by assignment or by being used as an out
-- or in out parameter. Note that this flag is not reset from using an
-- initial value, so if you want to test for this case as well, test the
-- Has_Initial_Value flag also.
--
-- This flag is only for the purposes of issuing warnings, it must not
-- be used by the code generator to indicate that the variable is in
-- fact a constant, since some assignments in generated code do not
@ -3095,15 +3132,15 @@ package Einfo is
-- Referenced (Flag156)
-- Present in all entities, set if the entity is referenced, except
-- for the case of an appearence of a simple variable that is not a
-- for the case of an appearence of a simple variable, that is not a
-- renaming, as the left side of an assignment in which case the flag
-- Referenced_As_LHS is set instead.
-- Referenced_As_LHS (Flag36): This flag is set instead of
-- Referenced if a simple variable that is not a renaming appears as
-- the left side of an assignment. The reason we distinguish this kind
-- of reference is that we have a separate warning for variables that
-- are only assigned and never read.
-- Referenced_As_LHS (Flag36):
-- This flag is set instead of Referenced if a simple variable that is
-- not a renaming appears as the left side of an assignment. The reason
-- we distinguish this kind of reference is that we have a separate
-- warning for variables that are only assigned and never read.
-- Referenced_Object (Node10)
-- Present in all type entities. Set non-Empty only for type entities
@ -3132,9 +3169,8 @@ package Einfo is
-- must correspond to the name and scope of the related instance.
-- Related_Interface (Node26)
-- Present in components associated with secondary dispatch tables
-- (dispatch table pointers and offset components). Set to point to the
-- entity of the corresponding interface type.
-- Present in components and constants associated with dispatch tables.
-- Set to point to the entity of the associated interface type.
-- Renamed_Entity (Node18)
-- Present in exceptions, packages, subprograms and generic units. Set
@ -3144,15 +3180,16 @@ package Einfo is
-- Renamed_Object (Node18)
-- Present in all objects (constants, variables, components, formal
-- parameters, generic formal parameters, and loop parameters). Set
-- non-Empty if the object was declared by a renaming declaration, in
-- which case it references the tree node for the name of the renamed
-- parameters, generic formal parameters, and loop parameters).
-- ??? Present in discriminants?
-- Set non-Empty if the object was declared by a renaming declaration,
-- in which case it references the tree node for the name of the renamed
-- object. This is only possible for the variable and constant cases.
-- For formal parameters, this field is used in the course of inline
-- expansion, to map the formals of a subprogram into the corresponding
-- actuals. For formals of a task entry, it denotes the local renaming
-- that replaces the actual within the accept statement.
-- The field is Empty otherwise.
-- that replaces the actual within the accept statement. The field is
-- Empty otherwise (it is always empty for loop parameters).
-- Renaming_Map (Uint9)
-- Present in generic subprograms, generic packages, and their
@ -3474,6 +3511,10 @@ package Einfo is
-- is identified. This field is used to generate a warning message if
-- necessary (see Sem_Warn.Check_Unset_Reference).
-- Used_As_Generic_Actual (Flag222)
-- Present in all entities, set if the entity is used as an argument to
-- a generic instantiation. Used to tune certain warning messages.
-- Uses_Sec_Stack (Flag95)
-- Present in scope entities (blocks,functions, procedures, tasks,
-- entries). Set to True when secondary stack is used in this scope and
@ -4085,7 +4126,7 @@ package Einfo is
subtype Formal_Kind is Entity_Kind range
E_In_Parameter ..
-- E_Out_Parameter
E_In_Out_Parameter;
E_In_Out_Parameter;
subtype Formal_Object_Kind is Entity_Kind range
E_Generic_In_Out_Parameter ..
@ -4364,6 +4405,7 @@ package Einfo is
-- Suppress_Elaboration_Warnings (Flag148)
-- Suppress_Style_Checks (Flag165)
-- Suppress_Value_Tracking_On_Call (Flag217)
-- Used_As_Generic_Actual (Flag222)
-- Was_Hidden (Flag196)
-- Declaration_Node (synth)
@ -4400,6 +4442,7 @@ package Einfo is
-- Has_Discriminants (Flag5)
-- Has_Non_Standard_Rep (Flag75) (base type only)
-- Has_Object_Size_Clause (Flag172)
-- Has_Pragma_Preelab_Init (Flag221)
-- Has_Pragma_Unreferenced_Objects (Flag212)
-- Has_Primitive_Operations (Flag120) (base type only)
-- Has_Size_Clause (Flag29)
@ -4587,8 +4630,8 @@ package Einfo is
-- Actual_Subtype (Node17)
-- Renamed_Object (Node18)
-- Size_Check_Code (Node19) (constants only)
-- In_Private_Part (Flag45)
-- Interface_Name (Node21)
-- Related_Interface (Node26) (constants only)
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86)
-- Has_Biased_Representation (Flag139)
@ -4596,6 +4639,7 @@ package Einfo is
-- Has_Size_Clause (Flag29)
-- Has_Up_Level_Access (Flag215)
-- Has_Volatile_Components (Flag87)
-- In_Private_Part (Flag45)
-- Is_Atomic (Flag85)
-- Is_Eliminated (Flag124)
-- Is_True_Constant (Flag163)
@ -4763,6 +4807,7 @@ package Einfo is
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
-- Is_Visible_Child_Unit (Flag116)
@ -4828,6 +4873,7 @@ package Einfo is
-- Default_Expr_Function (Node21)
-- Protected_Formal (Node22)
-- Extra_Constrained (Node23)
-- Has_Initial_Value (Flag219)
-- Is_Controlling_Formal (Flag97)
-- Is_Entry_Formal (Flag52)
-- Is_Optional_Parameter (Flag134)
@ -4884,6 +4930,7 @@ package Einfo is
-- Is_Pure (Flag44)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Overriding_Operation (Flag39)
-- Is_Primitive (Flag218)
-- Default_Expressions_Processed (Flag108)
-- E_Ordinary_Fixed_Point_Type
@ -5018,6 +5065,7 @@ package Einfo is
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Null_Init_Proc (Flag178)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
@ -5073,6 +5121,7 @@ package Einfo is
-- Abstract_Interfaces (Elist25)
-- Component_Alignment (special) (base type only)
-- C_Pass_By_Copy (Flag125) (base type only)
-- Has_Dispatch_Table (Flag220) (base tagged type only)
-- Has_External_Tag_Rep_Clause (Flag110)
-- Has_Record_Rep_Clause (Flag65) (base type only)
-- Has_Static_Discriminants (Flag211) (subtype only)
@ -5204,6 +5253,7 @@ package Einfo is
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86)
-- Has_Biased_Representation (Flag139)
-- Has_Initial_Value (Flag219)
-- Has_Size_Clause (Flag29)
-- Has_Volatile_Components (Flag87)
-- In_Private_Part (Flag45)
@ -5562,12 +5612,14 @@ package Einfo is
function Has_Convention_Pragma (Id : E) return B;
function Has_Delayed_Freeze (Id : E) return B;
function Has_Discriminants (Id : E) return B;
function Has_Dispatch_Table (Id : E) return B;
function Has_Enumeration_Rep_Clause (Id : E) return B;
function Has_Exit (Id : E) return B;
function Has_External_Tag_Rep_Clause (Id : E) return B;
function Has_Fully_Qualified_Name (Id : E) return B;
function Has_Gigi_Rep_Item (Id : E) return B;
function Has_Homonym (Id : E) return B;
function Has_Initial_Value (Id : E) return B;
function Has_Interrupt_Handler (Id : E) return B;
function Has_Machine_Radix_Clause (Id : E) return B;
function Has_Master_Entity (Id : E) return B;
@ -5583,6 +5635,7 @@ package Einfo is
function Has_Pragma_Elaborate_Body (Id : E) return B;
function Has_Pragma_Inline (Id : E) return B;
function Has_Pragma_Pack (Id : E) return B;
function Has_Pragma_Preelab_Init (Id : E) return B;
function Has_Pragma_Pure (Id : E) return B;
function Has_Pragma_Pure_Function (Id : E) return B;
function Has_Pragma_Unreferenced (Id : E) return B;
@ -5673,6 +5726,7 @@ package Einfo is
function Is_Packed_Array_Type (Id : E) return B;
function Is_Potentially_Use_Visible (Id : E) return B;
function Is_Preelaborated (Id : E) return B;
function Is_Primitive (Id : E) return B;
function Is_Primitive_Wrapper (Id : E) return B;
function Is_Private_Composite (Id : E) return B;
function Is_Private_Descendant (Id : E) return B;
@ -5790,6 +5844,7 @@ package Einfo is
function Underlying_Full_View (Id : E) return E;
function Universal_Aliasing (Id : E) return B;
function Unset_Reference (Id : E) return N;
function Used_As_Generic_Actual (Id : E) return B;
function Uses_Sec_Stack (Id : E) return B;
function Vax_Float (Id : E) return B;
function Warnings_Off (Id : E) return B;
@ -6088,12 +6143,14 @@ package Einfo is
procedure Set_Has_Convention_Pragma (Id : E; V : B := True);
procedure Set_Has_Delayed_Freeze (Id : E; V : B := True);
procedure Set_Has_Discriminants (Id : E; V : B := True);
procedure Set_Has_Dispatch_Table (Id : E; V : B := True);
procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True);
procedure Set_Has_Exit (Id : E; V : B := True);
procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True);
procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True);
procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True);
procedure Set_Has_Homonym (Id : E; V : B := True);
procedure Set_Has_Initial_Value (Id : E; V : B := True);
procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True);
procedure Set_Has_Master_Entity (Id : E; V : B := True);
procedure Set_Has_Missing_Return (Id : E; V : B := True);
@ -6108,6 +6165,7 @@ package Einfo is
procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True);
procedure Set_Has_Pragma_Inline (Id : E; V : B := True);
procedure Set_Has_Pragma_Pack (Id : E; V : B := True);
procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True);
procedure Set_Has_Pragma_Pure (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);
@ -6205,6 +6263,7 @@ package Einfo is
procedure Set_Is_Packed_Array_Type (Id : E; V : B := True);
procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True);
procedure Set_Is_Preelaborated (Id : E; V : B := True);
procedure Set_Is_Primitive (Id : E; V : B := True);
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True);
procedure Set_Is_Private_Composite (Id : E; V : B := True);
procedure Set_Is_Private_Descendant (Id : E; V : B := True);
@ -6322,6 +6381,7 @@ package Einfo is
procedure Set_Underlying_Full_View (Id : E; V : E);
procedure Set_Universal_Aliasing (Id : E; V : B := True);
procedure Set_Unset_Reference (Id : E; V : N);
procedure Set_Used_As_Generic_Actual (Id : E; V : B := True);
procedure Set_Uses_Sec_Stack (Id : E; V : B := True);
procedure Set_Vax_Float (Id : E; V : B := True);
procedure Set_Warnings_Off (Id : E; V : B := True);
@ -6353,6 +6413,11 @@ package Einfo is
-- This is particularly true for the RM_Size field, where a value of zero
-- is legitimate and causes some kludges around the code.
-- Contrary to the corresponding Set procedures above, these routines
-- do NOT check the entity kind of their argument, instead they set the
-- underlying Uint fields directly (this allows them to be used for
-- entities whose Ekind has not been set yet).
procedure Init_Alignment (Id : E; V : Int);
procedure Init_Component_Size (Id : E; V : Int);
procedure Init_Component_Bit_Offset (Id : E; V : Int);
@ -6489,6 +6554,11 @@ 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_Full_View (T : Entity_Id) return Entity_Id;
-- If T is an incomplete type and the full declaration has been
-- seen, or is the name of a class_wide type whose root is incomplete.
-- return the corresponding full declaration.
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).
@ -6666,12 +6736,14 @@ package Einfo is
pragma Inline (Has_Convention_Pragma);
pragma Inline (Has_Delayed_Freeze);
pragma Inline (Has_Discriminants);
pragma Inline (Has_Dispatch_Table);
pragma Inline (Has_Enumeration_Rep_Clause);
pragma Inline (Has_Exit);
pragma Inline (Has_External_Tag_Rep_Clause);
pragma Inline (Has_Fully_Qualified_Name);
pragma Inline (Has_Gigi_Rep_Item);
pragma Inline (Has_Homonym);
pragma Inline (Has_Initial_Value);
pragma Inline (Has_Machine_Radix_Clause);
pragma Inline (Has_Master_Entity);
pragma Inline (Has_Missing_Return);
@ -6685,6 +6757,7 @@ package Einfo is
pragma Inline (Has_Pragma_Elaborate_Body);
pragma Inline (Has_Pragma_Inline);
pragma Inline (Has_Pragma_Pack);
pragma Inline (Has_Pragma_Preelab_Init);
pragma Inline (Has_Pragma_Pure);
pragma Inline (Has_Pragma_Pure_Function);
pragma Inline (Has_Pragma_Unreferenced);
@ -6812,6 +6885,7 @@ package Einfo is
pragma Inline (Is_Packed_Array_Type);
pragma Inline (Is_Potentially_Use_Visible);
pragma Inline (Is_Preelaborated);
pragma Inline (Is_Primitive);
pragma Inline (Is_Primitive_Wrapper);
pragma Inline (Is_Private_Composite);
pragma Inline (Is_Private_Descendant);
@ -6940,6 +7014,7 @@ package Einfo is
pragma Inline (Underlying_Full_View);
pragma Inline (Universal_Aliasing);
pragma Inline (Unset_Reference);
pragma Inline (Used_As_Generic_Actual);
pragma Inline (Uses_Sec_Stack);
pragma Inline (Vax_Float);
pragma Inline (Warnings_Off);
@ -7061,12 +7136,14 @@ package Einfo is
pragma Inline (Set_Has_Convention_Pragma);
pragma Inline (Set_Has_Delayed_Freeze);
pragma Inline (Set_Has_Discriminants);
pragma Inline (Set_Has_Dispatch_Table);
pragma Inline (Set_Has_Enumeration_Rep_Clause);
pragma Inline (Set_Has_Exit);
pragma Inline (Set_Has_External_Tag_Rep_Clause);
pragma Inline (Set_Has_Fully_Qualified_Name);
pragma Inline (Set_Has_Gigi_Rep_Item);
pragma Inline (Set_Has_Homonym);
pragma Inline (Set_Has_Initial_Value);
pragma Inline (Set_Has_Machine_Radix_Clause);
pragma Inline (Set_Has_Master_Entity);
pragma Inline (Set_Has_Missing_Return);
@ -7080,6 +7157,7 @@ package Einfo is
pragma Inline (Set_Has_Pragma_Elaborate_Body);
pragma Inline (Set_Has_Pragma_Inline);
pragma Inline (Set_Has_Pragma_Pack);
pragma Inline (Set_Has_Pragma_Preelab_Init);
pragma Inline (Set_Has_Pragma_Pure);
pragma Inline (Set_Has_Pragma_Pure_Function);
pragma Inline (Set_Has_Pragma_Unreferenced);
@ -7178,6 +7256,7 @@ package Einfo is
pragma Inline (Set_Is_Packed_Array_Type);
pragma Inline (Set_Is_Potentially_Use_Visible);
pragma Inline (Set_Is_Preelaborated);
pragma Inline (Set_Is_Primitive);
pragma Inline (Set_Is_Primitive_Wrapper);
pragma Inline (Set_Is_Private_Composite);
pragma Inline (Set_Is_Private_Descendant);
@ -7295,6 +7374,7 @@ package Einfo is
pragma Inline (Set_Underlying_Full_View);
pragma Inline (Set_Universal_Aliasing);
pragma Inline (Set_Unset_Reference);
pragma Inline (Set_Used_As_Generic_Actual);
pragma Inline (Set_Uses_Sec_Stack);
pragma Inline (Set_Vax_Float);
pragma Inline (Set_Warnings_Off);

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2007, 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- --
@ -39,7 +39,7 @@ package Sem_Ch6 is
procedure Analyze_Operator_Symbol (N : Node_Id);
procedure Analyze_Parameter_Association (N : Node_Id);
procedure Analyze_Procedure_Call (N : Node_Id);
procedure Analyze_Return_Statement (N : Node_Id);
procedure Analyze_Simple_Return_Statement (N : Node_Id);
procedure Analyze_Subprogram_Declaration (N : Node_Id);
procedure Analyze_Subprogram_Body (N : Node_Id);