Commit a2fcf1e0 by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] Clarify code for accessing full view of a type

2018-05-21  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
	type.
	(Not_Null_Range): Same as above.

From-SVN: r260460
parent 663afa9f
2018-04-04 Piotr Trojanek <trojanek@adacore.com>
* sem_eval.adb (Is_Null_Range): Clarify access to the full view of a
type.
(Not_Null_Range): Same as above.
2018-04-04 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch3.adb: Minor reformatting.
......
......@@ -4767,8 +4767,7 @@ package body Sem_Eval is
and then Compile_Time_Known_Value (Hi)
then
declare
Typ : Entity_Id := Etype (Lo);
Full_Typ : constant Entity_Id := Full_View (Typ);
Typ : Entity_Id := Etype (Lo);
begin
-- When called from the frontend, as part of the analysis of
-- potentially static expressions, Typ will be the full view of a
......@@ -4777,8 +4776,10 @@ package body Sem_Eval is
-- is null, Typ might be a private type and we need to explicitly
-- switch to its corresponding full view to access the same info.
if Present (Full_Typ) then
Typ := Full_Typ;
if Is_Incomplete_Or_Private_Type (Typ)
and then Present (Full_View (Typ))
then
Typ := Full_View (Typ);
end if;
if Is_Discrete_Type (Typ) then
......@@ -5356,8 +5357,7 @@ package body Sem_Eval is
and then Compile_Time_Known_Value (Hi)
then
declare
Typ : Entity_Id := Etype (Lo);
Full_Typ : constant Entity_Id := Full_View (Typ);
Typ : Entity_Id := Etype (Lo);
begin
-- When called from the frontend, as part of the analysis of
-- potentially static expressions, Typ will be the full view of a
......@@ -5366,8 +5366,10 @@ package body Sem_Eval is
-- is null, Typ might be a private type and we need to explicitly
-- switch to its corresponding full view to access the same info.
if Present (Full_Typ) then
Typ := Full_Typ;
if Is_Incomplete_Or_Private_Type (Typ)
and then Present (Full_View (Typ))
then
Typ := Full_View (Typ);
end if;
if Is_Discrete_Type (Typ) then
......
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