At the beginning of Analyze_Attribute routine we analyze the attribute
prefix. There is no need to repeat this analysis in branches for
individual attributes.
Code cleanup related to various Analyze/Resolve routines.
gcc/ada/
* sem_attr.adb (Analyze_Attribute): Remove calls to Analyze for
attributes Identity, Priority, Ref, Restriction_Set, To_Address
and for tasking-related attributes Callable, Terminated and
Storage_Size.
procedure Check_Task_Prefix is
begin
- Analyze (P);
-
-- Ada 2005 (AI-345): Attribute 'Terminated can be applied to
-- task interface class-wide types.
when Attribute_Identity =>
Check_E0;
- Analyze (P);
if Etype (P) = Standard_Exception_Type then
Set_Etype (N, RTE (RE_Exception_Id));
-- The prefix must be a protected object (AARM D.5.2 (2/2))
- Analyze (P);
-
if Is_Protected_Type (Etype (P))
or else (Is_Access_Type (Etype (P))
and then Is_Protected_Type (Designated_Type (Etype (P))))
when Attribute_Ref =>
Check_E1;
- Analyze (P);
if Nkind (P) /= N_Expanded_Name
or else not Is_RTE (P_Type, RE_Address)
begin
Check_E1;
- Analyze (P);
Check_System_Prefix;
-- No_Dependence case
Val : Uint;
begin
Check_E1;
- Analyze (P);
Check_System_Prefix;
Generate_Reference (RTE (RE_Address), P);