(T : Entity_Id) return Boolean
is
Constraint : Elmt_Id;
+ Discr : Entity_Id;
begin
if Has_Discriminants (T)
and then Present (Discriminant_Constraint (T))
and then Present (First_Component (T))
then
+ Discr := First_Discriminant (T);
+
+ if Is_Access_Type (Etype (Discr)) then
+ null;
+
+ -- If the bounds of the discriminant are not compile-time known,
+ -- treat this as non-static, even if the value of the discriminant
+ -- is compile-time known, because the back-end treats aggregates
+ -- of such a subtype as having unknown size.
+
+ elsif not
+ (Compile_Time_Known_Value (Type_Low_Bound (Etype (Discr)))
+ and then
+ Compile_Time_Known_Value (Type_High_Bound (Etype (Discr))))
+ then
+ return False;
+ end if;
+
Constraint := First_Elmt (Discriminant_Constraint (T));
while Present (Constraint) loop
if not Compile_Time_Known_Value (Node (Constraint)) then
Name_Buffer (1 .. Name_Len);
begin
-
Component_Elmt := First_Elmt (Elements);
-
while Nr_Of_Suggestions <= Max_Suggestions
and then Present (Component_Elmt)
loop
-
Get_Name_String (Chars (Node (Component_Elmt)));
if Is_Bad_Spelling_Of (Name_Buffer (1 .. Name_Len), S) then
elsif Nkind (V) /= N_Integer_Literal then
return;
+
+ elsif Is_Access_Type (Etype (Disc)) then
+ null;
+
+ -- If the bounds of the discriminant type are not compile time known,
+ -- the back-end will treat this as a variable-size object.
+
+ elsif not
+ (Compile_Time_Known_Value (Type_Low_Bound (Etype (Disc)))
+ and then
+ Compile_Time_Known_Value (Type_High_Bound (Etype (Disc))))
+ then
+ return;
end if;
Comp := First_Component (T);
-
while Present (Comp) loop
-
if Is_Scalar_Type (Etype (Comp)) then
null;
null;
elsif Is_Array_Type (Etype (Comp)) then
-
if Is_Bit_Packed_Array (Etype (Comp)) then
return;
end if;
Ind := First_Index (Etype (Comp));
-
while Present (Ind) loop
-
if Nkind (Ind) /= N_Range
or else Nkind (Low_Bound (Ind)) /= N_Integer_Literal
or else Nkind (High_Bound (Ind)) /= N_Integer_Literal
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
-
Prev_Nb_Discrete_Choices := Nb_Discrete_Choices;
Choice := First (Choices (Assoc));
loop
elsif Nkind (A) /= N_Aggregate then
if Is_Overloaded (A) then
A_Type := Any_Type;
- Get_First_Interp (A, I, It);
+ Get_First_Interp (A, I, It);
while Present (It.Typ) loop
-
if Is_Tagged_Type (It.Typ)
and then not Is_Limited_Type (It.Typ)
then
if Is_Array_Type (Expr_Type) then
declare
- Index : Node_Id := First_Index (Expr_Type);
+ Index : Node_Id;
-- Range of the current constrained index in the array
Orig_Index : Node_Id := First_Index (Etype (Component));
-- range checks.
begin
+ Index := First_Index (Expr_Type);
while Present (Index) loop
if Depends_On_Discriminant (Orig_Index) then
Apply_Range_Check (Index, Etype (Unconstr_Index));
Parent_Typ := Base_Type (Typ);
while Parent_Typ /= Root_Typ loop
-
Prepend_Elmt (Parent_Typ, To => Parent_Typ_List);
Parent_Typ := Etype (Parent_Typ);
begin
K := L;
-
while K /= U loop
T := Case_Table (K + 1);
- J := K + 1;
+ J := K + 1;
while J /= L
and then Expr_Value (Case_Table (J - 1).Choice_Lo) >
Expr_Value (T.Choice_Lo)