This patch does not change the behavior of the compiler and is
intended as a readability improvement.
gcc/ada/
* sem_ch3.adb (Replace_Type): Use existing constant wherever
possible.
-- of the parent, and we can also use it rather than its base,
-- which can lead to more efficient code.
- if Etype (Id) = Parent_Type then
+ if Id_Type = Parent_Type then
if Is_Scalar_Type (Parent_Type)
and then
Subtypes_Statically_Compatible (Parent_Type, Derived_Type)
end if;
else
- Set_Etype (New_Id, Etype (Id));
+ Set_Etype (New_Id, Id_Type);
end if;
end Replace_Type;