-- Start of processing for Analyze_Object_Declaration
begin
+ if Constant_Present (N) then
+ Mutate_Ekind (Id, E_Constant);
+ else
+ Mutate_Ekind (Id, E_Variable);
+ end if;
+
-- There are three kinds of implicit types generated by an
-- object declaration:
T := Find_Type_Of_Object (Object_Definition (N), N);
Set_Etype (Id, T);
- Mutate_Ekind (Id, E_Variable);
goto Leave;
end if;
if Error_Posted (Id) then
Set_Etype (Id, T);
- Mutate_Ekind (Id, E_Variable);
goto Leave;
end if;
end if;
and then In_Subrange_Of (Etype (Entity (E)), T)
then
Set_Is_Known_Valid (Id);
- Mutate_Ekind (Id, E_Constant);
Set_Actual_Subtype (Id, Etype (Entity (E)));
end if;
-- for discriminants and are thus not indefinite.
elsif Is_Unchecked_Union (T) then
- if Constant_Present (N) or else Nkind (E) = N_Function_Call then
- Mutate_Ekind (Id, E_Constant);
- else
- Mutate_Ekind (Id, E_Variable);
- end if;
-
-- If the expression is an aggregate it contains the required
-- discriminant values but it has not been resolved yet, so do
-- it now, and treat it as the initial expression of an object
-- "X : Integer := X;".
if Constant_Present (N) then
- Mutate_Ekind (Id, E_Constant);
Set_Is_True_Constant (Id);
else
- Mutate_Ekind (Id, E_Variable);
if Present (E) then
Set_Has_Initial_Value (Id);
end if;
end if;
if Constant_Present (N) then
- Mutate_Ekind (Id, E_Constant);
Set_Is_True_Constant (Id);
else
- Mutate_Ekind (Id, E_Variable);
-
-- A variable is set as shared passive if it appears in a shared
-- passive package, and is at the outer level. This is not done for
-- entities generated during expansion, because those are always