Commit 13d923cc by Robert Dewar Committed by Arnaud Charlet

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

2010-06-23  Robert Dewar  <dewar@adacore.com>

	* sem_ch6.adb, exp_ch4.adb, s-rannum.ads, sem.adb, sem_ch12.adb: Minor
	reformatting.  Add comments.
	* errout.adb (Finalize): Properly adjust warning count when deleting
	continuations.

From-SVN: r161242
parent 8d66b22a
2010-06-23 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb, exp_ch4.adb, s-rannum.ads, sem.adb, sem_ch12.adb: Minor
reformatting. Add comments.
* errout.adb (Finalize): Properly adjust warning count when deleting
continuations.
2010-06-22 Robert Dewar <dewar@adacore.com> 2010-06-22 Robert Dewar <dewar@adacore.com>
* errout.adb (Finalize): Set Prev pointers. * errout.adb (Finalize): Set Prev pointers.
......
...@@ -1215,6 +1215,23 @@ package body Errout is ...@@ -1215,6 +1215,23 @@ package body Errout is
Nxt : Error_Msg_Id; Nxt : Error_Msg_Id;
F : Error_Msg_Id; F : Error_Msg_Id;
procedure Delete_Warning (E : Error_Msg_Id);
-- Delete a message if not already deleted and adjust warning count
--------------------
-- Delete_Warning --
--------------------
procedure Delete_Warning (E : Error_Msg_Id) is
begin
if not Errors.Table (E).Deleted then
Errors.Table (E).Deleted := True;
Warnings_Detected := Warnings_Detected - 1;
end if;
end Delete_Warning;
-- Start of message for Finalize
begin begin
-- Set Prev pointers -- Set Prev pointers
...@@ -1252,15 +1269,14 @@ package body Errout is ...@@ -1252,15 +1269,14 @@ package body Errout is
and then Warning_Specifically_Suppressed and then Warning_Specifically_Suppressed
(Errors.Table (Cur).Sptr, Errors.Table (Cur).Text) (Errors.Table (Cur).Sptr, Errors.Table (Cur).Text)
then then
Errors.Table (Cur).Deleted := True; Delete_Warning (Cur);
Warnings_Detected := Warnings_Detected - 1;
-- If this is a continuation, delete previous messages -- If this is a continuation, delete previous messages
F := Cur; F := Cur;
while Errors.Table (F).Msg_Cont loop while Errors.Table (F).Msg_Cont loop
F := Errors.Table (F).Prev; F := Errors.Table (F).Prev;
Errors.Table (F).Deleted := True; Delete_Warning (F);
end loop; end loop;
-- Delete any following continuations -- Delete any following continuations
...@@ -1270,7 +1286,7 @@ package body Errout is ...@@ -1270,7 +1286,7 @@ package body Errout is
F := Errors.Table (F).Next; F := Errors.Table (F).Next;
exit when F = No_Error_Msg; exit when F = No_Error_Msg;
exit when not Errors.Table (F).Msg_Cont; exit when not Errors.Table (F).Msg_Cont;
Errors.Table (F).Deleted := True; Delete_Warning (F);
end loop; end loop;
end if; end if;
......
...@@ -3155,9 +3155,10 @@ package body Exp_Ch4 is ...@@ -3155,9 +3155,10 @@ package body Exp_Ch4 is
declare declare
Decl : Node_Id; Decl : Node_Id;
Outer_S : Entity_Id; Outer_S : Entity_Id;
S : Entity_Id := Current_Scope; S : Entity_Id;
begin begin
S := Current_Scope;
while Present (S) and then S /= Standard_Standard loop while Present (S) and then S /= Standard_Standard loop
if Ekind (S) = E_Function then if Ekind (S) = E_Function then
Outer_S := Scope (S); Outer_S := Scope (S);
...@@ -4369,7 +4370,6 @@ package body Exp_Ch4 is ...@@ -4369,7 +4370,6 @@ package body Exp_Ch4 is
-- Start of processing for Expand_N_In -- Start of processing for Expand_N_In
begin begin
if Present (Alternatives (N)) then if Present (Alternatives (N)) then
Remove_Side_Effects (Lop); Remove_Side_Effects (Lop);
Expand_Set_Membership; Expand_Set_Membership;
...@@ -7658,6 +7658,7 @@ package body Exp_Ch4 is ...@@ -7658,6 +7658,7 @@ package body Exp_Ch4 is
procedure Make_Temporary_For_Slice is procedure Make_Temporary_For_Slice is
Decl : Node_Id; Decl : Node_Id;
Ent : constant Entity_Id := Make_Temporary (Loc, 'T', N); Ent : constant Entity_Id := Make_Temporary (Loc, 'T', N);
begin begin
Decl := Decl :=
Make_Object_Declaration (Loc, Make_Object_Declaration (Loc,
...@@ -7793,7 +7794,6 @@ package body Exp_Ch4 is ...@@ -7793,7 +7794,6 @@ package body Exp_Ch4 is
Cons : List_Id; Cons : List_Id;
begin begin
-- Nothing else to do if no change of representation -- Nothing else to do if no change of representation
if Same_Representation (Operand_Type, Target_Type) then if Same_Representation (Operand_Type, Target_Type) then
...@@ -8727,7 +8727,6 @@ package body Exp_Ch4 is ...@@ -8727,7 +8727,6 @@ package body Exp_Ch4 is
procedure Expand_N_Unchecked_Expression (N : Node_Id) is procedure Expand_N_Unchecked_Expression (N : Node_Id) is
Exp : constant Node_Id := Expression (N); Exp : constant Node_Id := Expression (N);
begin begin
Set_Assignment_OK (Exp, Assignment_OK (N) or else Assignment_OK (Exp)); Set_Assignment_OK (Exp, Assignment_OK (N) or else Assignment_OK (Exp));
Rewrite (N, Exp); Rewrite (N, Exp);
...@@ -8751,6 +8750,7 @@ package body Exp_Ch4 is ...@@ -8751,6 +8750,7 @@ package body Exp_Ch4 is
-- an Assignment_OK indication which must be propagated to the operand. -- an Assignment_OK indication which must be propagated to the operand.
if Operand_Type = Target_Type then if Operand_Type = Target_Type then
-- Code duplicates Expand_N_Unchecked_Expression above, factor??? -- Code duplicates Expand_N_Unchecked_Expression above, factor???
if Assignment_OK (N) then if Assignment_OK (N) then
......
...@@ -141,10 +141,13 @@ private ...@@ -141,10 +141,13 @@ private
type Generator is limited record type Generator is limited record
Writable : Writable_Access (Generator'Access); Writable : Writable_Access (Generator'Access);
-- This self reference allows functions to modify Generator arguments -- This self reference allows functions to modify Generator arguments
S : State := (others => 0);
S : State := (others => 0);
-- The shift register, a circular buffer -- The shift register, a circular buffer
I : Integer := N;
I : Integer := N;
-- Current starting position in shift register S (N means uninitialized) -- Current starting position in shift register S (N means uninitialized)
-- We should avoid using the identifier I here ???
end record; end record;
end System.Random_Numbers; end System.Random_Numbers;
...@@ -1727,15 +1727,12 @@ package body Sem is ...@@ -1727,15 +1727,12 @@ package body Sem is
---------------------------- ----------------------------
procedure Do_Unit_And_Dependents (CU : Node_Id; Item : Node_Id) is procedure Do_Unit_And_Dependents (CU : Node_Id; Item : Node_Id) is
Unit_Num : constant Unit_Number_Type := Unit_Num : constant Unit_Number_Type := Get_Cunit_Unit_Number (CU);
Get_Cunit_Unit_Number (CU);
Child : Node_Id; Child : Node_Id;
Parent_CU : Node_Id; Parent_CU : Node_Id;
procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit); procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit);
-- Start of processing for Do_Unit_And_Dependents
begin begin
if not Seen (Unit_Num) then if not Seen (Unit_Num) then
...@@ -1749,7 +1746,6 @@ package body Sem is ...@@ -1749,7 +1746,6 @@ package body Sem is
if not Nkind_In (Item, N_Package_Body, N_Subprogram_Body) if not Nkind_In (Item, N_Package_Body, N_Subprogram_Body)
or else Acts_As_Spec (CU) or else Acts_As_Spec (CU)
then then
if CU = Cunit (Main_Unit) if CU = Cunit (Main_Unit)
and then not Do_Main and then not Do_Main
then then
......
...@@ -10396,7 +10396,7 @@ package body Sem_Ch12 is ...@@ -10396,7 +10396,7 @@ package body Sem_Ch12 is
procedure Mark_Context (Inst_Decl : Node_Id; Gen_Decl : Node_Id) is procedure Mark_Context (Inst_Decl : Node_Id; Gen_Decl : Node_Id) is
Inst_CU : constant Unit_Number_Type := Get_Code_Unit (Inst_Decl); Inst_CU : constant Unit_Number_Type := Get_Code_Unit (Inst_Decl);
Gen_CU : constant Unit_Number_Type := Get_Source_Unit (Gen_Decl); Gen_CU : constant Unit_Number_Type := Get_Source_Unit (Gen_Decl);
Inst : Entity_Id := Cunit_Entity (Inst_CU); Inst : Entity_Id;
Clause : Node_Id; Clause : Node_Id;
begin begin
...@@ -10420,11 +10420,12 @@ package body Sem_Ch12 is ...@@ -10420,11 +10420,12 @@ package body Sem_Ch12 is
-- If the with-clause for the generic unit was not found, it must -- If the with-clause for the generic unit was not found, it must
-- appear in some ancestor of the current unit. -- appear in some ancestor of the current unit.
Inst := Cunit_Entity (Inst_CU);
while Is_Child_Unit (Inst) loop while Is_Child_Unit (Inst) loop
Inst := Scope (Inst); Inst := Scope (Inst);
Clause := Clause :=
First (Context_Items (Parent (Unit_Declaration_Node (Inst)))); First (Context_Items (Parent (Unit_Declaration_Node (Inst))));
while Present (Clause) loop while Present (Clause) loop
if Nkind (Clause) = N_With_Clause if Nkind (Clause) = N_With_Clause
and then Library_Unit (Clause) = Cunit (Gen_CU) and then Library_Unit (Clause) = Cunit (Gen_CU)
......
...@@ -110,7 +110,8 @@ package body Sem_Ch6 is ...@@ -110,7 +110,8 @@ package body Sem_Ch6 is
-- outer homographs. -- outer homographs.
procedure Analyze_Subprogram_Body_Helper (N : Node_Id); procedure Analyze_Subprogram_Body_Helper (N : Node_Id);
-- Does all the real work of Analyze_Subprogram_Body -- Does all the real work of Analyze_Subprogram_Body. This is split out so
-- that we can use RETURN but not skip the debug output at the end.
procedure Analyze_Generic_Subprogram_Body (N : Node_Id; Gen_Id : Entity_Id); procedure Analyze_Generic_Subprogram_Body (N : Node_Id; Gen_Id : Entity_Id);
-- Analyze a generic subprogram body. N is the body to be analyzed, and -- Analyze a generic subprogram body. N is the body to be analyzed, and
...@@ -978,6 +979,7 @@ package body Sem_Ch6 is ...@@ -978,6 +979,7 @@ package body Sem_Ch6 is
if Style_Check then if Style_Check then
Style.Check_Identifier (Body_Id, Gen_Id); Style.Check_Identifier (Body_Id, Gen_Id);
end if; end if;
End_Generic; End_Generic;
end Analyze_Generic_Subprogram_Body; end Analyze_Generic_Subprogram_Body;
......
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