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:
parent
f2282a5810
commit
22b77f6852
|
@ -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>
|
||||
|
||||
* sem_ch10.adb (Analyze_Task_Body_Stub): Diagnose duplicate stub for
|
||||
|
|
|
@ -476,13 +476,13 @@ package body Prj.Util is
|
|||
----------------
|
||||
|
||||
procedure Initialize
|
||||
(Iter : out Source_Info_Iterator; For_Project : Name_Id)
|
||||
(Iter : out Source_Info_Iterator;
|
||||
For_Project : Name_Id)
|
||||
is
|
||||
Ind : constant Natural := Source_Info_Project_HTable.Get (For_Project);
|
||||
begin
|
||||
if Ind = 0 then
|
||||
Iter := (No_Source_Info, 0);
|
||||
|
||||
else
|
||||
Iter := Source_Info_Table.Table (Ind);
|
||||
end if;
|
||||
|
@ -1052,6 +1052,7 @@ package body Prj.Util is
|
|||
Iter : Source_Iterator := For_Each_Source (Tree);
|
||||
Source : Prj.Source_Id;
|
||||
File : Text_File;
|
||||
|
||||
begin
|
||||
if Opt.Verbose_Mode then
|
||||
Write_Line ("Writing new source info file " &
|
||||
|
@ -1073,41 +1074,53 @@ package body Prj.Util is
|
|||
if not Source.Locally_Removed and then
|
||||
Source.Replaced_By = No_Source
|
||||
then
|
||||
-- project name
|
||||
-- Project name
|
||||
|
||||
Put_Line (File, Get_Name_String (Source.Project.Name));
|
||||
-- language name
|
||||
|
||||
-- Language name
|
||||
|
||||
Put_Line (File, Get_Name_String (Source.Language.Name));
|
||||
-- kind
|
||||
|
||||
-- Kind
|
||||
|
||||
Put_Line (File, Source.Kind'Img);
|
||||
-- display path name
|
||||
|
||||
-- Display path name
|
||||
|
||||
Put_Line (File, Get_Name_String (Source.Path.Display_Name));
|
||||
|
||||
-- Optional lines:
|
||||
|
||||
-- path name (P=)
|
||||
-- Path name (P=)
|
||||
|
||||
if Source.Path.Name /= Source.Path.Display_Name then
|
||||
Put (File, "P=");
|
||||
Put_Line (File, Get_Name_String (Source.Path.Name));
|
||||
end if;
|
||||
|
||||
-- unit name (U=)
|
||||
-- Unit name (U=)
|
||||
|
||||
if Source.Unit /= No_Unit_Index then
|
||||
Put (File, "U=");
|
||||
Put_Line (File, Get_Name_String (Source.Unit.Name));
|
||||
end if;
|
||||
|
||||
-- multi-source index (I=)
|
||||
-- Multi-source index (I=)
|
||||
|
||||
if Source.Index /= 0 then
|
||||
Put (File, "I=");
|
||||
Put_Line (File, Source.Index'Img);
|
||||
end if;
|
||||
|
||||
-- naming exception ("N=T");
|
||||
-- Naming exception ("N=T");
|
||||
|
||||
if Source.Naming_Exception then
|
||||
Put_Line (File, "N=T");
|
||||
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, "");
|
||||
end if;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ package Prj.Util is
|
|||
In_Tree : Project_Tree_Ref;
|
||||
Force_Lower_Case_Index : Boolean := False;
|
||||
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,
|
||||
-- returns the corresponding component (depending on the attribute, the
|
||||
-- index may or may not be case sensitive, see previous function),
|
||||
|
@ -134,8 +134,8 @@ package Prj.Util is
|
|||
(Name : Name_Id;
|
||||
In_Packages : Package_Id;
|
||||
In_Tree : Project_Tree_Ref) return Package_Id;
|
||||
-- Returns a specified package in a package list. Returns No_Package if
|
||||
-- In_Packages is null or if Name is not the name of a package in
|
||||
-- Returns a specified package in a package list. Returns No_Package
|
||||
-- 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.
|
||||
|
||||
function Value_Of
|
||||
|
@ -150,9 +150,9 @@ package Prj.Util is
|
|||
(S : String;
|
||||
Max_Length : Positive;
|
||||
Separator : Character);
|
||||
-- Output string S using Output.Write_Str. If S is too long to fit in
|
||||
-- one line of Max_Length, cut it in several lines, using Separator as
|
||||
-- the last character of each line, if possible.
|
||||
-- Output string S using Output.Write_Str. If S is too long to fit in one
|
||||
-- line of Max_Length, cut it in several lines, using Separator as the last
|
||||
-- character of each line, if possible.
|
||||
|
||||
type Text_File is limited private;
|
||||
-- Represents a text file (default is invalid text file)
|
||||
|
@ -198,10 +198,9 @@ package Prj.Util is
|
|||
-- the new file.
|
||||
|
||||
procedure Read_Source_Info_File (Tree : Project_Tree_Ref);
|
||||
-- Check if there is a source info file specified for the project Tree and
|
||||
-- if there is one, attempt to read it. If the file exists and is
|
||||
-- successfully read, set the flag Source_Info_File_Exists to True for
|
||||
-- the tree.
|
||||
-- Check if there is a source info file specified for the project Tree. If
|
||||
-- so, attempt to read it. If the file exists and is successfully read, set
|
||||
-- the flag Source_Info_File_Exists to True for the tree.
|
||||
|
||||
type Source_Info_Data is record
|
||||
Project : Name_Id;
|
||||
|
@ -222,7 +221,8 @@ package Prj.Util is
|
|||
-- Iterator to get the sources for a single project
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
type Text_File_Data is record
|
||||
FD : File_Descriptor := Invalid_FD;
|
||||
Out_File : Boolean := False;
|
||||
|
|
|
@ -292,7 +292,6 @@ package Prj is
|
|||
|
||||
Makefile_Dependency_Suffix : constant String := ".d";
|
||||
ALI_Dependency_Suffix : constant String := ".ali";
|
||||
|
||||
Switches_Dependency_Suffix : constant String := ".cswi";
|
||||
|
||||
Binder_Exchange_Suffix : constant String := ".bexch";
|
||||
|
|
|
@ -60,7 +60,8 @@ package body System.VxWorks.Ext is
|
|||
function Interrupt_Connect
|
||||
(Vector : Interrupt_Vector;
|
||||
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);
|
||||
begin
|
||||
return ERROR;
|
||||
|
@ -82,7 +83,8 @@ package body System.VxWorks.Ext is
|
|||
--------------------------------
|
||||
|
||||
function Interrupt_Number_To_Vector
|
||||
(intNum : int) return Interrupt_Vector is
|
||||
(intNum : int) return Interrupt_Vector
|
||||
is
|
||||
pragma Unreferenced (intNum);
|
||||
begin
|
||||
return 0;
|
||||
|
|
|
@ -6103,7 +6103,8 @@ package body Sem_Ch4 is
|
|||
if Is_Discrete_Type (Entity (Actual)) then
|
||||
Rewrite (N,
|
||||
Make_Slice (Loc,
|
||||
Prefix => Make_Function_Call (Loc,
|
||||
Prefix =>
|
||||
Make_Function_Call (Loc,
|
||||
Name => Relocate_Node (Name (N))),
|
||||
Discrete_Range =>
|
||||
New_Occurrence_Of (Entity (Actual), Sloc (Actual))));
|
||||
|
|
|
@ -487,8 +487,7 @@ package body Sem_Ch7 is
|
|||
|
||||
function Has_Referencer
|
||||
(L : List_Id;
|
||||
Outer : Boolean)
|
||||
return Boolean;
|
||||
Outer : Boolean) return Boolean;
|
||||
-- Traverse the given list of declarations in reverse order.
|
||||
-- Return True if a referencer is present. Return False if none is
|
||||
-- found. The Outer parameter is True for the outer level call and
|
||||
|
@ -509,10 +508,10 @@ package body Sem_Ch7 is
|
|||
|
||||
function Has_Referencer
|
||||
(L : List_Id;
|
||||
Outer : Boolean)
|
||||
return Boolean
|
||||
Outer : Boolean) return Boolean
|
||||
is
|
||||
Has_Referencer_Except_For_Subprograms : Boolean := False;
|
||||
|
||||
D : Node_Id;
|
||||
E : Entity_Id;
|
||||
K : Node_Kind;
|
||||
|
@ -532,7 +531,6 @@ package body Sem_Ch7 is
|
|||
V : Node_Id;
|
||||
|
||||
begin
|
||||
|
||||
-- Check name of procedure or function calls
|
||||
|
||||
if Nkind_In (N, N_Procedure_Call_Statement, N_Function_Call)
|
||||
|
@ -566,12 +564,13 @@ package body Sem_Ch7 is
|
|||
end if;
|
||||
|
||||
return OK;
|
||||
|
||||
end Check_Subprogram_Ref;
|
||||
|
||||
function Check_Subprogram_Refs is
|
||||
new Traverse_Func (Check_Subprogram_Ref);
|
||||
|
||||
-- Start of processing for Has_Referencer
|
||||
|
||||
begin
|
||||
if No (L) then
|
||||
return False;
|
||||
|
|
|
@ -1011,8 +1011,8 @@ package body Sem_Res is
|
|||
It : Interp;
|
||||
|
||||
begin
|
||||
-- if the context is an attribute reference that can apply to
|
||||
-- functions, this is never a parameterless call. (RM 4.1.4 (6))
|
||||
-- If the context is an attribute reference that can apply to
|
||||
-- functions, this is never a parameterless call (RM 4.1.4 (6)).
|
||||
|
||||
if Nkind (Parent (N)) = N_Attribute_Reference
|
||||
and then (Attribute_Name (Parent (N)) = Name_Address
|
||||
|
|
|
@ -480,8 +480,7 @@ package body Sem_Type is
|
|||
then
|
||||
Add_Entry (Entity (N), Etype (N));
|
||||
|
||||
elsif (Nkind (N) = N_Function_Call
|
||||
or else Nkind (N) = N_Procedure_Call_Statement)
|
||||
elsif Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement)
|
||||
and then Is_Entity_Name (Name (N))
|
||||
then
|
||||
Add_Entry (Entity (Name (N)), Etype (N));
|
||||
|
|
Loading…
Reference in New Issue