Commit 0407af53 by Robert Dewar Committed by Arnaud Charlet

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

2014-07-31  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb, a-ngelfu.ads, prj-nmsc.adb, prj-conf.adb: Minor
	reformatting.

From-SVN: r213332
parent 3affd6d4
2014-07-31 Robert Dewar <dewar@adacore.com>
* sem_util.adb, a-ngelfu.ads, prj-nmsc.adb, prj-conf.adb: Minor
reformatting.
2014-07-31 Pascal Obry <obry@adacore.com> 2014-07-31 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb: Minor reformatting. * prj-nmsc.adb: Minor reformatting.
......
...@@ -41,20 +41,23 @@ package Ada.Numerics.Generic_Elementary_Functions is ...@@ -41,20 +41,23 @@ package Ada.Numerics.Generic_Elementary_Functions is
function Sqrt (X : Float_Type'Base) return Float_Type'Base with function Sqrt (X : Float_Type'Base) return Float_Type'Base with
Post => Sqrt'Result >= 0.0 Post => Sqrt'Result >= 0.0
and then (if X = 0.0 then Sqrt'Result = 0.0) and then (if X = 0.0 then Sqrt'Result = 0.0)
and then (if X = 1.0 then Sqrt'Result = 1.0) and then (if X = 1.0 then Sqrt'Result = 1.0)
-- If X is positive, the result of Sqrt is positive. This property is -- Finally if X is positive, the result of Sqrt is positive (because
-- useful in particular for static analysis. The property that X is -- the sqrt of numbers greater than 1 is greater than or equal to 1,
-- positive is not expressed as (X > 0), as the value X may be held in -- and the sqrt of numbers less than 1 is greater than the argument).
-- registers that have larger range and precision on some architecture
-- This property is useful in particular for static analysis. The
-- property that X is positive is not expressed as (X > 0), as
-- the value X may be held in registers that have larger range and
-- precision on some architecture (for example, on x86 using x387
-- FPU, as opposed to SSE2). So, it might be possible for X to be
-- 2.0**(-5000) or so, which could cause the number to compare as
-- greater than 0, but Sqrt would still return a zero result.
-- (for example, on x86 using x387 FPU, as opposed to SSE2). So, it -- Note: we use the comparison with Succ (0.0) here because this is
-- might be possible for X to be 2.0**(-5000) or so, which could cause -- more amenable to CodePeer analysis than the use of 'Machine.
-- the number to compare as greater than 0, but Sqrt would still return
-- a zero result.
and then (if X >= Float_Type'Succ (0.0) then Sqrt'Result > 0.0); and then (if X >= Float_Type'Succ (0.0) then Sqrt'Result > 0.0);
...@@ -70,26 +73,26 @@ package Ada.Numerics.Generic_Elementary_Functions is ...@@ -70,26 +73,26 @@ package Ada.Numerics.Generic_Elementary_Functions is
function "**" (Left, Right : Float_Type'Base) return Float_Type'Base with function "**" (Left, Right : Float_Type'Base) return Float_Type'Base with
Post => "**"'Result >= 0.0 Post => "**"'Result >= 0.0
and then (if Right = 0.0 then "**"'Result = 1.0) and then (if Right = 0.0 then "**"'Result = 1.0)
and then (if Right = 1.0 then "**"'Result = Left) and then (if Right = 1.0 then "**"'Result = Left)
and then (if Left = 1.0 then "**"'Result = 1.0) and then (if Left = 1.0 then "**"'Result = 1.0)
and then (if Left = 0.0 then "**"'Result = 0.0); and then (if Left = 0.0 then "**"'Result = 0.0);
function Sin (X : Float_Type'Base) return Float_Type'Base with function Sin (X : Float_Type'Base) return Float_Type'Base with
Post => Sin'Result in -1.0 .. 1.0 Post => Sin'Result in -1.0 .. 1.0
and then (if X = 0.0 then Sin'Result = 0.0); and then (if X = 0.0 then Sin'Result = 0.0);
function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base with function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base with
Post => Sin'Result in -1.0 .. 1.0 Post => Sin'Result in -1.0 .. 1.0
and then (if X = 0.0 then Sin'Result = 0.0); and then (if X = 0.0 then Sin'Result = 0.0);
function Cos (X : Float_Type'Base) return Float_Type'Base with function Cos (X : Float_Type'Base) return Float_Type'Base with
Post => Cos'Result in -1.0 .. 1.0 Post => Cos'Result in -1.0 .. 1.0
and then (if X = 0.0 then Cos'Result = 1.0); and then (if X = 0.0 then Cos'Result = 1.0);
function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base with function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base with
Post => Cos'Result in -1.0 .. 1.0 Post => Cos'Result in -1.0 .. 1.0
and then (if X = 0.0 then Cos'Result = 1.0); and then (if X = 0.0 then Cos'Result = 1.0);
function Tan (X : Float_Type'Base) return Float_Type'Base with function Tan (X : Float_Type'Base) return Float_Type'Base with
Post => (if X = 0.0 then Tan'Result = 0.0); Post => (if X = 0.0 then Tan'Result = 0.0);
...@@ -144,11 +147,11 @@ package Ada.Numerics.Generic_Elementary_Functions is ...@@ -144,11 +147,11 @@ package Ada.Numerics.Generic_Elementary_Functions is
function Cosh (X : Float_Type'Base) return Float_Type'Base with function Cosh (X : Float_Type'Base) return Float_Type'Base with
Post => Cosh'Result >= 1.0 Post => Cosh'Result >= 1.0
and then (if X = 0.0 then Cosh'Result = 1.0); and then (if X = 0.0 then Cosh'Result = 1.0);
function Tanh (X : Float_Type'Base) return Float_Type'Base with function Tanh (X : Float_Type'Base) return Float_Type'Base with
Post => Tanh'Result in -1.0 .. 1.0 Post => Tanh'Result in -1.0 .. 1.0
and then (if X = 0.0 then Tanh'Result = 0.0); and then (if X = 0.0 then Tanh'Result = 0.0);
function Coth (X : Float_Type'Base) return Float_Type'Base with function Coth (X : Float_Type'Base) return Float_Type'Base with
Post => abs Coth'Result >= 1.0; Post => abs Coth'Result >= 1.0;
...@@ -158,7 +161,7 @@ package Ada.Numerics.Generic_Elementary_Functions is ...@@ -158,7 +161,7 @@ package Ada.Numerics.Generic_Elementary_Functions is
function Arccosh (X : Float_Type'Base) return Float_Type'Base with function Arccosh (X : Float_Type'Base) return Float_Type'Base with
Post => Arccosh'Result >= 0.0 Post => Arccosh'Result >= 0.0
and then (if X = 1.0 then Arccosh'Result = 0.0); and then (if X = 1.0 then Arccosh'Result = 0.0);
function Arctanh (X : Float_Type'Base) return Float_Type'Base with function Arctanh (X : Float_Type'Base) return Float_Type'Base with
Post => (if X = 0.0 then Arctanh'Result = 0.0); Post => (if X = 0.0 then Arctanh'Result = 0.0);
......
...@@ -65,8 +65,8 @@ package body Prj.Conf is ...@@ -65,8 +65,8 @@ package body Prj.Conf is
-- set from a --RTS command line option. -- set from a --RTS command line option.
procedure Locate_Runtime procedure Locate_Runtime
(Language : Name_Id; (Language : Name_Id;
Env : Prj.Tree.Environment); Env : Prj.Tree.Environment);
-- If RTS_Name is a base name (a name without path separator), then -- If RTS_Name is a base name (a name without path separator), then
-- do nothing. Otherwise, convert it to an absolute path (possibly by -- do nothing. Otherwise, convert it to an absolute path (possibly by
-- searching it in the project path) and call Set_Runtime_For with the -- searching it in the project path) and call Set_Runtime_For with the
...@@ -1525,8 +1525,8 @@ package body Prj.Conf is ...@@ -1525,8 +1525,8 @@ package body Prj.Conf is
-------------------- --------------------
procedure Locate_Runtime procedure Locate_Runtime
(Language : Name_Id; (Language : Name_Id;
Env : Prj.Tree.Environment) Env : Prj.Tree.Environment)
is is
function Is_Base_Name (Path : String) return Boolean; function Is_Base_Name (Path : String) return Boolean;
-- Returns True if Path has no directory separator -- Returns True if Path has no directory separator
......
...@@ -3029,30 +3029,34 @@ package body Prj.Nmsc is ...@@ -3029,30 +3029,34 @@ package body Prj.Nmsc is
-- Check if an imported or extended project if also a library project -- Check if an imported or extended project if also a library project
procedure Check_Aggregate_Library_Dirs; procedure Check_Aggregate_Library_Dirs;
-- Check that the library directory and the library ALI directory of
-- an aggregate library project are not the same as the object directory
-- or the library directory of any of its aggregated projects.
---------------------------------- ----------------------------------
-- Check_Aggregate_Library_Dirs -- -- Check_Aggregate_Library_Dirs --
---------------------------------- ----------------------------------
procedure Check_Aggregate_Library_Dirs is procedure Check_Aggregate_Library_Dirs is
procedure Process_Aggregate (Proj : Project_Id); procedure Process_Aggregate (Proj : Project_Id);
-- Recursive procedure to check the aggregated projects, as they may
-- also be aggregated library projects.
----------------------- -----------------------
-- Process_Aggregate -- -- Process_Aggregate --
----------------------- -----------------------
procedure Process_Aggregate (Proj : Project_Id) is procedure Process_Aggregate (Proj : Project_Id) is
Agg : Aggregated_Project_List;
Agg : Aggregated_Project_List := Proj.Aggregated_Projects;
begin begin
Agg := Proj.Aggregated_Projects;
while Agg /= null loop while Agg /= null loop
Error_Msg_Name_1 := Agg.Project.Name; Error_Msg_Name_1 := Agg.Project.Name;
if Agg.Project.Qualifier /= Aggregate_Library and then if Agg.Project.Qualifier /= Aggregate_Library
Project.Library_ALI_Dir.Name and then Project.Library_ALI_Dir.Name =
= Agg.Project.Object_Directory.Name Agg.Project.Object_Directory.Name
then then
Error_Msg Error_Msg
(Data.Flags, (Data.Flags,
...@@ -3060,8 +3064,8 @@ package body Prj.Nmsc is ...@@ -3060,8 +3064,8 @@ package body Prj.Nmsc is
& " object directory of aggregated project %%", & " object directory of aggregated project %%",
The_Lib_Kind.Location, Project); The_Lib_Kind.Location, Project);
elsif Project.Library_ALI_Dir.Name elsif Project.Library_ALI_Dir.Name =
= Agg.Project.Library_Dir.Name Agg.Project.Library_Dir.Name
then then
Error_Msg Error_Msg
(Data.Flags, (Data.Flags,
...@@ -3069,9 +3073,9 @@ package body Prj.Nmsc is ...@@ -3069,9 +3073,9 @@ package body Prj.Nmsc is
& " library directory of aggregated project %%", & " library directory of aggregated project %%",
The_Lib_Kind.Location, Project); The_Lib_Kind.Location, Project);
elsif Agg.Project.Qualifier /= Aggregate_Library and then elsif Agg.Project.Qualifier /= Aggregate_Library
Project.Library_Dir.Name and then Project.Library_Dir.Name =
= Agg.Project.Object_Directory.Name Agg.Project.Object_Directory.Name
then then
Error_Msg Error_Msg
(Data.Flags, (Data.Flags,
...@@ -3079,8 +3083,8 @@ package body Prj.Nmsc is ...@@ -3079,8 +3083,8 @@ package body Prj.Nmsc is
& " object directory of aggregated project %%", & " object directory of aggregated project %%",
The_Lib_Kind.Location, Project); The_Lib_Kind.Location, Project);
elsif Project.Library_Dir.Name elsif Project.Library_Dir.Name =
= Agg.Project.Library_Dir.Name Agg.Project.Library_Dir.Name
then then
Error_Msg Error_Msg
(Data.Flags, (Data.Flags,
...@@ -3097,6 +3101,8 @@ package body Prj.Nmsc is ...@@ -3097,6 +3101,8 @@ package body Prj.Nmsc is
end loop; end loop;
end Process_Aggregate; end Process_Aggregate;
-- Start of processing for Check_Aggregate_Library_Dirs
begin begin
if Project.Qualifier = Aggregate_Library then if Project.Qualifier = Aggregate_Library then
Process_Aggregate (Project); Process_Aggregate (Project);
......
...@@ -16459,7 +16459,6 @@ package body Sem_Util is ...@@ -16459,7 +16459,6 @@ package body Sem_Util is
Stmt := Original_Node (N); Stmt := Original_Node (N);
end if; end if;
-- and then Ekind (Entity (Identifier (Stmt))) = E_Loop
return return
Nkind (Stmt) = N_Loop_Statement Nkind (Stmt) = N_Loop_Statement
and then Present (Identifier (Stmt)) and then Present (Identifier (Stmt))
......
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