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
This commit is contained in:
parent
3affd6d4eb
commit
0407af53dd
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* prj-nmsc.adb: Minor reformatting.
|
||||
|
@ -41,20 +41,23 @@ package Ada.Numerics.Generic_Elementary_Functions is
|
||||
|
||||
function Sqrt (X : Float_Type'Base) return Float_Type'Base with
|
||||
Post => 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)
|
||||
|
||||
-- If X is positive, the result of Sqrt is positive. 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
|
||||
-- Finally if X is positive, the result of Sqrt is positive (because
|
||||
-- the sqrt of numbers greater than 1 is greater than or equal to 1,
|
||||
-- and the sqrt of numbers less than 1 is greater than the argument).
|
||||
|
||||
-- (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.
|
||||
-- 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.
|
||||
|
||||
-- Note: we use the comparison with Succ (0.0) here because this is
|
||||
-- more amenable to CodePeer analysis than the use of 'Machine.
|
||||
|
||||
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
|
||||
|
||||
function "**" (Left, Right : Float_Type'Base) return Float_Type'Base with
|
||||
Post => "**"'Result >= 0.0
|
||||
and then (if Right = 0.0 then "**"'Result = 1.0)
|
||||
and then (if Right = 1.0 then "**"'Result = Left)
|
||||
and then (if Left = 1.0 then "**"'Result = 1.0)
|
||||
and then (if Left = 0.0 then "**"'Result = 0.0);
|
||||
and then (if Right = 0.0 then "**"'Result = 1.0)
|
||||
and then (if Right = 1.0 then "**"'Result = Left)
|
||||
and then (if Left = 1.0 then "**"'Result = 1.0)
|
||||
and then (if Left = 0.0 then "**"'Result = 0.0);
|
||||
|
||||
function Sin (X : Float_Type'Base) return Float_Type'Base with
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
Post => (if X = 0.0 then Tan'Result = 0.0);
|
||||
@ -144,11 +147,11 @@ package Ada.Numerics.Generic_Elementary_Functions is
|
||||
|
||||
function Cosh (X : Float_Type'Base) return Float_Type'Base with
|
||||
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
|
||||
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
|
||||
Post => abs Coth'Result >= 1.0;
|
||||
@ -158,7 +161,7 @@ package Ada.Numerics.Generic_Elementary_Functions is
|
||||
|
||||
function Arccosh (X : Float_Type'Base) return Float_Type'Base with
|
||||
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
|
||||
Post => (if X = 0.0 then Arctanh'Result = 0.0);
|
||||
|
@ -65,8 +65,8 @@ package body Prj.Conf is
|
||||
-- set from a --RTS command line option.
|
||||
|
||||
procedure Locate_Runtime
|
||||
(Language : Name_Id;
|
||||
Env : Prj.Tree.Environment);
|
||||
(Language : Name_Id;
|
||||
Env : Prj.Tree.Environment);
|
||||
-- If RTS_Name is a base name (a name without path separator), then
|
||||
-- do nothing. Otherwise, convert it to an absolute path (possibly by
|
||||
-- searching it in the project path) and call Set_Runtime_For with the
|
||||
@ -1525,8 +1525,8 @@ package body Prj.Conf is
|
||||
--------------------
|
||||
|
||||
procedure Locate_Runtime
|
||||
(Language : Name_Id;
|
||||
Env : Prj.Tree.Environment)
|
||||
(Language : Name_Id;
|
||||
Env : Prj.Tree.Environment)
|
||||
is
|
||||
function Is_Base_Name (Path : String) return Boolean;
|
||||
-- Returns True if Path has no directory separator
|
||||
|
@ -3029,30 +3029,34 @@ package body Prj.Nmsc is
|
||||
-- Check if an imported or extended project if also a library project
|
||||
|
||||
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 --
|
||||
----------------------------------
|
||||
|
||||
procedure Check_Aggregate_Library_Dirs is
|
||||
|
||||
procedure Process_Aggregate (Proj : Project_Id);
|
||||
-- Recursive procedure to check the aggregated projects, as they may
|
||||
-- also be aggregated library projects.
|
||||
|
||||
-----------------------
|
||||
-- Process_Aggregate --
|
||||
-----------------------
|
||||
|
||||
procedure Process_Aggregate (Proj : Project_Id) is
|
||||
|
||||
Agg : Aggregated_Project_List := Proj.Aggregated_Projects;
|
||||
Agg : Aggregated_Project_List;
|
||||
|
||||
begin
|
||||
Agg := Proj.Aggregated_Projects;
|
||||
while Agg /= null loop
|
||||
Error_Msg_Name_1 := Agg.Project.Name;
|
||||
|
||||
if Agg.Project.Qualifier /= Aggregate_Library and then
|
||||
Project.Library_ALI_Dir.Name
|
||||
= Agg.Project.Object_Directory.Name
|
||||
if Agg.Project.Qualifier /= Aggregate_Library
|
||||
and then Project.Library_ALI_Dir.Name =
|
||||
Agg.Project.Object_Directory.Name
|
||||
then
|
||||
Error_Msg
|
||||
(Data.Flags,
|
||||
@ -3060,8 +3064,8 @@ package body Prj.Nmsc is
|
||||
& " object directory of aggregated project %%",
|
||||
The_Lib_Kind.Location, Project);
|
||||
|
||||
elsif Project.Library_ALI_Dir.Name
|
||||
= Agg.Project.Library_Dir.Name
|
||||
elsif Project.Library_ALI_Dir.Name =
|
||||
Agg.Project.Library_Dir.Name
|
||||
then
|
||||
Error_Msg
|
||||
(Data.Flags,
|
||||
@ -3069,9 +3073,9 @@ package body Prj.Nmsc is
|
||||
& " library directory of aggregated project %%",
|
||||
The_Lib_Kind.Location, Project);
|
||||
|
||||
elsif Agg.Project.Qualifier /= Aggregate_Library and then
|
||||
Project.Library_Dir.Name
|
||||
= Agg.Project.Object_Directory.Name
|
||||
elsif Agg.Project.Qualifier /= Aggregate_Library
|
||||
and then Project.Library_Dir.Name =
|
||||
Agg.Project.Object_Directory.Name
|
||||
then
|
||||
Error_Msg
|
||||
(Data.Flags,
|
||||
@ -3079,8 +3083,8 @@ package body Prj.Nmsc is
|
||||
& " object directory of aggregated project %%",
|
||||
The_Lib_Kind.Location, Project);
|
||||
|
||||
elsif Project.Library_Dir.Name
|
||||
= Agg.Project.Library_Dir.Name
|
||||
elsif Project.Library_Dir.Name =
|
||||
Agg.Project.Library_Dir.Name
|
||||
then
|
||||
Error_Msg
|
||||
(Data.Flags,
|
||||
@ -3097,6 +3101,8 @@ package body Prj.Nmsc is
|
||||
end loop;
|
||||
end Process_Aggregate;
|
||||
|
||||
-- Start of processing for Check_Aggregate_Library_Dirs
|
||||
|
||||
begin
|
||||
if Project.Qualifier = Aggregate_Library then
|
||||
Process_Aggregate (Project);
|
||||
|
@ -16459,7 +16459,6 @@ package body Sem_Util is
|
||||
Stmt := Original_Node (N);
|
||||
end if;
|
||||
|
||||
-- and then Ekind (Entity (Identifier (Stmt))) = E_Loop
|
||||
return
|
||||
Nkind (Stmt) = N_Loop_Statement
|
||||
and then Present (Identifier (Stmt))
|
||||
|
Loading…
Reference in New Issue
Block a user