prj-util.adb, [...]: Minor reformatting.

2010-10-05  Robert Dewar  <dewar@adacore.com>

	* prj-util.adb, prj-util.ads, prj.ads, s-vxwext-rtp.adb, sem_ch4.adb,
	sem_ch7.adb, sem_res.adb, sem_type.adb: Minor reformatting.
	Minor code reorganization (use Nkind_In).

From-SVN: r164981
This commit is contained in:
Robert Dewar 2010-10-05 10:22:52 +00:00 committed by Arnaud Charlet
parent f2282a5810
commit 22b77f6852
9 changed files with 65 additions and 47 deletions

View File

@ -1,3 +1,9 @@
2010-10-05 Robert Dewar <dewar@adacore.com>
* prj-util.adb, prj-util.ads, prj.ads, s-vxwext-rtp.adb, sem_ch4.adb,
sem_ch7.adb, sem_res.adb, sem_type.adb: Minor reformatting.
Minor code reorganization (use Nkind_In).
2010-10-05 Ed Schonberg <schonberg@adacore.com> 2010-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Task_Body_Stub): Diagnose duplicate stub for * sem_ch10.adb (Analyze_Task_Body_Stub): Diagnose duplicate stub for

View File

@ -476,13 +476,13 @@ package body Prj.Util is
---------------- ----------------
procedure Initialize procedure Initialize
(Iter : out Source_Info_Iterator; For_Project : Name_Id) (Iter : out Source_Info_Iterator;
For_Project : Name_Id)
is is
Ind : constant Natural := Source_Info_Project_HTable.Get (For_Project); Ind : constant Natural := Source_Info_Project_HTable.Get (For_Project);
begin begin
if Ind = 0 then if Ind = 0 then
Iter := (No_Source_Info, 0); Iter := (No_Source_Info, 0);
else else
Iter := Source_Info_Table.Table (Ind); Iter := Source_Info_Table.Table (Ind);
end if; end if;
@ -1052,6 +1052,7 @@ package body Prj.Util is
Iter : Source_Iterator := For_Each_Source (Tree); Iter : Source_Iterator := For_Each_Source (Tree);
Source : Prj.Source_Id; Source : Prj.Source_Id;
File : Text_File; File : Text_File;
begin begin
if Opt.Verbose_Mode then if Opt.Verbose_Mode then
Write_Line ("Writing new source info file " & Write_Line ("Writing new source info file " &
@ -1073,41 +1074,53 @@ package body Prj.Util is
if not Source.Locally_Removed and then if not Source.Locally_Removed and then
Source.Replaced_By = No_Source Source.Replaced_By = No_Source
then then
-- project name -- Project name
Put_Line (File, Get_Name_String (Source.Project.Name)); Put_Line (File, Get_Name_String (Source.Project.Name));
-- language name
-- Language name
Put_Line (File, Get_Name_String (Source.Language.Name)); Put_Line (File, Get_Name_String (Source.Language.Name));
-- kind
-- Kind
Put_Line (File, Source.Kind'Img); Put_Line (File, Source.Kind'Img);
-- display path name
-- Display path name
Put_Line (File, Get_Name_String (Source.Path.Display_Name)); Put_Line (File, Get_Name_String (Source.Path.Display_Name));
-- Optional lines: -- Optional lines:
-- path name (P=) -- Path name (P=)
if Source.Path.Name /= Source.Path.Display_Name then if Source.Path.Name /= Source.Path.Display_Name then
Put (File, "P="); Put (File, "P=");
Put_Line (File, Get_Name_String (Source.Path.Name)); Put_Line (File, Get_Name_String (Source.Path.Name));
end if; end if;
-- unit name (U=) -- Unit name (U=)
if Source.Unit /= No_Unit_Index then if Source.Unit /= No_Unit_Index then
Put (File, "U="); Put (File, "U=");
Put_Line (File, Get_Name_String (Source.Unit.Name)); Put_Line (File, Get_Name_String (Source.Unit.Name));
end if; end if;
-- multi-source index (I=) -- Multi-source index (I=)
if Source.Index /= 0 then if Source.Index /= 0 then
Put (File, "I="); Put (File, "I=");
Put_Line (File, Source.Index'Img); Put_Line (File, Source.Index'Img);
end if; end if;
-- naming exception ("N=T"); -- Naming exception ("N=T");
if Source.Naming_Exception then if Source.Naming_Exception then
Put_Line (File, "N=T"); Put_Line (File, "N=T");
end if; end if;
-- empty line to indicate end of info on this source -- Empty line to indicate end of info on this source
Put_Line (File, ""); Put_Line (File, "");
end if; end if;

View File

@ -104,7 +104,7 @@ package Prj.Util is
In_Tree : Project_Tree_Ref; In_Tree : Project_Tree_Ref;
Force_Lower_Case_Index : Boolean := False; Force_Lower_Case_Index : Boolean := False;
Allow_Wildcards : Boolean := False) return Variable_Value; Allow_Wildcards : Boolean := False) return Variable_Value;
-- In a specific package, -- In a specific package:
-- - if there exists an array Attribute_Or_Array_Name with an index Name, -- - if there exists an array Attribute_Or_Array_Name with an index Name,
-- returns the corresponding component (depending on the attribute, the -- returns the corresponding component (depending on the attribute, the
-- index may or may not be case sensitive, see previous function), -- index may or may not be case sensitive, see previous function),
@ -134,8 +134,8 @@ package Prj.Util is
(Name : Name_Id; (Name : Name_Id;
In_Packages : Package_Id; In_Packages : Package_Id;
In_Tree : Project_Tree_Ref) return Package_Id; In_Tree : Project_Tree_Ref) return Package_Id;
-- Returns a specified package in a package list. Returns No_Package if -- Returns a specified package in a package list. Returns No_Package
-- In_Packages is null or if Name is not the name of a package in -- if In_Packages is null or if Name is not the name of a package in
-- Package_List. The caller must ensure that Name is in lower case. -- Package_List. The caller must ensure that Name is in lower case.
function Value_Of function Value_Of
@ -150,9 +150,9 @@ package Prj.Util is
(S : String; (S : String;
Max_Length : Positive; Max_Length : Positive;
Separator : Character); Separator : Character);
-- Output string S using Output.Write_Str. If S is too long to fit in -- Output string S using Output.Write_Str. If S is too long to fit in one
-- one line of Max_Length, cut it in several lines, using Separator as -- line of Max_Length, cut it in several lines, using Separator as the last
-- the last character of each line, if possible. -- character of each line, if possible.
type Text_File is limited private; type Text_File is limited private;
-- Represents a text file (default is invalid text file) -- Represents a text file (default is invalid text file)
@ -198,10 +198,9 @@ package Prj.Util is
-- the new file. -- the new file.
procedure Read_Source_Info_File (Tree : Project_Tree_Ref); procedure Read_Source_Info_File (Tree : Project_Tree_Ref);
-- Check if there is a source info file specified for the project Tree and -- Check if there is a source info file specified for the project Tree. If
-- if there is one, attempt to read it. If the file exists and is -- so, attempt to read it. If the file exists and is successfully read, set
-- successfully read, set the flag Source_Info_File_Exists to True for -- the flag Source_Info_File_Exists to True for the tree.
-- the tree.
type Source_Info_Data is record type Source_Info_Data is record
Project : Name_Id; Project : Name_Id;
@ -222,7 +221,8 @@ package Prj.Util is
-- Iterator to get the sources for a single project -- Iterator to get the sources for a single project
procedure Initialize procedure Initialize
(Iter : out Source_Info_Iterator; For_Project : Name_Id); (Iter : out Source_Info_Iterator;
For_Project : Name_Id);
-- Initiaize Iter for the project -- Initiaize Iter for the project
function Source_Info_Of (Iter : Source_Info_Iterator) return Source_Info; function Source_Info_Of (Iter : Source_Info_Iterator) return Source_Info;
@ -234,7 +234,6 @@ package Prj.Util is
-- Advance the iterator to the next source in the project -- Advance the iterator to the next source in the project
private private
type Text_File_Data is record type Text_File_Data is record
FD : File_Descriptor := Invalid_FD; FD : File_Descriptor := Invalid_FD;
Out_File : Boolean := False; Out_File : Boolean := False;

