exp_attr.adb (N_Pragma): Chars field removed.

2008-03-26  Javier Miranda  <miranda@adacore.com>
	    Robert Dewar  <dewar@adacore.com>

	* exp_attr.adb (N_Pragma): Chars field removed.
	(Expand_N_Attribute_Reference): If the designated type associated with
	attribute 'Unrestricted_Access is a subprogram entity then replace it
	by an E_Subprogram_Type itype.
	Implement attribute Old

	* sem_attr.ads (Attribute_Class_Array): Move to snames.ads

	* sem_attr.adb (Build_Access_Subprogram_Itype): Add documentation.
	Replace call to
	New_Internal_Entity by call to Create_Itype to centralize calls
	building itypes, ad propagate the convention of the designated
	subprogram. In addition, disable the machinery cleaning constant
	indications from all entities in current scope when 'Unrestricted_Access
	corresponds with a node initializing a dispatch table slot.
	(Analyze_Attribute): Parameterless attributes returning a string or a
	type will not be called with improper arguments, so we can remove junk
	code that was dealing with this case.
	Implement attribute Old

	* snames.ads, snames.h, snames.adb: Add entries for attribute Old
	Add entry for pragma Optimize_Alignment
	New standard names Sync and Synchronize

From-SVN: r133559
This commit is contained in:
Javier Miranda 2008-03-26 08:38:16 +01:00 committed by Arnaud Charlet
parent acf63f8c06
commit e10dab7f8d
5 changed files with 1141 additions and 927 deletions

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2008, 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- --
@ -49,6 +49,7 @@ with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch7; use Sem_Ch7;
with Sem_Ch8; use Sem_Ch8;
with Sem_Eval; use Sem_Eval;
@ -611,6 +612,121 @@ package body Exp_Attr is
Ref_Object : constant Node_Id := Get_Referenced_Object (Pref);
begin
-- In order to improve the text of error messages, the designated
-- type of access-to-subprogram itypes is set by the semantics as
-- the associated subprogram entity (see sem_attr). Now we replace
-- such node with the proper E_Subprogram_Type itype.
if Id = Attribute_Unrestricted_Access
and then Is_Subprogram (Directly_Designated_Type (Typ))
then
-- The following assertion ensures that this special management
-- is done only for "Address!(Prim'Unrestricted_Access)" nodes.
-- At this stage other cases in which the designated type is
-- still a subprogram (instead of an E_Subprogram_Type) are
-- wrong because the semantics must have overriden the type of
-- the node with the type imposed by the context.
pragma Assert (Nkind (Parent (N)) = N_Unchecked_Type_Conversion
and then Etype (Parent (N)) = RTE (RE_Address));
declare
Subp : constant Entity_Id := Directly_Designated_Type (Typ);
Extra : Entity_Id := Empty;
New_Formal : Entity_Id;
Old_Formal : Entity_Id := First_Formal (Subp);
Subp_Typ : Entity_Id;
begin
Subp_Typ := Create_Itype (E_Subprogram_Type, N);
Set_Etype (Subp_Typ, Etype (Subp));
Set_Returns_By_Ref (Subp_Typ, Returns_By_Ref (Subp));
if Present (Old_Formal) then
New_Formal := New_Copy (Old_Formal);
Set_First_Entity (Subp_Typ, New_Formal);
loop
Set_Scope (New_Formal, Subp_Typ);
-- Handle itypes
if Is_Itype (Etype (New_Formal)) then
Extra := New_Copy (Etype (New_Formal));
if Ekind (Extra) = E_Record_Subtype
or else Ekind (Extra) = E_Class_Wide_Subtype
then
Set_Cloned_Subtype (Extra,
Etype (New_Formal));
end if;
Set_Etype (New_Formal, Extra);
Set_Scope (Etype (New_Formal), Subp_Typ);
end if;
Extra := New_Formal;
Next_Formal (Old_Formal);
exit when No (Old_Formal);
Set_Next_Entity (New_Formal,
New_Copy (Old_Formal));
Next_Entity (New_Formal);
end loop;
Set_Next_Entity (New_Formal, Empty);
Set_Last_Entity (Subp_Typ, Extra);
end if;
-- Now that the explicit formals have been duplicated,
-- any extra formals needed by the subprogram must be
-- created.
if Present (Extra) then
Set_Extra_Formal (Extra, Empty);
end if;
Create_Extra_Formals (Subp_Typ);
Set_Directly_Designated_Type (Typ, Subp_Typ);
-- Complete decoration of access-to-subprogram itype to
-- indicate to the backend that this itype corresponds to
-- a statically allocated dispatch table.
-- ??? more comments on structure here, three level parent
-- references are worrisome!
if Nkind (Ref_Object) in N_Has_Entity
and then Is_Dispatching_Operation (Entity (Ref_Object))
and then Present (Parent (Parent (N)))
and then Nkind (Parent (Parent (N))) = N_Aggregate
and then Present (Parent (Parent (Parent (N))))
then
declare
P : constant Node_Id :=
Parent (Parent (Parent (N)));
Prim : constant Entity_Id := Entity (Ref_Object);
begin
Set_Is_Static_Dispatch_Table_Entity (Typ,
(Is_Predefined_Dispatching_Operation (Prim)
and then Nkind (P) = N_Object_Declaration
and then Is_Static_Dispatch_Table_Entity
(Defining_Identifier (P)))
or else
(not Is_Predefined_Dispatching_Operation (Prim)
and then Nkind (P) = N_Aggregate
and then Present (Parent (P))
and then Nkind (Parent (P))
= N_Object_Declaration
and then Is_Static_Dispatch_Table_Entity
(Defining_Identifier (Parent (P)))));
end;
end if;
end;
end if;
if Is_Access_Protected_Subprogram_Type (Btyp) then
Expand_Access_To_Protected_Op (N, Pref, Typ);
@ -1208,18 +1324,20 @@ package body Exp_Attr is
-- Protected case
if Is_Protected_Type (Conctype) then
if Abort_Allowed
or else Restriction_Active (No_Entry_Queue) = False
or else Number_Entries (Conctype) > 1
then
Name :=
New_Reference_To
(RTE (RE_Protected_Entry_Caller), Loc);
else
Name :=
New_Reference_To
(RTE (RE_Protected_Single_Entry_Caller), Loc);
end if;
case Corresponding_Runtime_Package (Conctype) is
when System_Tasking_Protected_Objects_Entries =>
Name :=
New_Reference_To
(RTE (RE_Protected_Entry_Caller), Loc);
when System_Tasking_Protected_Objects_Single_Entry =>
Name :=
New_Reference_To
(RTE (RE_Protected_Single_Entry_Caller), Loc);
when others =>
raise Program_Error;
end case;
Rewrite (N,
Unchecked_Convert_To (Id_Kind,
@ -1488,31 +1606,35 @@ package body Exp_Attr is
if Is_Protected_Type (Conctyp) then
if Abort_Allowed
or else Restriction_Active (No_Entry_Queue) = False
or else Number_Entries (Conctyp) > 1
then
Name := New_Reference_To (RTE (RE_Protected_Count), Loc);
case Corresponding_Runtime_Package (Conctyp) is
when System_Tasking_Protected_Objects_Entries =>
Name := New_Reference_To (RTE (RE_Protected_Count), Loc);
Call :=
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Reference_To (
Object_Ref (
Corresponding_Body (Parent (Conctyp))), Loc),
Entry_Index_Expression (
Loc, Entity (Entnam), Index, Scope (Entity (Entnam)))));
else
Name := New_Reference_To (RTE (RE_Protected_Count_Entry), Loc);
Call :=
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Reference_To (
Object_Ref (
Corresponding_Body (Parent (Conctyp))), Loc),
Entry_Index_Expression (Loc,
Entity (Entnam), Index, Scope (Entity (Entnam)))));
Call := Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Reference_To (
Object_Ref (
Corresponding_Body (Parent (Conctyp))), Loc)));
end if;
when System_Tasking_Protected_Objects_Single_Entry =>
Name := New_Reference_To
(RTE (RE_Protected_Count_Entry), Loc);
Call :=
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Reference_To (
Object_Ref (
Corresponding_Body (Parent (Conctyp))), Loc)));
when others =>
raise Program_Error;
end case;
-- Task case
@ -2726,6 +2848,41 @@ package body Exp_Attr is
-- The processing for Object_Size shares the processing for Size
---------
-- Old --
---------
when Attribute_Old => Old : declare
Tnn : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
Subp : Node_Id;
Asn_Stm : Node_Id;
begin
Subp := N;
loop
Subp := Parent (Subp);
exit when Nkind (Subp) = N_Subprogram_Body;
end loop;
Asn_Stm :=
Make_Object_Declaration (Loc,
Defining_Identifier => Tnn,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Etype (N), Loc),
Expression => Pref);
if Is_Empty_List (Declarations (Subp)) then
Set_Declarations (Subp, New_List (Asn_Stm));
Analyze (Asn_Stm);
else
Insert_Action (First (Declarations (Subp)), Asn_Stm);
end if;
Rewrite (N, New_Occurrence_Of (Tnn, Loc));
end Old;
------------
-- Output --
------------
@ -5177,8 +5334,9 @@ package body Exp_Attr is
N := First_Rep_Item (Implementation_Base_Type (T));
while Present (N) loop
if Nkind (N) = N_Pragma and then Chars (N) = Name_Stream_Convert then
if Nkind (N) = N_Pragma
and then Pragma_Name (N) = Name_Stream_Convert
then
-- For tagged types this pragma is not inherited, so we
-- must verify that it is defined for the given type and
-- not an ancestor.

