Commit 4fcf700c by Arnaud Charlet

Minor reformatting and code cleanup.

From-SVN: r244621
parent 0929d66b
...@@ -8073,24 +8073,25 @@ package body Sem_Util is ...@@ -8073,24 +8073,25 @@ package body Sem_Util is
H : out Node_Id; H : out Node_Id;
Use_Full_View : Boolean := False) Use_Full_View : Boolean := False)
is is
function Scalar_Range_Of_Right_View return Node_Id; function Scalar_Range_Of_Type (Typ : Entity_Id) return Node_Id;
-- Call Scalar_Range with argument determined by Use_Full_View -- Obtain the scalar range of type Typ. If flag Use_Full_View is set and
-- parameter. -- Typ qualifies, the scalar range is obtained from the full view of the
-- type.
-------------------------------- --------------------------
-- Scalar_Range_Of_Right_View -- -- Scalar_Range_Of_Type --
-------------------------------- --------------------------
function Scalar_Range_Of_Right_View return Node_Id is function Scalar_Range_Of_Type (Typ : Entity_Id) return Node_Id is
E : Entity_Id := Entity (N); T : Entity_Id := Typ;
begin begin
if Use_Full_View and then Present (Full_View (E)) then if Use_Full_View and then Present (Full_View (T)) then
E := Full_View (E); T := Full_View (T);
end if; end if;
return Scalar_Range (E); return Scalar_Range (T);
end Scalar_Range_Of_Right_View; end Scalar_Range_Of_Type;
-- Local variables -- Local variables
...@@ -8118,16 +8119,18 @@ package body Sem_Util is ...@@ -8118,16 +8119,18 @@ package body Sem_Util is
end if; end if;
elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then
if Error_Posted (Scalar_Range_Of_Right_View) then Rng := Scalar_Range_Of_Type (Entity (N));
if Error_Posted (Rng) then
L := Error; L := Error;
H := Error; H := Error;
elsif Nkind (Scalar_Range_Of_Right_View) = N_Subtype_Indication then elsif Nkind (Rng) = N_Subtype_Indication then
Get_Index_Bounds (Scalar_Range_Of_Right_View, L, H); Get_Index_Bounds (Rng, L, H);
else else
L := Low_Bound (Scalar_Range_Of_Right_View); L := Low_Bound (Rng);
H := High_Bound (Scalar_Range_Of_Right_View); H := High_Bound (Rng);
end if; end if;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment