gcc/ada/
* einfo-utils.adb (Next_Index): Verify input and output are
N_Is_Index.
* gen_il-gen-gen_nodes.adb (N_Has_Bounds, N_Is_Index): Add.
* gen_il-types.ads (N_Has_Bounds, N_Is_Index): Likewise.
* sem_ch3.adb (Array_Type_Declaration): Use Next, not
Next_Index.
* sem_ch12.adb (Formal_Dimensions): Likewise.
* sem_util.adb (Is_Valid_Renaming): Likewise.
function Next_Index (Id : Node_Id) return Node_Id is
begin
+ pragma Assert (Nkind (Id) in N_Is_Index);
+ pragma Assert (No (Next (Id)) or else Nkind (Next (Id)) in N_Is_Index);
return Next (Id);
end Next_Index;
N_Terminate_Alternative));
-- Nodes with condition fields (does not include N_Raise_xxx_Error)
+ Union (N_Has_Bounds,
+ Children =>
+ (N_Range,
+ N_Real_Range_Specification,
+ N_Signed_Integer_Type_Definition));
+ -- Nodes that have Low_Bound and High_Bound defined
+
+ Union (N_Is_Index,
+ Children =>
+ (N_Has_Bounds,
+ N_Has_Entity,
+ N_Subtype_Indication));
+ -- Nodes that can be an index of an array
end Gen_IL.Gen.Gen_Nodes;
N_Generic_Declaration,
N_Generic_Instantiation,
N_Generic_Renaming_Declaration,
+ N_Has_Bounds,
N_Has_Chars,
+ N_Has_Condition,
N_Has_Entity,
N_Has_Etype,
+ N_Is_Index,
N_Multiplying_Operator,
N_Later_Decl_Item,
N_Membership_Test,
N_Statement_Other_Than_Procedure_Call,
N_Subprogram_Call,
N_Subprogram_Instantiation,
- N_Has_Condition,
N_Subexpr,
N_Subprogram_Specification,
N_Unary_Op,
while Present (Index) loop
Num := Num + 1;
- Next_Index (Index);
+ Next (Index);
end loop;
return Num;
-- Move to next index
- Next_Index (Index);
+ Next (Index);
Nb_Index := Nb_Index + 1;
end loop;
return False;
end if;
- Next_Index (Indx);
+ Next (Indx);
end loop;
end;