View File

@ -292,7 +292,6 @@ package Prj is
Makefile_Dependency_Suffix : constant String := ".d"; Makefile_Dependency_Suffix : constant String := ".d";
ALI_Dependency_Suffix : constant String := ".ali"; ALI_Dependency_Suffix : constant String := ".ali";
Switches_Dependency_Suffix : constant String := ".cswi"; Switches_Dependency_Suffix : constant String := ".cswi";
Binder_Exchange_Suffix : constant String := ".bexch"; Binder_Exchange_Suffix : constant String := ".bexch";

View File

@ -60,7 +60,8 @@ package body System.VxWorks.Ext is
function Interrupt_Connect function Interrupt_Connect
(Vector : Interrupt_Vector; (Vector : Interrupt_Vector;
Handler : Interrupt_Handler; Handler : Interrupt_Handler;
Parameter : System.Address := System.Null_Address) return int is Parameter : System.Address := System.Null_Address) return int
is
pragma Unreferenced (Vector, Handler, Parameter); pragma Unreferenced (Vector, Handler, Parameter);
begin begin
return ERROR; return ERROR;
@ -82,7 +83,8 @@ package body System.VxWorks.Ext is
-------------------------------- --------------------------------
function Interrupt_Number_To_Vector function Interrupt_Number_To_Vector
(intNum : int) return Interrupt_Vector is (intNum : int) return Interrupt_Vector
is
pragma Unreferenced (intNum); pragma Unreferenced (intNum);
begin begin
return 0; return 0;

