+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
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;
--------------------------------------
Create_Instantiation_Source (N, E,
Inlined_Body => True,
Inherited_Pragma => False,
- A => S_Adjustment);
+ Factor => S_Adjustment);
end Set_Copied_Sloc_For_Inlined_Body;
---------------------
-- 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;
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);
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;
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);
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)
-- 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
-- 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;
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
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;
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;
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
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 = ");
Write_Eol;
Write_Str (" adjustment factor = ");
- Write_Int (Int (A.Adjust));
+ Write_Int (Int (Factor.Adjust));
Write_Eol;
Write_Str (" instantiation location: ");
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;
-------------------------------------------------
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
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;