aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2017-09-06 09:31:46 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-09-06 11:31:46 +0200
commit3e720c9601e26585c386c983084fdc2926902936 (patch)
tree3c64ea77f5ea643df0973229e1dd0eb9f80eca78 /gcc
parentf8159014019f2aa3b3e53970732d087dd93fc432 (diff)
downloadgcc-3e720c9601e26585c386c983084fdc2926902936.zip
gcc-3e720c9601e26585c386c983084fdc2926902936.tar.gz
gcc-3e720c9601e26585c386c983084fdc2926902936.tar.bz2
exp_util.adb, [...]: Minor reformatting.
2017-09-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb, exp_ch3.adb, xoscons.adb: Minor reformatting. From-SVN: r251758
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/einfo.adb2
-rw-r--r--gcc/ada/exp_ch3.adb6
-rw-r--r--gcc/ada/exp_ch4.adb2
-rw-r--r--gcc/ada/exp_util.adb21
-rw-r--r--gcc/ada/gnatls.adb30
-rw-r--r--gcc/ada/sem_attr.adb14
-rw-r--r--gcc/ada/xoscons.adb4
8 files changed, 49 insertions, 35 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 268eb13..1695362 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-06 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
+ exp_ch3.adb, xoscons.adb: Minor reformatting.
+
2017-09-06 Raphael Amiard <amiard@adacore.com>
* a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 1a4621e..25af42e 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -7132,7 +7132,7 @@ package body Einfo is
loop
if Nkind_In (P, N_Selected_Component, N_Expanded_Name)
or else (Nkind (P) = N_Defining_Program_Unit_Name
- and then Is_Child_Unit (Id))
+ and then Is_Child_Unit (Id))
then
P := Parent (P);
else
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 00d74c5..d76aa71 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -7556,12 +7556,12 @@ package body Exp_Ch3 is
-- Do not generate invariant procedure within other assertion
-- subprograms, which may involve local declarations of local
- -- subtypes to which these checks don't apply.
+ -- subtypes to which these checks do not apply.
elsif Has_Invariants (Def_Id) then
if Within_Internal_Subprogram
- or else (Ekind (Current_Scope) = E_Function
- and then Is_Predicate_Function (Current_Scope))
+ or else (Ekind (Current_Scope) = E_Function
+ and then Is_Predicate_Function (Current_Scope))
then
null;
else
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index fb57275..bda0efe 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -4061,6 +4061,7 @@ package body Exp_Ch4 is
New_Copy_Tree (Right_Opnd (N))));
Set_Left_Opnd (Mod_Expr,
Unchecked_Convert_To (Standard_Integer, Op_Expr));
+
else
Set_Left_Opnd (Op_Expr,
Unchecked_Convert_To (Standard_Integer,
@@ -4157,6 +4158,7 @@ package body Exp_Ch4 is
Expand_Modular_Subtraction;
when N_Op_Minus =>
+
-- Expand -expr into (0 - expr)
Rewrite (N,
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 8098a93..bcdd92a 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -823,6 +823,7 @@ package body Exp_Util is
Flag_Id : constant Entity_Id := Make_Temporary (Loc, 'F');
Flag_Expr : Node_Id;
Param : Node_Id;
+ Pref : Node_Id;
Temp : Node_Id;
begin
@@ -877,19 +878,17 @@ package body Exp_Util is
-- in the code that follows.
else
- if
- Nkind (Parent (Temp)) = N_Unchecked_Type_Conversion
+ Pref := Temp;
+
+ if Nkind (Parent (Pref)) = N_Unchecked_Type_Conversion
then
- Param :=
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Parent (Temp)),
- Attribute_Name => Name_Tag);
- else
- Param :=
- Make_Attribute_Reference (Loc,
- Prefix => Relocate_Node (Temp),
- Attribute_Name => Name_Tag);
+ Pref := Parent (Pref);
end if;
+
+ Param :=
+ Make_Attribute_Reference (Loc,
+ Prefix => Relocate_Node (Pref),
+ Attribute_Name => Name_Tag);
end if;
-- Generate:
diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb
index b31277b..fe62b7b 100644
--- a/gcc/ada/gnatls.adb
+++ b/gcc/ada/gnatls.adb
@@ -1232,7 +1232,7 @@ procedure Gnatls is
Uninitialized_Prefix : constant String := '#' & Path_Separator;
-- Prefix to indicate that the project path has not been initialized
- -- yet. Must be two characters long
+ -- yet. Must be two characters long.
---------------------
-- Add_Directories --
@@ -1244,6 +1244,7 @@ procedure Gnatls is
Prepend : Boolean := False)
is
Tmp : String_Access;
+
begin
if Self = null then
Self := new String'(Uninitialized_Prefix & Path);
@@ -1256,7 +1257,6 @@ procedure Gnatls is
end if;
Free (Tmp);
end if;
-
end Add_Directories;
-------------------------------------
@@ -1306,6 +1306,7 @@ procedure Gnatls is
else
(1 => Directory_Separator));
-- Note: Target_Name has a trailing / when it comes from Sdefault
+
begin
Add_Str_To_Name_Buffer
(Path_Separator & Prefix.all & Target_Name & Extra_Sep & Suffix);
@@ -1315,15 +1316,15 @@ procedure Gnatls is
begin
if Self /= null
- and then (Self'Length = 0
+ and then (Self'Length = 0
or else Self (Self'First) /= '#')
then
return;
end if;
-- The current directory is always first in the search path. Since
- -- the Project_Path currently starts with '#:' as a sign that it
- -- isn't initialized, we simply replace '#' with '.'
+ -- the Project_Path currently starts with '#:' as a sign that it is
+ -- not initialized, we simply replace '#' with '.'
if Self = null then
Self := new String'('.' & Path_Separator);
@@ -1342,12 +1343,12 @@ procedure Gnatls is
Ada_Prj_Path := Getenv (Ada_Project_Path);
if Gpr_Prj_Path_File.all /= "" then
-
FD := Open_Read (Gpr_Prj_Path_File.all, GNAT.OS_Lib.Text);
if FD = Invalid_FD then
- Osint.Fail ("warning: could not read project path file """ &
- Gpr_Prj_Path_File.all & """");
+ Osint.Fail
+ ("warning: could not read project path file """
+ & Gpr_Prj_Path_File.all & """");
end if;
Len := Integer (File_Length (FD));
@@ -1448,8 +1449,7 @@ procedure Gnatls is
Add_Default_Dir := False;
for J in Last + 1 .. Name_Len loop
- Name_Buffer (J - 2) :=
- Name_Buffer (J);
+ Name_Buffer (J - 2) := Name_Buffer (J);
end loop;
Name_Len := Name_Len - 2;
@@ -1515,11 +1515,13 @@ procedure Gnatls is
if Base_Name (Runtime_Name) = Runtime_Name then
-- $prefix/$target/$runtime/lib/gnat
+
Add_Target
(Runtime_Name & Directory_Separator &
"lib" & Directory_Separator & "gnat");
-- $prefix/$target/$runtime/share/gpr
+
Add_Target
(Runtime_Name & Directory_Separator &
"share" & Directory_Separator & "gpr");
@@ -1529,11 +1531,13 @@ procedure Gnatls is
new String'(Normalize_Pathname (Runtime_Name));
-- $runtime_dir/lib/gnat
+
Add_Str_To_Name_Buffer
(Path_Separator & Runtime.all & Directory_Separator &
"lib" & Directory_Separator & "gnat");
-- $runtime_dir/share/gpr
+
Add_Str_To_Name_Buffer
(Path_Separator & Runtime.all & Directory_Separator &
"share" & Directory_Separator & "gpr");
@@ -1541,10 +1545,12 @@ procedure Gnatls is
end if;
-- $prefix/$target/lib/gnat
+
Add_Target
("lib" & Directory_Separator & "gnat");
-- $prefix/$target/share/gpr
+
Add_Target
("share" & Directory_Separator & "gpr");
end if;
@@ -1589,8 +1595,8 @@ procedure Gnatls is
end if;
else
- -- Because we don't want to resolve symbolic links, we cannot
- -- use Locate_Regular_File. So, we try each possible path
+ -- Because we do not want to resolve symbolic links, we cannot
+ -- use Locate_Regular_File. Instead we try each possible path
-- successively.
First := Self'First;
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 7f2d105..18107fc 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -3763,6 +3763,7 @@ package body Sem_Attr is
--------------
when Attribute_Enum_Rep =>
+
-- T'Enum_Rep (X) case
if Present (E1) then
@@ -3770,14 +3771,15 @@ package body Sem_Attr is
Check_Discrete_Type;
Resolve (E1, P_Base_Type);
- -- X'Enum_Rep case. X must be an object or enumeration literal, and
+ -- X'Enum_Rep case. X must be an object or enumeration literal, and
-- it must be of a discrete type.
- elsif not ((Is_Object_Reference (P)
- or else (Is_Entity_Name (P)
- and then Ekind (Entity (P)) =
- E_Enumeration_Literal))
- and then Is_Discrete_Type (Etype (P)))
+ elsif not
+ ((Is_Object_Reference (P)
+ or else
+ (Is_Entity_Name (P)
+ and then Ekind (Entity (P)) = E_Enumeration_Literal))
+ and then Is_Discrete_Type (Etype (P)))
then
Error_Attr_P ("prefix of % attribute must be discrete object");
end if;
diff --git a/gcc/ada/xoscons.adb b/gcc/ada/xoscons.adb
index 39a39f3..d1e4b24 100644
--- a/gcc/ada/xoscons.adb
+++ b/gcc/ada/xoscons.adb
@@ -152,8 +152,8 @@ procedure XOSCons is
-- True if S contains Tmpl_Name, possibly with different casing
function Spaces (Count : Integer) return String;
- -- If Count is positive, return a string of Count spaces, else return an
- -- empty string.
+ -- If Count is positive, return a string of Count spaces, else return
+ -- an empty string.
---------
-- ">" --