View File

@ -6103,7 +6103,8 @@ package body Sem_Ch4 is
if Is_Discrete_Type (Entity (Actual)) then if Is_Discrete_Type (Entity (Actual)) then
Rewrite (N, Rewrite (N,
Make_Slice (Loc, Make_Slice (Loc,
Prefix => Make_Function_Call (Loc, Prefix =>
Make_Function_Call (Loc,
Name => Relocate_Node (Name (N))), Name => Relocate_Node (Name (N))),
Discrete_Range => Discrete_Range =>
New_Occurrence_Of (Entity (Actual), Sloc (Actual)))); New_Occurrence_Of (Entity (Actual), Sloc (Actual))));

View File

@ -487,8 +487,7 @@ package body Sem_Ch7 is
function Has_Referencer function Has_Referencer
(L : List_Id; (L : List_Id;
Outer : Boolean) Outer : Boolean) return Boolean;
return Boolean;
-- Traverse the given list of declarations in reverse order. -- Traverse the given list of declarations in reverse order.
-- Return True if a referencer is present. Return False if none is -- Return True if a referencer is present. Return False if none is
-- found. The Outer parameter is True for the outer level call and -- found. The Outer parameter is True for the outer level call and
@ -509,10 +508,10 @@ package body Sem_Ch7 is
function Has_Referencer function Has_Referencer
(L : List_Id; (L : List_Id;
Outer : Boolean) Outer : Boolean) return Boolean
return Boolean
is is
Has_Referencer_Except_For_Subprograms : Boolean := False; Has_Referencer_Except_For_Subprograms : Boolean := False;
D : Node_Id; D : Node_Id;
E : Entity_Id; E : Entity_Id;
K : Node_Kind; K : Node_Kind;
@ -532,7 +531,6 @@ package body Sem_Ch7 is
V : Node_Id; V : Node_Id;
begin begin
-- Check name of procedure or function calls -- Check name of procedure or function calls
if Nkind_In (N, N_Procedure_Call_Statement, N_Function_Call) if Nkind_In (N, N_Procedure_Call_Statement, N_Function_Call)
@ -566,12 +564,13 @@ package body Sem_Ch7 is
end if; end if;
return OK; return OK;
end Check_Subprogram_Ref; end Check_Subprogram_Ref;
function Check_Subprogram_Refs is function Check_Subprogram_Refs is
new Traverse_Func (Check_Subprogram_Ref); new Traverse_Func (Check_Subprogram_Ref);
-- Start of processing for Has_Referencer
begin begin
if No (L) then if No (L) then
return False; return False;

View File

@ -1011,8 +1011,8 @@ package body Sem_Res is
It : Interp; It : Interp;
begin begin
-- if the context is an attribute reference that can apply to -- If the context is an attribute reference that can apply to
-- functions, this is never a parameterless call. (RM 4.1.4 (6)) -- functions, this is never a parameterless call (RM 4.1.4 (6)).
if Nkind (Parent (N)) = N_Attribute_Reference if Nkind (Parent (N)) = N_Attribute_Reference
and then (Attribute_Name (Parent (N)) = Name_Address and then (Attribute_Name (Parent (N)) = Name_Address

View File

@ -480,8 +480,7 @@ package body Sem_Type is
then then
Add_Entry (Entity (N), Etype (N)); Add_Entry (Entity (N), Etype (N));
elsif (Nkind (N) = N_Function_Call elsif Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement)
or else Nkind (N) = N_Procedure_Call_Statement)
and then Is_Entity_Name (Name (N)) and then Is_Entity_Name (Name (N))
then then
Add_Entry (Entity (Name (N)), Etype (N)); Add_Entry (Entity (Name (N)), Etype (N));