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

2016-07-04  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb, sem_type.adb, sem_ch12.adb, xref_lib.adb,
	freeze.adb, sinput-l.adb, sinput-l.ads, sem_ch4.adb, sem_ch8.adb:
	Minor reformatting.

From-SVN: r237965
This commit is contained in:
Hristian Kirtchev 2016-07-04 10:19:10 +00:00 committed by Arnaud Charlet
parent f50f7e2c00
commit c308e7620e
9 changed files with 72 additions and 60 deletions

View File

@ -1,3 +1,9 @@
2016-07-04 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb, sem_type.adb, sem_ch12.adb, xref_lib.adb,
freeze.adb, sinput-l.adb, sinput-l.ads, sem_ch4.adb, sem_ch8.adb:
Minor reformatting.
2016-07-04 Justin Squirek <squirek@adacore.com>
* sem_prag.adb (Analyze_Unmodified_Or_Unused and

View File

@ -15152,12 +15152,13 @@ package body Sem_Ch12 is
procedure Set_Copied_Sloc_For_Inherited_Pragma
(N : Node_Id;
E : Entity_Id) is
E : Entity_Id)
is
begin
Create_Instantiation_Source (N, E,
Inlined_Body => False,
Inherited_Pragma => True,
A => S_Adjustment);
Factor => S_Adjustment);
end Set_Copied_Sloc_For_Inherited_Pragma;
--------------------------------------
@ -15169,7 +15170,7 @@ package body Sem_Ch12 is
Create_Instantiation_Source (N, E,
Inlined_Body => True,
Inherited_Pragma => False,
A => S_Adjustment);
Factor => S_Adjustment);
end Set_Copied_Sloc_For_Inlined_Body;
---------------------

View File

@ -3470,13 +3470,13 @@ package body Sem_Ch3 is
-- The entity may be a homonym of a private component of the
-- enclosing protected object, for which we create a local
-- renaming declaration. The declaration is legal, even
-- if useless when it just captures that component.
-- renaming declaration. The declaration is legal, even if
-- useless when it just captures that component.
or else
(Ekind (Scope (Current_Scope)) = E_Protected_Type
and then Nkind (Parent (Prev_Entity)) =
N_Object_Renaming_Declaration))
(Ekind (Scope (Current_Scope)) = E_Protected_Type
and then Nkind (Parent (Prev_Entity)) =
N_Object_Renaming_Declaration))
then
Prev_Entity := Empty;
end if;

View File

@ -3418,12 +3418,13 @@ package body Sem_Ch4 is
elsif ((Ekind (Current_Scope) = E_Function
and then Is_Predicate_Function (Current_Scope))
or else (Ekind (Nam) = E_Function
or else
(Ekind (Nam) = E_Function
and then Is_Predicate_Function (Nam)))
and then
and then
(Base_Type (Underlying_Type (Etype (Formal))) =
Base_Type (Underlying_Type (Etype (Actual))))
and then Serious_Errors_Detected = 0
Base_Type (Underlying_Type (Etype (Actual))))
and then Serious_Errors_Detected = 0
then
Set_Etype (Formal, Etype (Actual));
Next_Actual (Actual);

View File

@ -6996,8 +6996,8 @@ package body Sem_Ch8 is
and then not Is_Tagged_Type (Etype (First_Entity (F)))
then
Error_Msg_N
("prefixed call is only allowed for objects "
& "of a tagged type", N);
("prefixed call is only allowed for objects of a "
& "tagged type", N);
end if;
end;

View File

