aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-07-31 09:52:57 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-31 11:52:57 +0200
commit0407af53dd36c25bf4dbbc18f2e8f4d1cf0b7092 (patch)
treedfa6de9848ee69af2bc9f4566536e092805db364 /gcc
parent3affd6d4eb5f48941a138390b1bc3c8d3a22a60b (diff)
downloadgcc-0407af53dd36c25bf4dbbc18f2e8f4d1cf0b7092.zip
gcc-0407af53dd36c25bf4dbbc18f2e8f4d1cf0b7092.tar.gz
gcc-0407af53dd36c25bf4dbbc18f2e8f4d1cf0b7092.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/a-ngelfu.ads45
-rw-r--r--gcc/ada/prj-conf.adb8
-rw-r--r--gcc/ada/prj-nmsc.adb32
-rw-r--r--gcc/ada/sem_util.adb1
5 files changed, 52 insertions, 39 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index eecb3ff..444aed2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/a-ngelfu.ads b/gcc/ada/a-ngelfu.ads
index 5569923..fba557f 100644
--- a/gcc/ada/a-ngelfu.ads
+++ b/gcc/ada/a-ngelfu.ads
@@ -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).
+
+ -- 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
- -- 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);
diff --git a/gcc/ada/prj-conf.adb b/gcc/ada/prj-conf.adb
index b500e7b..c6163fb 100644
--- a/gcc/ada/prj-conf.adb
+++ b/gcc/ada/prj-conf.adb
@@ -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
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 1610aee..7d8678a 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -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);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index f6c150f..8f24046 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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))