View File

@ -35,6 +35,7 @@ with Exp_Dist; use Exp_Dist;
with Exp_Util; use Exp_Util;
with Expander; use Expander;
with Freeze; use Freeze;
with Itypes; use Itypes;
with Lib; use Lib;
with Lib.Xref; use Lib.Xref;
with Nlists; use Nlists;
@ -447,18 +448,41 @@ package body Sem_Attr is
-- subprogram itself as the designated type. Type-checking in
-- this case compares the signatures of the designated types.
-- Note: This fragment of the tree is temporarily malformed
-- because the correct tree requires an E_Subprogram_Type entity
-- as the designated type. In most cases this designated type is
-- later overriden by the semantics with the type imposed by the
-- context during the resolution phase. In the specific case of
-- the expression Address!(Prim'Unrestricted_Access), used to
-- initialize slots of dispatch tables, this work will be done by
-- the expander (see Exp_Aggr).
-- The reason to temporarily add this kind of node to the tree
-- instead of a proper E_Subprogram_Type itype, is the following:
-- in case of errors found in the source file we report better
-- error messages. For example, instead of generating the
-- following error:
-- "expected access to subprogram with profile
-- defined at line X"
-- we currently generate:
-- "expected access to function Z defined at line X"
Set_Etype (N, Any_Type);
if not Is_Overloaded (P) then
Check_Local_Access (Entity (P));
if not Is_Intrinsic_Subprogram (Entity (P)) then
Acc_Type :=
New_Internal_Entity
(Get_Kind (Entity (P)), Current_Scope, Loc, 'A');
Acc_Type := Create_Itype (Get_Kind (Entity (P)), N);
Set_Is_Public (Acc_Type, False);
Set_Etype (Acc_Type, Acc_Type);
Set_Convention (Acc_Type, Convention (Entity (P)));
Set_Directly_Designated_Type (Acc_Type, Entity (P));
Set_Etype (N, Acc_Type);
Freeze_Before (N, Acc_Type);
end if;
else
@ -467,12 +491,13 @@ package body Sem_Attr is
Check_Local_Access (It.Nam);
if not Is_Intrinsic_Subprogram (It.Nam) then
Acc_Type :=
New_Internal_Entity
(Get_Kind (It.Nam), Current_Scope, Loc, 'A');
Acc_Type := Create_Itype (Get_Kind (It.Nam), N);
Set_Is_Public (Acc_Type, False);
Set_Etype (Acc_Type, Acc_Type);
Set_Convention (Acc_Type, Convention (It.Nam));
Set_Directly_Designated_Type (Acc_Type, It.Nam);
Add_One_Interp (N, Acc_Type, Acc_Type);
Freeze_Before (N, Acc_Type);
end if;
Get_Next_Interp (Index, It);
@ -502,9 +527,7 @@ package body Sem_Attr is
(Nkind (Par) = N_Component_Association
or else Nkind (Par) in N_Subexpr)
loop
if Nkind (Par) = N_Aggregate
or else Nkind (Par) = N_Extension_Aggregate
then
if Nkind_In (Par, N_Aggregate, N_Extension_Aggregate) then
if Etype (Par) = Typ then
Set_Has_Self_Reference (Par);
return True;
@ -552,7 +575,23 @@ package body Sem_Attr is
-- could modify local variables to be passed out of scope
if Aname = Name_Unrestricted_Access then
Kill_Current_Values;
-- Do not kill values on nodes initializing dispatch tables
-- slots. The construct Address!(Prim'Unrestricted_Access)
-- is currently generated by the expander only for this
-- purpose. Done to keep the quality of warnings currently
-- generated by the compiler (otherwise any declaration of
-- a tagged type cleans constant indications from its scope).
if Nkind (Parent (N)) = N_Unchecked_Type_Conversion
and then Etype (Parent (N)) = RTE (RE_Address)
and then Is_Dispatching_Operation
(Directly_Designated_Type (Etype (N)))
then
null;
else
Kill_Current_Values;
end if;
end if;
return;
@ -626,10 +665,9 @@ package body Sem_Attr is
if not In_Default_Expression
and then not Has_Completion (Scop)
and then
Nkind (Parent (N)) /= N_Discriminant_Association
and then
Nkind (Parent (N)) /= N_Index_Or_Discriminant_Constraint
and then not
Nkind_In (Parent (N), N_Discriminant_Association,
N_Index_Or_Discriminant_Constraint)
then
Error_Msg_N
("current instance attribute must appear alone", N);
@ -726,8 +764,8 @@ package body Sem_Attr is
Kill_Current_Values (Ent);
exit;
elsif Nkind (PP) = N_Selected_Component
or else Nkind (PP) = N_Indexed_Component
elsif Nkind_In (PP, N_Selected_Component,
N_Indexed_Component)
then
PP := Prefix (PP);
@ -1414,8 +1452,8 @@ package body Sem_Attr is
null;
elsif Is_List_Member (N)
and then Nkind (Parent (N)) /= N_Procedure_Call_Statement
and then Nkind (Parent (N)) /= N_Aggregate
and then not Nkind_In (Parent (N), N_Procedure_Call_Statement,
N_Aggregate)
then
null;
@ -2145,9 +2183,7 @@ package body Sem_Attr is
-- or of a variable of the enclosing task type.
else
if Nkind (Pref) = N_Identifier
or else Nkind (Pref) = N_Expanded_Name
then
if Nkind_In (Pref, N_Identifier, N_Expanded_Name) then
Ent := Entity (Pref);
if not OK_Entry (Ent)
@ -2297,9 +2333,7 @@ package body Sem_Attr is
begin
Check_E0;
if Nkind (P) = N_Identifier
or else Nkind (P) = N_Expanded_Name
then
if Nkind_In (P, N_Identifier, N_Expanded_Name) then
Ent := Entity (P);
if not Is_Entry (Ent) then
@ -2500,9 +2534,7 @@ package body Sem_Attr is
begin
Check_E0;
if Nkind (P) = N_Identifier
or else Nkind (P) = N_Expanded_Name
then
if Nkind_In (P, N_Identifier, N_Expanded_Name) then
Ent := Entity (P);
if Ekind (Ent) /= E_Entry then
@ -2623,7 +2655,6 @@ package body Sem_Attr is
when Attribute_Default_Bit_Order => Default_Bit_Order :
begin
Check_Standard_Prefix;
Check_E0;
if Bytes_Big_Endian then
Rewrite (N,
@ -2733,7 +2764,6 @@ package body Sem_Attr is
if Nkind (P) /= N_Identifier then
Error_Msg_N ("identifier expected (check name)", P);
elsif Get_Check_Id (Chars (P)) = No_Check_Id then
Error_Msg_N ("& is not a recognized check name", P);
end if;
@ -2802,7 +2832,6 @@ package body Sem_Attr is
---------------
when Attribute_Fast_Math =>
Check_E0;
Check_Standard_Prefix;
if Opt.Fast_Math then
@ -3320,9 +3349,8 @@ package body Sem_Attr is
-- Case of attribute used as actual for subprogram (positional)
elsif (Nkind (Parnt) = N_Procedure_Call_Statement
or else
Nkind (Parnt) = N_Function_Call)
elsif Nkind_In (Parnt, N_Procedure_Call_Statement,
N_Function_Call)
and then Is_Entity_Name (Name (Parnt))
then
Must_Be_Imported (Entity (Name (Parnt)));
@ -3330,9 +3358,8 @@ package body Sem_Attr is
-- Case of attribute used as actual for subprogram (named)
elsif Nkind (Parnt) = N_Parameter_Association
and then (Nkind (GParnt) = N_Procedure_Call_Statement
or else
Nkind (GParnt) = N_Function_Call)
and then Nkind_In (GParnt, N_Procedure_Call_Statement,
N_Function_Call)
and then Is_Entity_Name (Name (GParnt))
then
Must_Be_Imported (Entity (Name (GParnt)));
@ -3343,7 +3370,6 @@ package body Sem_Attr is
Bad_Null_Parameter
("Null_Parameter must be actual or default parameter");
end if;
end Null_Parameter;
-----------------
@ -3356,6 +3382,22 @@ package body Sem_Attr is
Check_Not_Incomplete_Type;
Set_Etype (N, Universal_Integer);
---------
-- Old --
---------
when Attribute_Old =>
Check_E0;
Set_Etype (N, P_Type);
if not Is_Subprogram (Current_Scope) then
Error_Attr ("attribute % can only appear within subprogram", N);
end if;
if Is_Limited_Type (P_Type) then
Error_Attr ("attribute % cannot apply to limited objects", P);
end if;
------------
-- Output --
------------
@ -3370,7 +3412,8 @@ package body Sem_Attr is
-- Partition_ID --
------------------
when Attribute_Partition_ID =>
when Attribute_Partition_ID => Partition_Id :
begin
Check_E0;
if P_Type /= Any_Type then
@ -3378,9 +3421,8 @@ package body Sem_Attr is
Error_Attr_P
("prefix of % attribute must be library-level entity");
-- The defining entity of prefix should not be declared inside
-- a Pure unit. RM E.1(8).
-- The Is_Pure flag has been set during declaration.
-- The defining entity of prefix should not be declared inside a
-- Pure unit. RM E.1(8). Is_Pure was set during declaration.
elsif Is_Entity_Name (P)
and then Is_Pure (Entity (P))
@ -3391,6 +3433,7 @@ package body Sem_Attr is
end if;
Set_Etype (N, Universal_Integer);
end Partition_Id;
-------------------------
-- Passed_By_Reference --
@ -3522,6 +3565,7 @@ package body Sem_Attr is
------------------
when Attribute_Range_Length =>
Check_E0;
Check_Discrete_Type;
Set_Etype (N, Universal_Integer);
@ -3654,7 +3698,8 @@ package body Sem_Attr is
-- Size --
----------
when Attribute_Size | Attribute_VADS_Size =>
when Attribute_Size | Attribute_VADS_Size => Size :
begin
Check_E0;
-- If prefix is parameterless function call, rewrite and resolve
@ -3693,6 +3738,7 @@ package body Sem_Attr is
Check_Not_Incomplete_Type;
Set_Etype (N, Universal_Integer);
end Size;
-----------
-- Small --
@ -3707,10 +3753,11 @@ package body Sem_Attr is
-- Storage_Pool --
------------------
when Attribute_Storage_Pool =>
if Is_Access_Type (P_Type) then
Check_E0;
when Attribute_Storage_Pool => Storage_Pool :
begin
Check_E0;
if Is_Access_Type (P_Type) then
if Ekind (P_Type) = E_Access_Subprogram_Type then
Error_Attr_P
("cannot use % attribute for access-to-subprogram type");
@ -3735,14 +3782,17 @@ package body Sem_Attr is
else
Error_Attr_P ("prefix of % attribute must be access type");
end if;
end Storage_Pool;
------------------
-- Storage_Size --
------------------
when Attribute_Storage_Size =>
when Attribute_Storage_Size => Storage_Size :
begin
Check_E0;
if Is_Task_Type (P_Type) then
Check_E0;
Set_Etype (N, Universal_Integer);
elsif Is_Access_Type (P_Type) then
@ -3754,7 +3804,6 @@ package body Sem_Attr is
if Is_Entity_Name (P)
and then Is_Type (Entity (P))
then
Check_E0;
Check_Type;
Set_Etype (N, Universal_Integer);
@ -3768,7 +3817,6 @@ package body Sem_Attr is
-- of an access value designating a task.
else
Check_E0;
Check_Task_Prefix;
Set_Etype (N, Universal_Integer);
end if;
@ -3776,6 +3824,7 @@ package body Sem_Attr is
else
Error_Attr_P ("prefix of % attribute must be access or task type");
end if;
end Storage_Size;
------------------
-- Storage_Unit --
@ -3845,7 +3894,8 @@ package body Sem_Attr is
-- Tag --
---------
when Attribute_Tag =>
when Attribute_Tag => Tag :
begin
Check_E0;
Check_Dereference;
@ -3875,6 +3925,7 @@ package body Sem_Attr is
-- Set appropriate type
Set_Etype (N, RTE (RE_Tag));
end Tag;
-----------------
-- Target_Name --
@ -3886,7 +3937,6 @@ package body Sem_Attr is
begin
Check_Standard_Prefix;
Check_E0;
TL := TN'Last;
@ -4022,9 +4072,7 @@ package body Sem_Attr is
Negative := False;
end if;
if Nkind (Expr) /= N_Integer_Literal
and then Nkind (Expr) /= N_Real_Literal
then
if not Nkind_In (Expr, N_Integer_Literal, N_Real_Literal) then
Error_Attr
("named number for % attribute must be simple literal", N);
end if;
@ -4987,12 +5035,11 @@ package body Sem_Attr is
then
P_Type := P_Entity;
-- We can fold 'Size applied to a type if the size is known
-- (as happens for a size from an attribute definition clause).
-- At this stage, this can happen only for types (e.g. record
-- types) for which the size is always non-static. We exclude
-- generic types from consideration (since they have bogus
-- sizes set within templates).
-- We can fold 'Size applied to a type if the size is known (as happens
-- for a size from an attribute definition clause). At this stage, this
-- can happen only for types (e.g. record types) for which the size is
-- always non-static. We exclude generic types from consideration (since
-- they have bogus sizes set within templates).
elsif Id = Attribute_Size
and then Is_Type (P_Entity)
@ -6924,6 +6971,7 @@ package body Sem_Attr is
Attribute_Input |
Attribute_Last_Bit |
Attribute_Maximum_Alignment |
Attribute_Old |
Attribute_Output |
Attribute_Partition_ID |
Attribute_Pool_Address |
@ -6961,10 +7009,10 @@ package body Sem_Attr is
-- An exception is the GNAT attribute Constrained_Array which is
-- defined to be a static attribute in all cases.
if Nkind (N) = N_Integer_Literal
or else Nkind (N) = N_Real_Literal
or else Nkind (N) = N_Character_Literal
or else Nkind (N) = N_String_Literal
if Nkind_In (N, N_Integer_Literal,
N_Real_Literal,
N_Character_Literal,
N_String_Literal)
or else (Is_Entity_Name (N)
and then Ekind (Entity (N)) = E_Enumeration_Literal)
then
@ -7060,9 +7108,8 @@ package body Sem_Attr is
if Is_Record_Type (Current_Scope)
and then
(Nkind (Parent (N)) = N_Discriminant_Association
or else
Nkind (Parent (N)) = N_Index_Or_Discriminant_Constraint)
Nkind_In (Parent (N), N_Discriminant_Association,
N_Index_Or_Discriminant_Constraint)
then
Indic := Parent (Parent (N));
while Present (Indic)
@ -7122,7 +7169,8 @@ package body Sem_Attr is
| Attribute_Unchecked_Access
| Attribute_Unrestricted_Access =>
Access_Attribute : begin
Access_Attribute :
begin
if Is_Variable (P) then
Note_Possible_Modification (P);
end if;

View File

@ -206,6 +206,7 @@ package body Snames is
"no_run_time#" &
"no_strict_aliasing#" &
"normalize_scalars#" &
"optimize_alignment#" &
"polling#" &
"persistent_bss#" &
"priority_specific_dispatching#" &
@ -495,6 +496,7 @@ package body Snames is
"modulus#" &
"null_parameter#" &
"object_size#" &
"old#" &
"partition_id#" &
"passed_by_reference#" &
"pool_address#" &
@ -778,6 +780,8 @@ package body Snames is
"stack#" &
"switches#" &
"symbolic_link_supported#" &
"sync#" &
"synchronize#" &
"toolchain_description#" &
"toolchain_version#" &
"runtime_library_dir#" &

File diff suppressed because it is too large Load Diff

View File

@ -111,79 +111,80 @@ extern unsigned char Get_Attribute_Id (int);
#define Attr_Modulus 64
#define Attr_Null_Parameter 65
#define Attr_Object_Size 66
#define Attr_Partition_ID 67
#define Attr_Passed_By_Reference 68
#define Attr_Pool_Address 69
#define Attr_Pos 70
#define Attr_Position 71
#define Attr_Priority 72
#define Attr_Range 73
#define Attr_Range_Length 74
#define Attr_Round 75
#define Attr_Safe_Emax 76
#define Attr_Safe_First 77
#define Attr_Safe_Large 78
#define Attr_Safe_Last 79
#define Attr_Safe_Small 80
#define Attr_Scale 81
#define Attr_Scaling 82
#define Attr_Signed_Zeros 83
#define Attr_Size 84
#define Attr_Small 85
#define Attr_Storage_Size 86
#define Attr_Storage_Unit 87
#define Attr_Stream_Size 88
#define Attr_Tag 89
#define Attr_Target_Name 90
#define Attr_Terminated 91
#define Attr_To_Address 92
#define Attr_Type_Class 93
#define Attr_UET_Address 94
#define Attr_Unbiased_Rounding 95
#define Attr_Unchecked_Access 96
#define Attr_Unconstrained_Array 97
#define Attr_Universal_Literal_String 98
#define Attr_Unrestricted_Access 99
#define Attr_VADS_Size 100
#define Attr_Val 101
#define Attr_Valid 102
#define Attr_Value_Size 103
#define Attr_Version 104
#define Attr_Wchar_T_Size 105
#define Attr_Wide_Wide_Width 106
#define Attr_Wide_Width 107
#define Attr_Width 108
#define Attr_Word_Size 109
#define Attr_Adjacent 110
#define Attr_Ceiling 111
#define Attr_Copy_Sign 112
#define Attr_Floor 113
#define Attr_Fraction 114
#define Attr_Image 115
#define Attr_Input 116
#define Attr_Machine 117
#define Attr_Max 118
#define Attr_Min 119
#define Attr_Model 120
#define Attr_Pred 121
#define Attr_Remainder 122
#define Attr_Rounding 123
#define Attr_Succ 124
#define Attr_Truncation 125
#define Attr_Value 126
#define Attr_Wide_Image 127
#define Attr_Wide_Wide_Image 128
#define Attr_Wide_Value 129
#define Attr_Wide_Wide_Value 130
#define Attr_Output 131
#define Attr_Read 132
#define Attr_Write 133
#define Attr_Elab_Body 134
#define Attr_Elab_Spec 135
#define Attr_Storage_Pool 136
#define Attr_Base 137
#define Attr_Class 138
#define Attr_Stub_Type 139
#define Attr_Old 67
#define Attr_Partition_ID 68
#define Attr_Passed_By_Reference 69
#define Attr_Pool_Address 70
#define Attr_Pos 71
#define Attr_Position 72
#define Attr_Priority 73
#define Attr_Range 74
#define Attr_Range_Length 75
#define Attr_Round 76
#define Attr_Safe_Emax 77
#define Attr_Safe_First 78
#define Attr_Safe_Large 79
#define Attr_Safe_Last 80
#define Attr_Safe_Small 81
#define Attr_Scale 82
#define Attr_Scaling 83
#define Attr_Signed_Zeros 84
#define Attr_Size 85
#define Attr_Small 86
#define Attr_Storage_Size 87
#define Attr_Storage_Unit 88
#define Attr_Stream_Size 89
#define Attr_Tag 90
#define Attr_Target_Name 91
#define Attr_Terminated 92
#define Attr_To_Address 93
#define Attr_Type_Class 94
#define Attr_UET_Address 95
#define Attr_Unbiased_Rounding 96
#define Attr_Unchecked_Access 97
#define Attr_Unconstrained_Array 98
#define Attr_Universal_Literal_String 99
#define Attr_Unrestricted_Access 100
#define Attr_VADS_Size 101
#define Attr_Val 102
#define Attr_Valid 103
#define Attr_Value_Size 104
#define Attr_Version 105
#define Attr_Wchar_T_Size 106
#define Attr_Wide_Wide_Width 107
#define Attr_Wide_Width 108
#define Attr_Width 109
#define Attr_Word_Size 110
#define Attr_Adjacent 111
#define Attr_Ceiling 112
#define Attr_Copy_Sign 113
#define Attr_Floor 114
#define Attr_Fraction 115
#define Attr_Image 116
#define Attr_Input 117
#define Attr_Machine 118
#define Attr_Max 119
#define Attr_Min 120
#define Attr_Model 121
#define Attr_Pred 122
#define Attr_Remainder 123
#define Attr_Rounding 124
#define Attr_Succ 125
#define Attr_Truncation 126
#define Attr_Value 127
#define Attr_Wide_Image 128
#define Attr_Wide_Wide_Image 129
#define Attr_Wide_Value 130
#define Attr_Wide_Wide_Value 131
#define Attr_Output 132
#define Attr_Read 133
#define Attr_Write 134
#define Attr_Elab_Body 135
#define Attr_Elab_Spec 136
#define Attr_Storage_Pool 137
#define Attr_Base 138
#define Attr_Class 139
#define Attr_Stub_Type 140
/* Define the numeric values for the conventions. */
@ -247,138 +248,139 @@ extern unsigned char Get_Pragma_Id (int);
#define Pragma_No_Run_Time 28
#define Pragma_No_Strict_Aliasing 29
#define Pragma_Normalize_Scalars 30
#define Pragma_Polling 31
#define Pragma_Persistent_BSS 32
#define Pragma_Priority_Specific_Dispatching 33
#define Pragma_Profile 34
#define Pragma_Profile_Warnings 35
#define Pragma_Propagate_Exceptions 36
#define Pragma_Queuing_Policy 37
#define Pragma_Ravenscar 38
#define Pragma_Restricted_Run_Time 39
#define Pragma_Restrictions 40
#define Pragma_Restriction_Warnings 41
#define Pragma_Reviewable 42
#define Pragma_Source_File_Name 43
#define Pragma_Source_File_Name_Project 44
#define Pragma_Style_Checks 45
#define Pragma_Suppress 46
#define Pragma_Suppress_Exception_Locations 47
#define Pragma_Task_Dispatching_Policy 48
#define Pragma_Universal_Data 49
#define Pragma_Unsuppress 50
#define Pragma_Use_VADS_Size 51
#define Pragma_Validity_Checks 52
#define Pragma_Warnings 53
#define Pragma_Wide_Character_Encoding 54
#define Pragma_Abort_Defer 55
#define Pragma_All_Calls_Remote 56
#define Pragma_Annotate 57
#define Pragma_Assert 58
#define Pragma_Asynchronous 59
#define Pragma_Atomic 60
#define Pragma_Atomic_Components 61
#define Pragma_Attach_Handler 62
#define Pragma_CIL_Constructor 63
#define Pragma_Comment 64
#define Pragma_Common_Object 65
#define Pragma_Complete_Representation 66
#define Pragma_Complex_Representation 67
#define Pragma_Controlled 68
#define Pragma_Convention 69
#define Pragma_CPP_Class 70
#define Pragma_CPP_Constructor 71
#define Pragma_CPP_Virtual 72
#define Pragma_CPP_Vtable 73
#define Pragma_Debug 74
#define Pragma_Elaborate 75
#define Pragma_Elaborate_All 76
#define Pragma_Elaborate_Body 77
#define Pragma_Export 78
#define Pragma_Export_Exception 79
#define Pragma_Export_Function 80
#define Pragma_Export_Object 81
#define Pragma_Export_Procedure 82
#define Pragma_Export_Value 83
#define Pragma_Export_Valued_Procedure 84
#define Pragma_External 85
#define Pragma_Finalize_Storage_Only 86
#define Pragma_Ident 87
#define Pragma_Implemented_By_Entry 88
#define Pragma_Import 89
#define Pragma_Import_Exception 90
#define Pragma_Import_Function 91
#define Pragma_Import_Object 92
#define Pragma_Import_Procedure 93
#define Pragma_Import_Valued_Procedure 94
#define Pragma_Inline 95
#define Pragma_Inline_Always 96
#define Pragma_Inline_Generic 97
#define Pragma_Inspection_Point 98
#define Pragma_Interface_Name 99
#define Pragma_Interrupt_Handler 100
#define Pragma_Interrupt_Priority 101
#define Pragma_Java_Constructor 102
#define Pragma_Java_Interface 103
#define Pragma_Keep_Names 104
#define Pragma_Link_With 105
#define Pragma_Linker_Alias 106
#define Pragma_Linker_Constructor 107
#define Pragma_Linker_Destructor 108
#define Pragma_Linker_Options 109
#define Pragma_Linker_Section 110
#define Pragma_List 111
#define Pragma_Machine_Attribute 112
#define Pragma_Main 113
#define Pragma_Main_Storage 114
#define Pragma_Memory_Size 115
#define Pragma_No_Body 116
#define Pragma_No_Return 117
#define Pragma_Obsolescent 118
#define Pragma_Optimize 119
#define Pragma_Pack 120
#define Pragma_Page 121
#define Pragma_Passive 122
#define Pragma_Preelaborable_Initialization 123
#define Pragma_Preelaborate 124
#define Pragma_Preelaborate_05 125
#define Pragma_Psect_Object 126
#define Pragma_Pure 127
#define Pragma_Pure_05 128
#define Pragma_Pure_Function 129
#define Pragma_Remote_Call_Interface 130
#define Pragma_Remote_Types 131
#define Pragma_Share_Generic 132
#define Pragma_Shared 133
#define Pragma_Shared_Passive 134
#define Pragma_Source_Reference 135
#define Pragma_Static_Elaboration_Desired 136
#define Pragma_Stream_Convert 137
#define Pragma_Subtitle 138
#define Pragma_Suppress_All 139
#define Pragma_Suppress_Debug_Info 140
#define Pragma_Suppress_Initialization 141
#define Pragma_System_Name 142
#define Pragma_Task_Info 143
#define Pragma_Task_Name 144
#define Pragma_Task_Storage 145
#define Pragma_Time_Slice 146
#define Pragma_Title 147
#define Pragma_Unchecked_Union 148
#define Pragma_Unimplemented_Unit 149
#define Pragma_Universal_Aliasing 150
#define Pragma_Unmodified 151
#define Pragma_Unreferenced 152
#define Pragma_Unreferenced_Objects 153
#define Pragma_Unreserve_All_Interrupts 154
#define Pragma_Volatile 155
#define Pragma_Volatile_Components 156
#define Pragma_Weak_External 157
#define Pragma_AST_Entry 158
#define Pragma_Fast_Math 159
#define Pragma_Interface 160
#define Pragma_Priority 161
#define Pragma_Storage_Size 162
#define Pragma_Storage_Unit 163
#define Pragma_Optimize_Alignment 31
#define Pragma_Polling 32
#define Pragma_Persistent_BSS 33
#define Pragma_Priority_Specific_Dispatching 34
#define Pragma_Profile 35
#define Pragma_Profile_Warnings 36
#define Pragma_Propagate_Exceptions 37
#define Pragma_Queuing_Policy 38
#define Pragma_Ravenscar 39
#define Pragma_Restricted_Run_Time 40
#define Pragma_Restrictions 41
#define Pragma_Restriction_Warnings 42
#define Pragma_Reviewable 43
#define Pragma_Source_File_Name 44
#define Pragma_Source_File_Name_Project 45
#define Pragma_Style_Checks 46
#define Pragma_Suppress 47
#define Pragma_Suppress_Exception_Locations 48
#define Pragma_Task_Dispatching_Policy 49
#define Pragma_Universal_Data 50
#define Pragma_Unsuppress 51
#define Pragma_Use_VADS_Size 52
#define Pragma_Validity_Checks 53
#define Pragma_Warnings 54
#define Pragma_Wide_Character_Encoding 55
#define Pragma_Abort_Defer 56
#define Pragma_All_Calls_Remote 57
#define Pragma_Annotate 58
#define Pragma_Assert 59
#define Pragma_Asynchronous 60
#define Pragma_Atomic 61
#define Pragma_Atomic_Components 62
#define Pragma_Attach_Handler 63
#define Pragma_CIL_Constructor 64
#define Pragma_Comment 65
#define Pragma_Common_Object 66
#define Pragma_Complete_Representation 67
#define Pragma_Complex_Representation 68
#define Pragma_Controlled 69
#define Pragma_Convention 70
#define Pragma_CPP_Class 71
#define Pragma_CPP_Constructor 72
#define Pragma_CPP_Virtual 73
#define Pragma_CPP_Vtable 74
#define Pragma_Debug 75
#define Pragma_Elaborate 76
#define Pragma_Elaborate_All 77
#define Pragma_Elaborate_Body 78
#define Pragma_Export 79
#define Pragma_Export_Exception 80
#define Pragma_Export_Function 81
#define Pragma_Export_Object 82
#define Pragma_Export_Procedure 83
#define Pragma_Export_Value 84
#define Pragma_Export_Valued_Procedure 85
#define Pragma_External 86
#define Pragma_Finalize_Storage_Only 87
#define Pragma_Ident 88
#define Pragma_Implemented_By_Entry 89
#define Pragma_Import 90
#define Pragma_Import_Exception 91
#define Pragma_Import_Function 92
#define Pragma_Import_Object 93
#define Pragma_Import_Procedure 94
#define Pragma_Import_Valued_Procedure 95
#define Pragma_Inline 96
#define Pragma_Inline_Always 97
#define Pragma_Inline_Generic 98
#define Pragma_Inspection_Point 99
#define Pragma_Interface_Name 100
#define Pragma_Interrupt_Handler 101
#define Pragma_Interrupt_Priority 102
#define Pragma_Java_Constructor 103
#define Pragma_Java_Interface 104
#define Pragma_Keep_Names 105
#define Pragma_Link_With 106
#define Pragma_Linker_Alias 107
#define Pragma_Linker_Constructor 108
#define Pragma_Linker_Destructor 109
#define Pragma_Linker_Options 110
#define Pragma_Linker_Section 111
#define Pragma_List 112
#define Pragma_Machine_Attribute 113
#define Pragma_Main 114
#define Pragma_Main_Storage 115
#define Pragma_Memory_Size 116
#define Pragma_No_Body 117
#define Pragma_No_Return 118
#define Pragma_Obsolescent 119
#define Pragma_Optimize 120
#define Pragma_Pack 121
#define Pragma_Page 122
#define Pragma_Passive 123
#define Pragma_Preelaborable_Initialization 124
#define Pragma_Preelaborate 125
#define Pragma_Preelaborate_05 126
#define Pragma_Psect_Object 127
#define Pragma_Pure 128
#define Pragma_Pure_05 129
#define Pragma_Pure_Function 130
#define Pragma_Remote_Call_Interface 131
#define Pragma_Remote_Types 132
#define Pragma_Share_Generic 133
#define Pragma_Shared 134
#define Pragma_Shared_Passive 135
#define Pragma_Source_Reference 136
#define Pragma_Static_Elaboration_Desired 137
#define Pragma_Stream_Convert 138
#define Pragma_Subtitle 139
#define Pragma_Suppress_All 140
#define Pragma_Suppress_Debug_Info 141
#define Pragma_Suppress_Initialization 142
#define Pragma_System_Name 143
#define Pragma_Task_Info 144
#define Pragma_Task_Name 145
#define Pragma_Task_Storage 146
#define Pragma_Time_Slice 147
#define Pragma_Title 148
#define Pragma_Unchecked_Union 149
#define Pragma_Unimplemented_Unit 150
#define Pragma_Universal_Aliasing 151
#define Pragma_Unmodified 152
#define Pragma_Unreferenced 153
#define Pragma_Unreferenced_Objects 154
#define Pragma_Unreserve_All_Interrupts 155
#define Pragma_Volatile 156
#define Pragma_Volatile_Components 157
#define Pragma_Weak_External 158
#define Pragma_AST_Entry 159
#define Pragma_Fast_Math 160
#define Pragma_Interface 161
#define Pragma_Priority 162
#define Pragma_Storage_Size 163
#define Pragma_Storage_Unit 164
/* End of snames.h (C version of Snames package spec) */