Commit 3e720c96 by Hristian Kirtchev Committed by Arnaud Charlet

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
parent f8159014
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> 2017-09-06 Raphael Amiard <amiard@adacore.com>
* a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
......
...@@ -7556,7 +7556,7 @@ package body Exp_Ch3 is ...@@ -7556,7 +7556,7 @@ package body Exp_Ch3 is
-- Do not generate invariant procedure within other assertion -- Do not generate invariant procedure within other assertion
-- subprograms, which may involve local declarations of local -- 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 elsif Has_Invariants (Def_Id) then
if Within_Internal_Subprogram if Within_Internal_Subprogram
......
...@@ -4061,6 +4061,7 @@ package body Exp_Ch4 is ...@@ -4061,6 +4061,7 @@ package body Exp_Ch4 is
New_Copy_Tree (Right_Opnd (N)))); New_Copy_Tree (Right_Opnd (N))));
Set_Left_Opnd (Mod_Expr, Set_Left_Opnd (Mod_Expr,
Unchecked_Convert_To (Standard_Integer, Op_Expr)); Unchecked_Convert_To (Standard_Integer, Op_Expr));
else else
Set_Left_Opnd (Op_Expr, Set_Left_Opnd (Op_Expr,
Unchecked_Convert_To (Standard_Integer, Unchecked_Convert_To (Standard_Integer,
...@@ -4157,6 +4158,7 @@ package body Exp_Ch4 is ...@@ -4157,6 +4158,7 @@ package body Exp_Ch4 is
Expand_Modular_Subtraction; Expand_Modular_Subtraction;
when N_Op_Minus => when N_Op_Minus =>
-- Expand -expr into (0 - expr) -- Expand -expr into (0 - expr)
Rewrite (N, Rewrite (N,
......
...@@ -823,6 +823,7 @@ package body Exp_Util is ...@@ -823,6 +823,7 @@ package body Exp_Util is
Flag_Id : constant Entity_Id := Make_Temporary (Loc, 'F'); Flag_Id : constant Entity_Id := Make_Temporary (Loc, 'F');
Flag_Expr : Node_Id; Flag_Expr : Node_Id;
Param : Node_Id; Param : Node_Id;
Pref : Node_Id;
Temp : Node_Id; Temp : Node_Id;
begin begin
...@@ -877,20 +878,18 @@ package body Exp_Util is ...@@ -877,20 +878,18 @@ package body Exp_Util is
-- in the code that follows. -- in the code that follows.
else else
if Pref := Temp;
Nkind (Parent (Temp)) = N_Unchecked_Type_Conversion
if Nkind (Parent (Pref)) = N_Unchecked_Type_Conversion
then then
Pref := Parent (Pref);
end if;
Param := Param :=
Make_Attribute_Reference (Loc, Make_Attribute_Reference (Loc,
Prefix => Relocate_Node (Parent (Temp)), Prefix => Relocate_Node (Pref),
Attribute_Name => Name_Tag);
else
Param :=
Make_Attribute_Reference (Loc,
Prefix => Relocate_Node (Temp),
Attribute_Name => Name_Tag); Attribute_Name => Name_Tag);
end if; end if;
end if;
-- Generate: -- Generate:
-- Needs_Finalization (<Param>) -- Needs_Finalization (<Param>)
......
...@@ -1232,7 +1232,7 @@ procedure Gnatls is ...@@ -1232,7 +1232,7 @@ procedure Gnatls is
Uninitialized_Prefix : constant String := '#' & Path_Separator; Uninitialized_Prefix : constant String := '#' & Path_Separator;
-- Prefix to indicate that the project path has not been initialized -- 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 -- -- Add_Directories --
...@@ -1244,6 +1244,7 @@ procedure Gnatls is ...@@ -1244,6 +1244,7 @@ procedure Gnatls is
Prepend : Boolean := False) Prepend : Boolean := False)
is is
Tmp : String_Access; Tmp : String_Access;
begin begin
if Self = null then if Self = null then
Self := new String'(Uninitialized_Prefix & Path); Self := new String'(Uninitialized_Prefix & Path);
...@@ -1256,7 +1257,6 @@ procedure Gnatls is ...@@ -1256,7 +1257,6 @@ procedure Gnatls is
end if; end if;
Free (Tmp); Free (Tmp);
end if; end if;
end Add_Directories; end Add_Directories;
------------------------------------- -------------------------------------
...@@ -1306,6 +1306,7 @@ procedure Gnatls is ...@@ -1306,6 +1306,7 @@ procedure Gnatls is
else else
(1 => Directory_Separator)); (1 => Directory_Separator));
-- Note: Target_Name has a trailing / when it comes from Sdefault -- Note: Target_Name has a trailing / when it comes from Sdefault
begin begin
Add_Str_To_Name_Buffer Add_Str_To_Name_Buffer
(Path_Separator & Prefix.all & Target_Name & Extra_Sep & Suffix); (Path_Separator & Prefix.all & Target_Name & Extra_Sep & Suffix);
...@@ -1322,8 +1323,8 @@ procedure Gnatls is ...@@ -1322,8 +1323,8 @@ procedure Gnatls is
end if; end if;
-- The current directory is always first in the search path. Since -- The current directory is always first in the search path. Since
-- the Project_Path currently starts with '#:' as a sign that it -- the Project_Path currently starts with '#:' as a sign that it is
-- isn't initialized, we simply replace '#' with '.' -- not initialized, we simply replace '#' with '.'
if Self = null then if Self = null then
Self := new String'('.' & Path_Separator); Self := new String'('.' & Path_Separator);
...@@ -1342,12 +1343,12 @@ procedure Gnatls is ...@@ -1342,12 +1343,12 @@ procedure Gnatls is
Ada_Prj_Path := Getenv (Ada_Project_Path); Ada_Prj_Path := Getenv (Ada_Project_Path);
if Gpr_Prj_Path_File.all /= "" then if Gpr_Prj_Path_File.all /= "" then
FD := Open_Read (Gpr_Prj_Path_File.all, GNAT.OS_Lib.Text); FD := Open_Read (Gpr_Prj_Path_File.all, GNAT.OS_Lib.Text);
if FD = Invalid_FD then if FD = Invalid_FD then
Osint.Fail ("warning: could not read project path file """ & Osint.Fail
Gpr_Prj_Path_File.all & """"); ("warning: could not read project path file """
& Gpr_Prj_Path_File.all & """");
end if; end if;
Len := Integer (File_Length (FD)); Len := Integer (File_Length (FD));
...@@ -1448,8 +1449,7 @@ procedure Gnatls is ...@@ -1448,8 +1449,7 @@ procedure Gnatls is
Add_Default_Dir := False; Add_Default_Dir := False;
for J in Last + 1 .. Name_Len loop for J in Last + 1 .. Name_Len loop
Name_Buffer (J - 2) := Name_Buffer (J - 2) := Name_Buffer (J);
Name_Buffer (J);
end loop; end loop;
Name_Len := Name_Len - 2; Name_Len := Name_Len - 2;
...@@ -1515,11 +1515,13 @@ procedure Gnatls is ...@@ -1515,11 +1515,13 @@ procedure Gnatls is
if Base_Name (Runtime_Name) = Runtime_Name then if Base_Name (Runtime_Name) = Runtime_Name then
-- $prefix/$target/$runtime/lib/gnat -- $prefix/$target/$runtime/lib/gnat
Add_Target Add_Target
(Runtime_Name & Directory_Separator & (Runtime_Name & Directory_Separator &
"lib" & Directory_Separator & "gnat"); "lib" & Directory_Separator & "gnat");
-- $prefix/$target/$runtime/share/gpr -- $prefix/$target/$runtime/share/gpr
Add_Target Add_Target
(Runtime_Name & Directory_Separator & (Runtime_Name & Directory_Separator &
"share" & Directory_Separator & "gpr"); "share" & Directory_Separator & "gpr");
...@@ -1529,11 +1531,13 @@ procedure Gnatls is ...@@ -1529,11 +1531,13 @@ procedure Gnatls is
new String'(Normalize_Pathname (Runtime_Name)); new String'(Normalize_Pathname (Runtime_Name));
-- $runtime_dir/lib/gnat -- $runtime_dir/lib/gnat
Add_Str_To_Name_Buffer Add_Str_To_Name_Buffer
(Path_Separator & Runtime.all & Directory_Separator & (Path_Separator & Runtime.all & Directory_Separator &
"lib" & Directory_Separator & "gnat"); "lib" & Directory_Separator & "gnat");
-- $runtime_dir/share/gpr -- $runtime_dir/share/gpr
Add_Str_To_Name_Buffer Add_Str_To_Name_Buffer
(Path_Separator & Runtime.all & Directory_Separator & (Path_Separator & Runtime.all & Directory_Separator &
"share" & Directory_Separator & "gpr"); "share" & Directory_Separator & "gpr");
...@@ -1541,10 +1545,12 @@ procedure Gnatls is ...@@ -1541,10 +1545,12 @@ procedure Gnatls is
end if; end if;
-- $prefix/$target/lib/gnat -- $prefix/$target/lib/gnat
Add_Target Add_Target
("lib" & Directory_Separator & "gnat"); ("lib" & Directory_Separator & "gnat");
-- $prefix/$target/share/gpr -- $prefix/$target/share/gpr
Add_Target Add_Target
("share" & Directory_Separator & "gpr"); ("share" & Directory_Separator & "gpr");
end if; end if;
...@@ -1589,8 +1595,8 @@ procedure Gnatls is ...@@ -1589,8 +1595,8 @@ procedure Gnatls is
end if; end if;
else else
-- Because we don't want to resolve symbolic links, we cannot -- Because we do not want to resolve symbolic links, we cannot
-- use Locate_Regular_File. So, we try each possible path -- use Locate_Regular_File. Instead we try each possible path
-- successively. -- successively.
First := Self'First; First := Self'First;
......
...@@ -3763,6 +3763,7 @@ package body Sem_Attr is ...@@ -3763,6 +3763,7 @@ package body Sem_Attr is
-------------- --------------
when Attribute_Enum_Rep => when Attribute_Enum_Rep =>
-- T'Enum_Rep (X) case -- T'Enum_Rep (X) case
if Present (E1) then if Present (E1) then
...@@ -3773,10 +3774,11 @@ package body Sem_Attr is ...@@ -3773,10 +3774,11 @@ package body Sem_Attr is
-- 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. -- it must be of a discrete type.
elsif not ((Is_Object_Reference (P) elsif not
or else (Is_Entity_Name (P) ((Is_Object_Reference (P)
and then Ekind (Entity (P)) = or else
E_Enumeration_Literal)) (Is_Entity_Name (P)
and then Ekind (Entity (P)) = E_Enumeration_Literal))
and then Is_Discrete_Type (Etype (P))) and then Is_Discrete_Type (Etype (P)))
then then
Error_Attr_P ("prefix of % attribute must be discrete object"); Error_Attr_P ("prefix of % attribute must be discrete object");
......
...@@ -152,8 +152,8 @@ procedure XOSCons is ...@@ -152,8 +152,8 @@ procedure XOSCons is
-- True if S contains Tmpl_Name, possibly with different casing -- True if S contains Tmpl_Name, possibly with different casing
function Spaces (Count : Integer) return String; function Spaces (Count : Integer) return String;
-- If Count is positive, return a string of Count spaces, else return an -- If Count is positive, return a string of Count spaces, else return
-- empty string. -- an empty string.
--------- ---------
-- ">" -- -- ">" --
......
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