Commit 5132708f by Robert Dewar Committed by Arnaud Charlet

einfo.ads, [...]: Minor reformatting

2009-07-20  Robert Dewar  <dewar@adacore.com>

	* einfo.ads, switch.adb, gnatls.adb, inline.adb, sem_ch13.adb: Minor
	reformatting

From-SVN: r149809
parent 08ad1d6d
2009-07-20 Robert Dewar <dewar@adacore.com>
* einfo.ads, switch.adb, gnatls.adb, inline.adb, sem_ch13.adb: Minor
reformatting
2009-07-17 Richard Guenther <rguenther@suse.de> 2009-07-17 Richard Guenther <rguenther@suse.de>
PR c/40401 PR c/40401
......
...@@ -554,12 +554,11 @@ package Einfo is ...@@ -554,12 +554,11 @@ package Einfo is
-- Component_Clause (Node13) -- Component_Clause (Node13)
-- Present in record components and discriminants. If a record -- Present in record components and discriminants. If a record
-- representation clause is present for the corresponding record -- representation clause is present for the corresponding record type a
-- type a that specifies a position for the component, then the -- that specifies a position for the component, then the Component_Clause
-- Component_Clause field of the E_Component entity points to the -- field of the E_Component entity points to the N_Component_Clause node.
-- N_Component_Clause node. Set to Empty if no record representation -- Set to Empty if no record representation clause was present, or if
-- clause was present, or if there was no specification for this -- there was no specification for this component.
-- component.
-- Component_Size (Uint22) [implementation base type only] -- Component_Size (Uint22) [implementation base type only]
-- Present in array types. It contains the component size value for -- Present in array types. It contains the component size value for
......
...@@ -191,11 +191,14 @@ procedure Gnatls is ...@@ -191,11 +191,14 @@ procedure Gnatls is
package GNATDIST is package GNATDIST is
-- Any modification to this subunit requires a synchronization with -- Any modification to this subunit requires synchronization with the
-- GNATDIST sources. -- GNATDIST sources.
procedure Output_ALI (A : ALI_Id); procedure Output_ALI (A : ALI_Id);
-- Comment required saying what this routine does ???
procedure Output_No_ALI (Afile : File_Name_Type); procedure Output_No_ALI (Afile : File_Name_Type);
-- Comments required saying what this routine does ???
end GNATDIST; end GNATDIST;
...@@ -431,33 +434,33 @@ procedure Gnatls is ...@@ -431,33 +434,33 @@ procedure Gnatls is
T_Body); T_Body);
Image : constant array (Token_Type) of String_Access := Image : constant array (Token_Type) of String_Access :=
(T_No_ALI => new String'("No_ALI"), (T_No_ALI => new String'("No_ALI"),
T_ALI => new String'("ALI"), T_ALI => new String'("ALI"),
T_Unit => new String'("Unit"), T_Unit => new String'("Unit"),
T_With => new String'("With"), T_With => new String'("With"),
T_Source => new String'("Source"), T_Source => new String'("Source"),
T_Afile => new String'("Afile"), T_Afile => new String'("Afile"),
T_Ofile => new String'("Ofile"), T_Ofile => new String'("Ofile"),
T_Sfile => new String'("Sfile"), T_Sfile => new String'("Sfile"),
T_Name => new String'("Name"), T_Name => new String'("Name"),
T_Main => new String'("Main"), T_Main => new String'("Main"),
T_Kind => new String'("Kind"), T_Kind => new String'("Kind"),
T_Flags => new String'("Flags"), T_Flags => new String'("Flags"),
T_Preelaborated => new String'("Preelaborated"), T_Preelaborated => new String'("Preelaborated"),
T_Pure => new String'("Pure"), T_Pure => new String'("Pure"),
T_Has_RACW => new String'("Has_RACW"), T_Has_RACW => new String'("Has_RACW"),
T_Remote_Types => new String'("Remote_Types"), T_Remote_Types => new String'("Remote_Types"),
T_Shared_Passive => new String'("Shared_Passive"), T_Shared_Passive => new String'("Shared_Passive"),
T_RCI => new String'("RCI"), T_RCI => new String'("RCI"),
T_Predefined => new String'("Predefined"), T_Predefined => new String'("Predefined"),
T_Internal => new String'("Internal"), T_Internal => new String'("Internal"),
T_Is_Generic => new String'("Is_Generic"), T_Is_Generic => new String'("Is_Generic"),
T_Procedure => new String'("procedure"), T_Procedure => new String'("procedure"),
T_Function => new String'("function"), T_Function => new String'("function"),
T_Package => new String'("package"), T_Package => new String'("package"),
T_Subprogram => new String'("subprogram"), T_Subprogram => new String'("subprogram"),
T_Spec => new String'("spec"), T_Spec => new String'("spec"),
T_Body => new String'("body")); T_Body => new String'("body"));
procedure Output_Name (N : Name_Id); procedure Output_Name (N : Name_Id);
-- Remove any encoding info (%b and %s) and output N -- Remove any encoding info (%b and %s) and output N
...@@ -465,12 +468,11 @@ procedure Gnatls is ...@@ -465,12 +468,11 @@ procedure Gnatls is
procedure Output_Afile (A : File_Name_Type); procedure Output_Afile (A : File_Name_Type);
procedure Output_Ofile (O : File_Name_Type); procedure Output_Ofile (O : File_Name_Type);
procedure Output_Sfile (S : File_Name_Type); procedure Output_Sfile (S : File_Name_Type);
-- Output various names. Check that the name is different from -- Output various names. Check that the name is different from no name.
-- no name. Otherwise, skip the output. -- Otherwise, skip the output.
procedure Output_Token (T : Token_Type); procedure Output_Token (T : Token_Type);
-- Output token using a specific format. That is several -- Output token using specific format. That is several indentations and:
-- indentations and:
-- --
-- T_No_ALI .. T_With : <token> & " =>" & NL -- T_No_ALI .. T_With : <token> & " =>" & NL
-- T_Source .. T_Kind : <token> & " => " -- T_Source .. T_Kind : <token> & " => "
...@@ -609,12 +611,12 @@ procedure Gnatls is ...@@ -609,12 +611,12 @@ procedure Gnatls is
FS := Full_Source_Name (FS); FS := Full_Source_Name (FS);
-- There is no full source name. This occurs for instance when a -- There is no full source name. This occurs for instance when a
-- withed unit has a spec file but no body file. This situation -- withed unit has a spec file but no body file. This situation is
-- is not a problem for GNATDIST since the unit may be located on -- not a problem for GNATDIST since the unit may be located on a
-- a partition we do not want to build. However, we need to -- partition we do not want to build. However, we need to locate
-- locate the spec file and to find its full source name. -- the spec file and to find its full source name. Replace the
-- Replace the body file name with the spec file name used to -- body file name with the spec file name used to compile the
-- compile the current unit when possible. -- current unit when possible.
if FS = No_File then if FS = No_File then
Get_Name_String (S); Get_Name_String (S);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -206,9 +206,7 @@ package body Inline is ...@@ -206,9 +206,7 @@ package body Inline is
-- one needs to be recorded. -- one needs to be recorded.
J := Inlined.Table (P1).First_Succ; J := Inlined.Table (P1).First_Succ;
while J /= No_Succ loop while J /= No_Succ loop
if Successors.Table (J).Subp = P2 then if Successors.Table (J).Subp = P2 then
return; return;
end if; end if;
...@@ -543,6 +541,7 @@ package body Inline is ...@@ -543,6 +541,7 @@ package body Inline is
declare declare
S : Entity_Id; S : Entity_Id;
begin begin
S := Scope (Inst); S := Scope (Inst);
while Present (S) and then S /= Standard_Standard loop while Present (S) and then S /= Standard_Standard loop
...@@ -555,9 +554,7 @@ package body Inline is ...@@ -555,9 +554,7 @@ package body Inline is
end; end;
Elmt := First_Elmt (To_Clean); Elmt := First_Elmt (To_Clean);
while Present (Elmt) loop while Present (Elmt) loop
if Node (Elmt) = Scop then if Node (Elmt) = Scop then
return; return;
end if; end if;
...@@ -601,9 +598,7 @@ package body Inline is ...@@ -601,9 +598,7 @@ package body Inline is
else else
J := Hash_Headers (Index); J := Hash_Headers (Index);
while J /= No_Subp loop while J /= No_Subp loop
if Inlined.Table (J).Name = E then if Inlined.Table (J).Name = E then
return J; return J;
else else
...@@ -642,7 +637,6 @@ package body Inline is ...@@ -642,7 +637,6 @@ package body Inline is
and then Serious_Errors_Detected = 0 and then Serious_Errors_Detected = 0
loop loop
Pack := Inlined_Bodies.Table (J); Pack := Inlined_Bodies.Table (J);
while Present (Pack) while Present (Pack)
and then Scope (Pack) /= Standard_Standard and then Scope (Pack) /= Standard_Standard
and then not Is_Child_Unit (Pack) and then not Is_Child_Unit (Pack)
...@@ -722,7 +716,6 @@ package body Inline is ...@@ -722,7 +716,6 @@ package body Inline is
Set_Is_Called (Inlined.Table (Index).Name, False); Set_Is_Called (Inlined.Table (Index).Name, False);
while S /= No_Succ loop while S /= No_Succ loop
if Is_Called if Is_Called
(Inlined.Table (Successors.Table (S).Subp).Name) (Inlined.Table (Successors.Table (S).Subp).Name)
or else Inlined.Table (Successors.Table (S).Subp).Main_Call or else Inlined.Table (Successors.Table (S).Subp).Main_Call
...@@ -789,8 +782,8 @@ package body Inline is ...@@ -789,8 +782,8 @@ package body Inline is
and then not Is_Generic_Instance (P) and then not Is_Generic_Instance (P)
then then
Bname := Get_Body_Name (Get_Unit_Name (Unit (N))); Bname := Get_Body_Name (Get_Unit_Name (Unit (N)));
E := First_Entity (P);
E := First_Entity (P);
while Present (E) loop while Present (E) loop
if Has_Pragma_Inline_Always (E) if Has_Pragma_Inline_Always (E)
or else (Front_End_Inlining and then Has_Pragma_Inline (E)) or else (Front_End_Inlining and then Has_Pragma_Inline (E))
...@@ -800,11 +793,11 @@ package body Inline is ...@@ -800,11 +793,11 @@ package body Inline is
if OK then if OK then
-- Check that we are not trying to inline a parent -- Check we are not trying to inline a parent whose body
-- whose body depends on a child, when we are compiling -- depends on a child, when we are compiling the body of
-- the body of the child. Otherwise we have a potential -- the child. Otherwise we have a potential elaboration
-- elaboration circularity with inlined subprograms and -- circularity with inlined subprograms and with
-- with Taft-Amendment types. -- Taft-Amendment types.
declare declare
Comp : Node_Id; -- Body just compiled Comp : Node_Id; -- Body just compiled
...@@ -817,18 +810,17 @@ package body Inline is ...@@ -817,18 +810,17 @@ package body Inline is
and then Present (Body_Entity (P)) and then Present (Body_Entity (P))
then then
Child_Spec := Child_Spec :=
Defining_Entity ( Defining_Entity
(Unit (Library_Unit (Cunit (Main_Unit))))); ((Unit (Library_Unit (Cunit (Main_Unit)))));
Comp := Comp :=
Parent (Unit_Declaration_Node (Body_Entity (P))); Parent (Unit_Declaration_Node (Body_Entity (P)));
With_Clause := First (Context_Items (Comp));
-- Check whether the context of the body just -- Check whether the context of the body just
-- compiled includes a child of itself, and that -- compiled includes a child of itself, and that
-- child is the spec of the main compilation. -- child is the spec of the main compilation.
With_Clause := First (Context_Items (Comp));
while Present (With_Clause) loop while Present (With_Clause) loop
if Nkind (With_Clause) = N_With_Clause if Nkind (With_Clause) = N_With_Clause
and then and then
...@@ -848,7 +840,6 @@ package body Inline is ...@@ -848,7 +840,6 @@ package body Inline is
-- and keep Taft-amendment types incomplete. -- and keep Taft-amendment types incomplete.
Ent := First_Entity (P); Ent := First_Entity (P);
while Present (Ent) loop while Present (Ent) loop
if Is_Type (Ent) if Is_Type (Ent)
and then Has_Completion_In_Body (Ent) and then Has_Completion_In_Body (Ent)
...@@ -898,7 +889,6 @@ package body Inline is ...@@ -898,7 +889,6 @@ package body Inline is
begin begin
Elmt := First_Elmt (To_Clean); Elmt := First_Elmt (To_Clean);
while Present (Elmt) loop while Present (Elmt) loop
Scop := Node (Elmt); Scop := Node (Elmt);
...@@ -961,7 +951,6 @@ package body Inline is ...@@ -961,7 +951,6 @@ package body Inline is
else else
Decl := First (Declarations (E_Body)); Decl := First (Declarations (E_Body));
while Present (Decl) loop while Present (Decl) loop
if Nkind (Decl) = N_Full_Type_Declaration if Nkind (Decl) = N_Full_Type_Declaration
...@@ -1076,9 +1065,10 @@ package body Inline is ...@@ -1076,9 +1065,10 @@ package body Inline is
--------------- ---------------
function Is_Nested (E : Entity_Id) return Boolean is function Is_Nested (E : Entity_Id) return Boolean is
Scop : Entity_Id := Scope (E); Scop : Entity_Id;
begin begin
Scop := Scope (E);
while Scop /= Standard_Standard loop while Scop /= Standard_Standard loop
if Ekind (Scop) in Subprogram_Kind then if Ekind (Scop) in Subprogram_Kind then
return True; return True;
...@@ -1116,13 +1106,11 @@ package body Inline is ...@@ -1116,13 +1106,11 @@ package body Inline is
-------------------------- --------------------------
procedure Remove_Dead_Instance (N : Node_Id) is procedure Remove_Dead_Instance (N : Node_Id) is
J : Int; J : Int;
begin begin
J := 0; J := 0;
while J <= Pending_Instantiations.Last loop while J <= Pending_Instantiations.Last loop
if Pending_Instantiations.Table (J).Inst_Node = N then if Pending_Instantiations.Table (J).Inst_Node = N then
Pending_Instantiations.Table (J).Inst_Node := Empty; Pending_Instantiations.Table (J).Inst_Node := Empty;
return; return;
...@@ -1138,7 +1126,7 @@ package body Inline is ...@@ -1138,7 +1126,7 @@ package body Inline is
function Scope_In_Main_Unit (Scop : Entity_Id) return Boolean is function Scope_In_Main_Unit (Scop : Entity_Id) return Boolean is
Comp : Node_Id; Comp : Node_Id;
S : Entity_Id := Scop; S : Entity_Id;
Ent : Entity_Id := Cunit_Entity (Main_Unit); Ent : Entity_Id := Cunit_Entity (Main_Unit);
begin begin
...@@ -1148,6 +1136,7 @@ package body Inline is ...@@ -1148,6 +1136,7 @@ package body Inline is
-- the second case, this may lead to circularities if a parent body -- the second case, this may lead to circularities if a parent body
-- depends on a child spec, and we are analyzing the child. -- depends on a child spec, and we are analyzing the child.
S := Scop;
while Scope (S) /= Standard_Standard while Scope (S) /= Standard_Standard
and then not Is_Child_Unit (S) and then not Is_Child_Unit (S)
loop loop
...@@ -1155,7 +1144,6 @@ package body Inline is ...@@ -1155,7 +1144,6 @@ package body Inline is
end loop; end loop;
Comp := Parent (S); Comp := Parent (S);
while Present (Comp) while Present (Comp)
and then Nkind (Comp) /= N_Compilation_Unit and then Nkind (Comp) /= N_Compilation_Unit
loop loop
...@@ -1163,7 +1151,6 @@ package body Inline is ...@@ -1163,7 +1151,6 @@ package body Inline is
end loop; end loop;
if Is_Child_Unit (Ent) then if Is_Child_Unit (Ent) then
while Present (Ent) while Present (Ent)
and then Is_Child_Unit (Ent) and then Is_Child_Unit (Ent)
loop loop
......
...@@ -884,9 +884,8 @@ package body Sem_Ch13 is ...@@ -884,9 +884,8 @@ package body Sem_Ch13 is
Off : Boolean; Off : Boolean;
begin begin
-- Exported variables cannot have an address clause, because
-- Exported variables cannot have an address clause, -- this cancels the effect of the pragma Export.
-- because this cancels the effect of the pragma Export
if Is_Exported (U_Ent) then if Is_Exported (U_Ent) then
Error_Msg_N Error_Msg_N
...@@ -2343,7 +2342,7 @@ package body Sem_Ch13 is ...@@ -2343,7 +2342,7 @@ package body Sem_Ch13 is
Set_Normalized_Position_Max (Fent, Uint_0); Set_Normalized_Position_Max (Fent, Uint_0);
Init_Esize (Fent, System_Address_Size); Init_Esize (Fent, System_Address_Size);
Set_Component_Clause (Fent, Set_Component_Clause (Fent,
Make_Component_Clause (Loc, Make_Component_Clause (Loc,
Component_Name => Component_Name =>
Make_Identifier (Loc, Make_Identifier (Loc,
...@@ -2614,17 +2613,27 @@ package body Sem_Ch13 is ...@@ -2614,17 +2613,27 @@ package body Sem_Ch13 is
package Sorting is new GNAT.Heap_Sort_G (OC_Move, OC_Lt); package Sorting is new GNAT.Heap_Sort_G (OC_Move, OC_Lt);
-----------
-- OC_Lt --
-----------
function OC_Lt (Op1, Op2 : Natural) return Boolean is function OC_Lt (Op1, Op2 : Natural) return Boolean is
begin begin
return OC_Fbit (Op1) < OC_Fbit (Op2); return OC_Fbit (Op1) < OC_Fbit (Op2);
end OC_Lt; end OC_Lt;
-------------
-- OC_Move --
-------------
procedure OC_Move (From : Natural; To : Natural) is procedure OC_Move (From : Natural; To : Natural) is
begin begin
OC_Fbit (To) := OC_Fbit (From); OC_Fbit (To) := OC_Fbit (From);
OC_Lbit (To) := OC_Lbit (From); OC_Lbit (To) := OC_Lbit (From);
end OC_Move; end OC_Move;
-- Start of processing for Overlap_Check
begin begin
CC := First (Component_Clauses (N)); CC := First (Component_Clauses (N));
while Present (CC) loop while Present (CC) loop
......
...@@ -148,10 +148,10 @@ package body Switch is ...@@ -148,10 +148,10 @@ package body Switch is
begin begin
return Is_Switch (Switch_Chars) return Is_Switch (Switch_Chars)
and then and then
(Switch_Chars (First .. Last) = "-param" (Switch_Chars (First .. Last) = "-param" or else
or else Switch_Chars (First .. Last) = "dumpbase" Switch_Chars (First .. Last) = "dumpbase" or else
or else Switch_Chars (First .. Last) = "auxbase-strip" Switch_Chars (First .. Last) = "auxbase-strip" or else
or else Switch_Chars (First .. Last) = "auxbase"); Switch_Chars (First .. Last) = "auxbase");
end Is_Internal_GCC_Switch; end Is_Internal_GCC_Switch;
--------------- ---------------
...@@ -169,15 +169,15 @@ package body Switch is ...@@ -169,15 +169,15 @@ package body Switch is
----------------- -----------------
function Switch_Last (Switch_Chars : String) return Natural is function Switch_Last (Switch_Chars : String) return Natural is
Last : Natural := Switch_Chars'Last; Last : constant Natural := Switch_Chars'Last;
begin begin
if Last >= Switch_Chars'First if Last >= Switch_Chars'First
and then Switch_Chars (Last) = ASCII.NUL and then Switch_Chars (Last) = ASCII.NUL
then then
Last := Last - 1; return Last - 1;
else
return Last;
end if; end if;
return Last;
end Switch_Last; end Switch_Last;
----------------- -----------------
......
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