Commit 34557478 by Hristian Kirtchev Committed by Arnaud Charlet

bindgen.adb, [...]: Minor reformatting.

2016-06-16  Hristian Kirtchev  <kirtchev@adacore.com>

	* bindgen.adb, exp_util.adb, sem_ch9.adb, sem_util.adb: Minor
	reformatting.

From-SVN: r237510
parent 3ab53b0d
2016-06-16 Hristian Kirtchev <kirtchev@adacore.com>
* bindgen.adb, exp_util.adb, sem_ch9.adb, sem_util.adb: Minor
reformatting.
2016-06-16 Gary Dismukes <dismukes@adacore.com> 2016-06-16 Gary Dismukes <dismukes@adacore.com>
* sem_ch9.adb, sem_util.ads, sem_res.adb: Minor reformatting and typo * sem_ch9.adb, sem_util.ads, sem_res.adb: Minor reformatting and typo
......
...@@ -931,11 +931,12 @@ package body Bindgen is ...@@ -931,11 +931,12 @@ package body Bindgen is
Gen_Elab_Calls; Gen_Elab_Calls;
if not CodePeer_Mode then if not CodePeer_Mode then
-- Call System.Elaboration_Allocators.Mark_Start_Of_Elaboration if -- Call System.Elaboration_Allocators.Mark_Start_Of_Elaboration if
-- restriction No_Standard_Allocators_After_Elaboration is active. -- restriction No_Standard_Allocators_After_Elaboration is active.
if Cumulative_Restrictions.Set if Cumulative_Restrictions.Set
(No_Standard_Allocators_After_Elaboration) (No_Standard_Allocators_After_Elaboration)
then then
WBI WBI
(" System.Elaboration_Allocators.Mark_End_Of_Elaboration;"); (" System.Elaboration_Allocators.Mark_End_Of_Elaboration;");
......
...@@ -4721,8 +4721,8 @@ package body Exp_Util is ...@@ -4721,8 +4721,8 @@ package body Exp_Util is
begin begin
-- When a function call appears in Object.Operation format, the -- When a function call appears in Object.Operation format, the
-- original representation has three possible forms depending on the -- original representation has several possible forms depending on
-- availability and form of actual parameters: -- the availability and form of actual parameters:
-- Obj.Func N_Selected_Component -- Obj.Func N_Selected_Component
-- Obj.Func (Actual) N_Indexed_Component -- Obj.Func (Actual) N_Indexed_Component
......
...@@ -1986,10 +1986,10 @@ package body Sem_Ch9 is ...@@ -1986,10 +1986,10 @@ package body Sem_Ch9 is
end if; end if;
Set_Ekind (T, E_Protected_Type); Set_Ekind (T, E_Protected_Type);
Set_Is_First_Subtype (T, True); Set_Is_First_Subtype (T);
Init_Size_Align (T); Init_Size_Align (T);
Set_Etype (T, T); Set_Etype (T, T);
Set_Has_Delayed_Freeze (T, True); Set_Has_Delayed_Freeze (T);
Set_Stored_Constraint (T, No_Elist); Set_Stored_Constraint (T, No_Elist);
-- Mark this type as a protected type for the sake of restrictions, -- Mark this type as a protected type for the sake of restrictions,
...@@ -2004,9 +2004,9 @@ package body Sem_Ch9 is ...@@ -2004,9 +2004,9 @@ package body Sem_Ch9 is
if In_Private_Part (Current_Scope) if In_Private_Part (Current_Scope)
and then Is_Internal_File_Name (Unit_File_Name (Current_Sem_Unit)) and then Is_Internal_File_Name (Unit_File_Name (Current_Sem_Unit))
then then
Set_Has_Protected (T, False); Set_Has_Protected (T, False);
else else
Set_Has_Protected (T, True); Set_Has_Protected (T);
end if; end if;
-- Set the SPARK_Mode from the current context (may be overwritten later -- Set the SPARK_Mode from the current context (may be overwritten later
......
...@@ -10391,39 +10391,49 @@ package body Sem_Util is ...@@ -10391,39 +10391,49 @@ package body Sem_Util is
---------------------------------- ----------------------------------
procedure Replace_Null_By_Null_Address (N : Node_Id) is procedure Replace_Null_By_Null_Address (N : Node_Id) is
procedure Replace_Null_Operand (Op : Node_Id; Other_Op : Node_Id);
-- Replace operand Op with a reference to Null_Address when the operand
-- denotes a null Address. Other_Op denotes the other operand.
--------------------------
-- Replace_Null_Operand --
--------------------------
procedure Replace_Null_Operand (Op : Node_Id; Other_Op : Node_Id) is
begin
-- Check the type of the complementary operand since the N_Null node
-- has not been decorated yet.
if Nkind (Op) = N_Null
and then Is_Descendant_Of_Address (Etype (Other_Op))
then
Rewrite (Op, New_Occurrence_Of (RTE (RE_Null_Address), Sloc (Op)));
end if;
end Replace_Null_Operand;
-- Start of processing for Replace_Null_By_Null_Address
begin begin
pragma Assert (Relaxed_RM_Semantics); pragma Assert (Relaxed_RM_Semantics);
pragma Assert pragma Assert (Nkind_In (N, N_Null,
(Nkind (N) = N_Null N_Op_Eq,
or else Nkind_In (N, N_Op_Eq, N_Op_Ne) N_Op_Ge,
or else Nkind_In (N, N_Op_Lt, N_Op_Le, N_Op_Gt, N_Op_Ge)); N_Op_Gt,
N_Op_Le,
N_Op_Lt,
N_Op_Ne));
if Nkind (N) = N_Null then if Nkind (N) = N_Null then
Rewrite (N, Rewrite (N, New_Occurrence_Of (RTE (RE_Null_Address), Sloc (N)));
New_Occurrence_Of (RTE (RE_Null_Address), Sloc (N)));
else else
declare declare
L : constant Node_Id := Left_Opnd (N); L : constant Node_Id := Left_Opnd (N);
R : constant Node_Id := Right_Opnd (N); R : constant Node_Id := Right_Opnd (N);
begin begin
-- We check the Etype of the complementary operand since the Replace_Null_Operand (L, Other_Op => R);
-- N_Null node is not decorated at this stage. Replace_Null_Operand (R, Other_Op => L);
if Nkind (L) = N_Null
and then Is_Descendant_Of_Address (Etype (R))
then
Rewrite (L,
New_Occurrence_Of (RTE (RE_Null_Address), Sloc (L)));
end if;
if Nkind (R) = N_Null
and then Is_Descendant_Of_Address (Etype (L))
then
Rewrite (R,
New_Occurrence_Of (RTE (RE_Null_Address), Sloc (R)));
end if;
end; end;
end if; end if;
end Replace_Null_By_Null_Address; end Replace_Null_By_Null_Address;
...@@ -17535,7 +17545,8 @@ package body Sem_Util is ...@@ -17535,7 +17545,8 @@ package body Sem_Util is
function Null_To_Null_Address_Convert_OK function Null_To_Null_Address_Convert_OK
(N : Node_Id; (N : Node_Id;
Typ : Entity_Id := Empty) return Boolean is Typ : Entity_Id := Empty) return Boolean
is
begin begin
if not Relaxed_RM_Semantics then if not Relaxed_RM_Semantics then
return False; return False;
...@@ -17544,8 +17555,7 @@ package body Sem_Util is ...@@ -17544,8 +17555,7 @@ package body Sem_Util is
if Nkind (N) = N_Null then if Nkind (N) = N_Null then
return Present (Typ) and then Is_Descendant_Of_Address (Typ); return Present (Typ) and then Is_Descendant_Of_Address (Typ);
elsif Nkind_In (N, N_Op_Eq, N_Op_Ne) elsif Nkind_In (N, N_Op_Eq, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt, N_Op_Ne)
or else Nkind_In (N, N_Op_Lt, N_Op_Le, N_Op_Gt, N_Op_Ge)
then then
declare declare
L : constant Node_Id := Left_Opnd (N); L : constant Node_Id := Left_Opnd (N);
......
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