@ -1607,9 +1607,9 @@ package body Sem_Type is
Act1 := Left_Opnd (N);
Act2 := Right_Opnd (N);
-- Use type of second formal, so as to include
-- exponentiation, where the exponent may be
-- ambiguous and the result non-universal.
-- Use the type of tye second formal, so as to include
-- exponentiation, where the exponent may be ambiguous and
-- the result non-universal.
Next_Formal (F1);
@ -1619,10 +1619,10 @@ package body Sem_Type is
if Nkind (Act1) in N_Op
and then Is_Overloaded (Act1)
and then (Nkind (Act1) in N_Unary_Op
or else Nkind_In
(Left_Opnd (Act1), N_Integer_Literal,
N_Real_Literal))
and then
(Nkind (Act1) in N_Unary_Op
or else Nkind_In (Left_Opnd (Act1), N_Integer_Literal,
N_Real_Literal))
and then Nkind_In (Right_Opnd (Act1), N_Integer_Literal,
N_Real_Literal)
and then Has_Compatible_Type (Act1, Standard_Boolean)

View File

@ -91,7 +91,10 @@ package body Sinput.L is
-- Adjust_Instantiation_Sloc --
-------------------------------
procedure Adjust_Instantiation_Sloc (N : Node_Id; A : Sloc_Adjustment) is
procedure Adjust_Instantiation_Sloc
(N : Node_Id;
Factor : Sloc_Adjustment)
is
Loc : constant Source_Ptr := Sloc (N);
begin
@ -100,8 +103,8 @@ package body Sinput.L is
-- case, but in practice there seem to be some nodes that get copied
-- twice, and this is a defence against that happening.
if A.Lo <= Loc and then Loc <= A.Hi then
Set_Sloc (N, Loc + A.Adjust);
if Factor.Lo <= Loc and then Loc <= Factor.Hi then
Set_Sloc (N, Loc + Factor.Adjust);
end if;
end Adjust_Instantiation_Sloc;
@ -123,7 +126,7 @@ package body Sinput.L is
procedure Create_Instantiation_Source
(Inst_Node : Entity_Id;
Template_Id : Entity_Id;
A : out Sloc_Adjustment;
Factor : out Sloc_Adjustment;
Inlined_Body : Boolean := False;
Inherited_Pragma : Boolean := False)
is
@ -132,9 +135,9 @@ package body Sinput.L is
Xnew : Source_File_Index;
begin
Xold := Get_Source_File_Index (Sloc (Template_Id));
A.Lo := Source_File.Table (Xold).Source_First;
A.Hi := Source_File.Table (Xold).Source_Last;
Xold := Get_Source_File_Index (Sloc (Template_Id));
Factor.Lo := Source_File.Table (Xold).Source_First;
Factor.Hi := Source_File.Table (Xold).Source_Last;
Source_File.Append (Source_File.Table (Xold));
Xnew := Source_File.Last;
@ -209,22 +212,22 @@ package body Sinput.L is
end if;
end if;
-- Now we need to compute the new values of Source_First and
-- Source_Last and adjust the source file pointer to have the
-- correct virtual origin for the new range of values.
-- Now compute the new values of Source_First and Source_Last and
-- adjust the source file pointer to have the correct virtual origin
-- for the new range of values.
-- Source_First must be greater than the last Source_Last value
-- and also must be a multiple of Source_Align
-- Source_First must be greater than the last Source_Last value and
-- also must be a multiple of Source_Align.
Snew.Source_First :=
((Source_File.Table (Xnew - 1).Source_Last + Source_Align) /
Source_Align) * Source_Align;
A.Adjust := Snew.Source_First - A.Lo;
Snew.Source_Last := A.Hi + A.Adjust;
Factor.Adjust := Snew.Source_First - Factor.Lo;
Snew.Source_Last := Factor.Hi + Factor.Adjust;
Set_Source_File_Index_Table (Xnew);
Snew.Sloc_Adjust := Sold.Sloc_Adjust - A.Adjust;
Snew.Sloc_Adjust := Sold.Sloc_Adjust - Factor.Adjust;
if Debug_Flag_L then
Write_Eol;
@ -258,7 +261,6 @@ package body Sinput.L is
Write_Str ("body of package ");
else pragma Assert (Ekind (Template_Id) = E_Subprogram_Body);
if Nkind (Dnod) = N_Procedure_Specification then
Write_Str ("body of procedure ");
else
@ -282,11 +284,11 @@ package body Sinput.L is
Write_Eol;
Write_Str (" old lo = ");
Write_Int (Int (A.Lo));
Write_Int (Int (Factor.Lo));
Write_Eol;
Write_Str (" old hi = ");
Write_Int (Int (A.Hi));
Write_Int (Int (Factor.Hi));
Write_Eol;
Write_Str (" new lo = ");
@ -298,7 +300,7 @@ package body Sinput.L is
Write_Eol;
Write_Str (" adjustment factor = ");
Write_Int (Int (A.Adjust));
Write_Int (Int (Factor.Adjust));
Write_Eol;
Write_Str (" instantiation location: ");
@ -328,7 +330,7 @@ package body Sinput.L is
begin
Snew.Source_Text :=
To_Source_Buffer_Ptr
(Sold.Source_Text (-A.Adjust)'Address);
(Sold.Source_Text (-Factor.Adjust)'Address);
end;
end;
end Create_Instantiation_Source;

View File

@ -79,32 +79,34 @@ package Sinput.L is
-------------------------------------------------
type Sloc_Adjustment is private;
-- Type returned by Create_Instantiation_Source for use in subsequent
-- calls to Adjust_Instantiation_Sloc.
-- Type returned by Create_Instantiation_Source for use in subsequent calls
-- to Adjust_Instantiation_Sloc.
procedure Adjust_Instantiation_Sloc
(N : Node_Id;
Factor : Sloc_Adjustment);
-- The instantiation tree is created by copying the tree of the generic
-- template (including the original Sloc values), and then applying
-- Adjust_Instantiation_Sloc to each copied node to adjust the Sloc to
-- reference the source entry for the instantiation.
procedure Create_Instantiation_Source
(Inst_Node : Entity_Id;
Template_Id : Entity_Id;
A : out Sloc_Adjustment;
Factor : out Sloc_Adjustment;
Inlined_Body : Boolean := False;
Inherited_Pragma : Boolean := False);
-- This procedure creates the source table entry for an instantiation.
-- Inst_Node is the instantiation node, and Template_Id is the defining
-- identifier of the generic declaration or body unit as appropriate.
-- A is set to an adjustment factor to be used in subsequent calls to
-- Adjust_Instantiation_Sloc. The instantiation mechanism is also used
-- for inlined function and procedure calls. The parameter Inlined_Body is
-- set to True in such cases. This is used for generating error messages
-- that distinguish these two cases, otherwise the two cases are handled
-- identically. Similarly, the instantiation mechanism is also used
-- for inherited class-wide pre- and postconditions. The parameter
-- Inherited_Pragma is set to True in such cases.
procedure Adjust_Instantiation_Sloc (N : Node_Id; A : Sloc_Adjustment);
-- The instantiation tree is created by copying the tree of the generic
-- template (including the original Sloc values), and then applying
-- Adjust_Instantiation_Sloc to each copied node to adjust the Sloc
-- to reference the source entry for the instantiation.
-- Factor is set to an adjustment factor to be used in subsequent calls to
-- Adjust_Instantiation_Sloc. The instantiation mechanism is also used for
-- inlined function and procedure calls. The parameter Inlined_Body is set
-- to True in such cases. This is used for generating error messages that
-- distinguish these two cases, otherwise the two cases are handled
-- identically. Similarly, the instantiation mechanism is also used for
-- inherited class-wide pre- and postconditions. Parameter Inherited_Pragma
-- is set to True in such cases.
private

View File

@ -890,8 +890,8 @@ package body Xref_Lib is
Parse_Token (Ali, Ptr, E_Name);
-- Exit if the symbol does not match or if we have a local
-- symbol and we do not want it or if the file is unknown.
-- Exit if the symbol does not match or if we have a local symbol and we
-- do not want it or if the file is unknown.
if File.X_File = Empty_File then
return;