exp_ch5.adb, [...]: Minor reformatting.
2014-07-31 Robert Dewar <dewar@adacore.com> * exp_ch5.adb, sem_ch3.adb, exp_ch7.adb, exp_util.adb, exp_ch9.adb, sem_ch7.adb, checks.adb, s-exctra.adb, exp_ch6.adb, exp_disp.adb, exp_dist.adb, sem_ch13.adb, exp_strm.adb, exp_ch3.adb: Minor reformatting. From-SVN: r213325
This commit is contained in:
parent
2fe258bf93
commit
1fb63e89df
|
@ -1,3 +1,10 @@
|
||||||
|
2014-07-31 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
|
* exp_ch5.adb, sem_ch3.adb, exp_ch7.adb, exp_util.adb, exp_ch9.adb,
|
||||||
|
sem_ch7.adb, checks.adb, s-exctra.adb, exp_ch6.adb, exp_disp.adb,
|
||||||
|
exp_dist.adb, sem_ch13.adb, exp_strm.adb, exp_ch3.adb: Minor
|
||||||
|
reformatting.
|
||||||
|
|
||||||
2014-07-31 Robert Dewar <dewar@adacore.com>
|
2014-07-31 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
* sem_ch13.adb: Minor reformatting.
|
* sem_ch13.adb: Minor reformatting.
|
||||||
|
|
|
@ -6055,7 +6055,7 @@ package body Checks is
|
||||||
|
|
||||||
-- For an untagged derived type, use the discriminants of the parent
|
-- For an untagged derived type, use the discriminants of the parent
|
||||||
-- which have been renamed in the derivation, possibly by a one-to-many
|
-- which have been renamed in the derivation, possibly by a one-to-many
|
||||||
-- discriminant constraint. For non-tagged type, initially get the Etype
|
-- discriminant constraint. For untagged type, initially get the Etype
|
||||||
-- of the prefix
|
-- of the prefix
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -148,8 +148,8 @@ package body Exp_Ch3 is
|
||||||
-- The resulting operation is a TSS subprogram.
|
-- The resulting operation is a TSS subprogram.
|
||||||
|
|
||||||
procedure Build_Variant_Record_Equality (Typ : Entity_Id);
|
procedure Build_Variant_Record_Equality (Typ : Entity_Id);
|
||||||
-- Create An Equality function for the non-tagged variant record Typ
|
-- Create An Equality function for the untagged variant record Typ and
|
||||||
-- and attach it to the TSS list
|
-- attach it to the TSS list
|
||||||
|
|
||||||
procedure Check_Stream_Attributes (Typ : Entity_Id);
|
procedure Check_Stream_Attributes (Typ : Entity_Id);
|
||||||
-- Check that if a limited extension has a parent with user-defined stream
|
-- Check that if a limited extension has a parent with user-defined stream
|
||||||
|
@ -242,7 +242,7 @@ package body Exp_Ch3 is
|
||||||
CL : Node_Id;
|
CL : Node_Id;
|
||||||
Discrs : Elist_Id := New_Elmt_List) return List_Id;
|
Discrs : Elist_Id := New_Elmt_List) return List_Id;
|
||||||
-- Building block for variant record equality. Defined to share the code
|
-- Building block for variant record equality. Defined to share the code
|
||||||
-- between the tagged and non-tagged case. Given a Component_List node CL,
|
-- between the tagged and untagged case. Given a Component_List node CL,
|
||||||
-- it generates an 'if' followed by a 'case' statement that compares all
|
-- it generates an 'if' followed by a 'case' statement that compares all
|
||||||
-- components of local temporaries named X and Y (that are declared as
|
-- components of local temporaries named X and Y (that are declared as
|
||||||
-- formals at some upper level). E provides the Sloc to be used for the
|
-- formals at some upper level). E provides the Sloc to be used for the
|
||||||
|
@ -256,7 +256,7 @@ package body Exp_Ch3 is
|
||||||
(E : Entity_Id;
|
(E : Entity_Id;
|
||||||
L : List_Id) return Node_Id;
|
L : List_Id) return Node_Id;
|
||||||
-- Building block for variant record equality. Defined to share the code
|
-- Building block for variant record equality. Defined to share the code
|
||||||
-- between the tagged and non-tagged case. Given the list of components
|
-- between the tagged and untagged case. Given the list of components
|
||||||
-- (or discriminants) L, it generates a return statement that compares all
|
-- (or discriminants) L, it generates a return statement that compares all
|
||||||
-- components of local temporaries named X and Y (that are declared as
|
-- components of local temporaries named X and Y (that are declared as
|
||||||
-- formals at some upper level). E provides the Sloc to be used for the
|
-- formals at some upper level). E provides the Sloc to be used for the
|
||||||
|
@ -1752,12 +1752,10 @@ package body Exp_Ch3 is
|
||||||
-- objects on list Decls.
|
-- objects on list Decls.
|
||||||
|
|
||||||
function Build_Init_Call_Thru (Parameters : List_Id) return List_Id;
|
function Build_Init_Call_Thru (Parameters : List_Id) return List_Id;
|
||||||
-- Given a non-tagged type-derivation that declares discriminants,
|
-- Given a untagged type-derivation that declares discriminants, e.g.
|
||||||
-- such as
|
|
||||||
--
|
--
|
||||||
-- type R (R1, R2 : Integer) is record ... end record;
|
-- type R (R1, R2 : Integer) is record ... end record;
|
||||||
--
|
-- type D (D1 : Integer) is new R (1, D1);
|
||||||
-- type D (D1 : Integer) is new R (1, D1);
|
|
||||||
--
|
--
|
||||||
-- we make the _init_proc of D be
|
-- we make the _init_proc of D be
|
||||||
--
|
--
|
||||||
|
@ -5840,7 +5838,7 @@ package body Exp_Ch3 is
|
||||||
|
|
||||||
-- Handle C++ constructor calls. Note that we do not check that
|
-- Handle C++ constructor calls. Note that we do not check that
|
||||||
-- Typ is a tagged type since the equivalent Ada type of a C++
|
-- Typ is a tagged type since the equivalent Ada type of a C++
|
||||||
-- class that has no virtual methods is a non-tagged limited
|
-- class that has no virtual methods is a untagged limited
|
||||||
-- record type.
|
-- record type.
|
||||||
|
|
||||||
elsif Is_CPP_Constructor_Call (Expr) then
|
elsif Is_CPP_Constructor_Call (Expr) then
|
||||||
|
@ -6802,7 +6800,7 @@ package body Exp_Ch3 is
|
||||||
Next_Component (Comp);
|
Next_Component (Comp);
|
||||||
end loop;
|
end loop;
|
||||||
|
|
||||||
-- Handle constructors of non-tagged CPP_Class types
|
-- Handle constructors of untagged CPP_Class types
|
||||||
|
|
||||||
if not Is_Tagged_Type (Def_Id) and then Is_CPP_Class (Def_Id) then
|
if not Is_Tagged_Type (Def_Id) and then Is_CPP_Class (Def_Id) then
|
||||||
Set_CPP_Constructors (Def_Id);
|
Set_CPP_Constructors (Def_Id);
|
||||||
|
@ -7019,7 +7017,7 @@ package body Exp_Ch3 is
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- In the non-tagged case, ever since Ada 83 an equality function must
|
-- In the untagged case, ever since Ada 83 an equality function must
|
||||||
-- be provided for variant records that are not unchecked unions.
|
-- be provided for variant records that are not unchecked unions.
|
||||||
-- In Ada 2012 the equality function composes, and thus must be built
|
-- In Ada 2012 the equality function composes, and thus must be built
|
||||||
-- explicitly just as for tagged records.
|
-- explicitly just as for tagged records.
|
||||||
|
|
|
@ -106,7 +106,7 @@ package body Exp_Ch5 is
|
||||||
-- using the standard Insert_Actions mechanism.
|
-- using the standard Insert_Actions mechanism.
|
||||||
|
|
||||||
procedure Expand_Assign_Record (N : Node_Id);
|
procedure Expand_Assign_Record (N : Node_Id);
|
||||||
-- N is an assignment of a non-tagged record value. This routine handles
|
-- N is an assignment of a untagged record value. This routine handles
|
||||||
-- the case where the assignment must be made component by component,
|
-- the case where the assignment must be made component by component,
|
||||||
-- either because the target is not byte aligned, or there is a change
|
-- either because the target is not byte aligned, or there is a change
|
||||||
-- of representation, or when we have a tagged type with a representation
|
-- of representation, or when we have a tagged type with a representation
|
||||||
|
|
|
@ -2016,7 +2016,7 @@ package body Exp_Ch6 is
|
||||||
-- entity and Orig_Subp is the entity of the call node N.
|
-- entity and Orig_Subp is the entity of the call node N.
|
||||||
|
|
||||||
function Inherited_From_Formal (S : Entity_Id) return Entity_Id;
|
function Inherited_From_Formal (S : Entity_Id) return Entity_Id;
|
||||||
-- Within an instance, a type derived from a non-tagged formal derived
|
-- Within an instance, a type derived from an untagged formal derived
|
||||||
-- type inherits from the original parent, not from the actual. The
|
-- type inherits from the original parent, not from the actual. The
|
||||||
-- current derivation mechanism has the derived type inherit from the
|
-- current derivation mechanism has the derived type inherit from the
|
||||||
-- actual, which is only correct outside of the instance. If the
|
-- actual, which is only correct outside of the instance. If the
|
||||||
|
|
|
@ -5079,7 +5079,7 @@ package body Exp_Ch7 is
|
||||||
Utyp := Underlying_Type (Base_Type (Utyp));
|
Utyp := Underlying_Type (Base_Type (Utyp));
|
||||||
Set_Assignment_OK (Ref);
|
Set_Assignment_OK (Ref);
|
||||||
|
|
||||||
-- Deal with non-tagged derivation of private views
|
-- Deal with untagged derivation of private views
|
||||||
|
|
||||||
if Is_Untagged_Derivation (Typ) then
|
if Is_Untagged_Derivation (Typ) then
|
||||||
Utyp := Underlying_Type (Root_Type (Base_Type (Typ)));
|
Utyp := Underlying_Type (Root_Type (Base_Type (Typ)));
|
||||||
|
@ -7284,7 +7284,7 @@ package body Exp_Ch7 is
|
||||||
Utyp := Underlying_Type (Base_Type (Utyp));
|
Utyp := Underlying_Type (Base_Type (Utyp));
|
||||||
Set_Assignment_OK (Ref);
|
Set_Assignment_OK (Ref);
|
||||||
|
|
||||||
-- Deal with non-tagged derivation of private views. If the parent type
|
-- Deal with untagged derivation of private views. If the parent type
|
||||||
-- is a protected type, Deep_Finalize is found on the corresponding
|
-- is a protected type, Deep_Finalize is found on the corresponding
|
||||||
-- record of the ancestor.
|
-- record of the ancestor.
|
||||||
|
|
||||||
|
@ -7751,7 +7751,7 @@ package body Exp_Ch7 is
|
||||||
|
|
||||||
Utyp := Underlying_Type (Base_Type (Utyp));
|
Utyp := Underlying_Type (Base_Type (Utyp));
|
||||||
|
|
||||||
-- Deal with non-tagged derivation of private views
|
-- Deal with untagged derivation of private views
|
||||||
|
|
||||||
if Is_Untagged_Derivation (Typ) and then not Is_Conc then
|
if Is_Untagged_Derivation (Typ) and then not Is_Conc then
|
||||||
Utyp := Underlying_Type (Root_Type (Base_Type (Typ)));
|
Utyp := Underlying_Type (Root_Type (Base_Type (Typ)));
|
||||||
|
@ -7878,7 +7878,7 @@ package body Exp_Ch7 is
|
||||||
|
|
||||||
Utyp := Underlying_Type (Base_Type (Utyp));
|
Utyp := Underlying_Type (Base_Type (Utyp));
|
||||||
|
|
||||||
-- Deal with non-tagged derivation of private views. If the parent is
|
-- Deal with untagged derivation of private views. If the parent is
|
||||||
-- now known to be protected, the finalization routine is the one
|
-- now known to be protected, the finalization routine is the one
|
||||||
-- defined on the corresponding record of the ancestor (corresponding
|
-- defined on the corresponding record of the ancestor (corresponding
|
||||||
-- records do not automatically inherit operations, but maybe they
|
-- records do not automatically inherit operations, but maybe they
|
||||||
|
|
|
@ -2511,8 +2511,7 @@ package body Exp_Ch9 is
|
||||||
-- Start of processing for Build_Wrapper_Spec
|
-- Start of processing for Build_Wrapper_Spec
|
||||||
|
|
||||||
begin
|
begin
|
||||||
-- There is no point in building wrappers for non-tagged concurrent
|
-- No point in building wrappers for untagged concurrent types
|
||||||
-- types.
|
|
||||||
|
|
||||||
pragma Assert (Is_Tagged_Type (Obj_Typ));
|
pragma Assert (Is_Tagged_Type (Obj_Typ));
|
||||||
|
|
||||||
|
|
|
@ -3672,18 +3672,17 @@ package body Exp_Disp is
|
||||||
(Subp : Entity_Id;
|
(Subp : Entity_Id;
|
||||||
Tagged_Type : Entity_Id;
|
Tagged_Type : Entity_Id;
|
||||||
Typ : Entity_Id);
|
Typ : Entity_Id);
|
||||||
-- Verify that all non-tagged types in the profile of a subprogram
|
-- Verify that all untagged types in the profile of a subprogram are
|
||||||
-- are frozen at the point the subprogram is frozen. This enforces
|
-- frozen at the point the subprogram is frozen. This enforces the rule
|
||||||
-- the rule on RM 13.14 (14) as modified by AI05-019. At the point a
|
-- on RM 13.14 (14) as modified by AI05-019. At the point a subprogram
|
||||||
-- subprogram is frozen, enough must be known about it to build the
|
-- is frozen, enough must be known about it to build the activation
|
||||||
-- activation record for it, which requires at least that the size of
|
-- record for it, which requires at least that the size of all
|
||||||
-- all parameters be known. Controlling arguments are by-reference,
|
-- parameters be known. Controlling arguments are by-reference,
|
||||||
-- and therefore the rule only applies to non-tagged types.
|
-- and therefore the rule only applies to non-tagged types. Typical
|
||||||
-- Typical violation of the rule involves an object declaration that
|
-- violation of the rule involves an object declaration that freezes a
|
||||||
-- freezes a tagged type, when one of its primitive operations has a
|
-- tagged type, when one of its primitive operations has a type in its
|
||||||
-- type in its profile whose full view has not been analyzed yet.
|
-- profile whose full view has not been analyzed yet. More complex cases
|
||||||
-- More complex cases involve composite types that have one private
|
-- involve composite types that have one private unfrozen subcomponent.
|
||||||
-- unfrozen subcomponent.
|
|
||||||
|
|
||||||
procedure Export_DT (Typ : Entity_Id; DT : Entity_Id; Index : Nat := 0);
|
procedure Export_DT (Typ : Entity_Id; DT : Entity_Id; Index : Nat := 0);
|
||||||
-- Export the dispatch table DT of tagged type Typ. Required to generate
|
-- Export the dispatch table DT of tagged type Typ. Required to generate
|
||||||
|
@ -8438,10 +8437,10 @@ package body Exp_Disp is
|
||||||
Make_Defining_Identifier (Loc,
|
Make_Defining_Identifier (Loc,
|
||||||
Chars => Make_Init_Proc_Name (Typ));
|
Chars => Make_Init_Proc_Name (Typ));
|
||||||
|
|
||||||
-- Case 1: Constructor of non-tagged type
|
-- Case 1: Constructor of untagged type
|
||||||
|
|
||||||
-- If the C++ class has no virtual methods then the matching Ada
|
-- If the C++ class has no virtual methods then the matching Ada
|
||||||
-- type is a non-tagged record type. In such case there is no need
|
-- type is an untagged record type. In such case there is no need
|
||||||
-- to generate a wrapper of the C++ constructor because the _tag
|
-- to generate a wrapper of the C++ constructor because the _tag
|
||||||
-- component is not available.
|
-- component is not available.
|
||||||
|
|
||||||
|
|
|
@ -9465,7 +9465,7 @@ package body Exp_Dist is
|
||||||
|
|
||||||
elsif Is_Derived_Type (Typ) and then not Is_Tagged_Type (Typ) then
|
elsif Is_Derived_Type (Typ) and then not Is_Tagged_Type (Typ) then
|
||||||
|
|
||||||
-- Non-tagged derived type: convert to root type
|
-- Untagged derived type: convert to root type
|
||||||
|
|
||||||
declare
|
declare
|
||||||
Rt_Type : constant Entity_Id := Root_Type (Typ);
|
Rt_Type : constant Entity_Id := Root_Type (Typ);
|
||||||
|
@ -9480,7 +9480,7 @@ package body Exp_Dist is
|
||||||
|
|
||||||
elsif Is_Record_Type (Typ) and then not Is_Tagged_Type (Typ) then
|
elsif Is_Record_Type (Typ) and then not Is_Tagged_Type (Typ) then
|
||||||
|
|
||||||
-- Non-tagged record type
|
-- Untagged record type
|
||||||
|
|
||||||
if Nkind (Declaration_Node (Typ)) = N_Subtype_Declaration then
|
if Nkind (Declaration_Node (Typ)) = N_Subtype_Declaration then
|
||||||
declare
|
declare
|
||||||
|
|
|
@ -131,9 +131,9 @@ package body Exp_Strm is
|
||||||
-- return V;
|
-- return V;
|
||||||
-- end typSI[_nnn]
|
-- end typSI[_nnn]
|
||||||
|
|
||||||
-- Note: the suffix [_nnn] is present for non-tagged types, where we
|
-- Note: the suffix [_nnn] is present for untagged types, where we generate
|
||||||
-- generate a local subprogram at the point of the occurrence of the
|
-- a local subprogram at the point of the occurrence of the attribute
|
||||||
-- attribute reference, so the name must be unique.
|
-- reference, so the name must be unique.
|
||||||
|
|
||||||
procedure Build_Array_Input_Function
|
procedure Build_Array_Input_Function
|
||||||
(Loc : Source_Ptr;
|
(Loc : Source_Ptr;
|
||||||
|
|
|
@ -461,7 +461,7 @@ package body Exp_Util is
|
||||||
|
|
||||||
Utyp := Underlying_Type (Base_Type (Utyp));
|
Utyp := Underlying_Type (Base_Type (Utyp));
|
||||||
|
|
||||||
-- Deal with non-tagged derivation of private views. If the parent is
|
-- Deal with untagged derivation of private views. If the parent is
|
||||||
-- now known to be protected, the finalization routine is the one
|
-- now known to be protected, the finalization routine is the one
|
||||||
-- defined on the corresponding record of the ancestor (corresponding
|
-- defined on the corresponding record of the ancestor (corresponding
|
||||||
-- records do not automatically inherit operations, but maybe they
|
-- records do not automatically inherit operations, but maybe they
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
-- --
|
-- --
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
with Ada.Unchecked_Conversion;
|
||||||
|
|
||||||
with System.Standard_Library; use System.Standard_Library;
|
with System.Standard_Library; use System.Standard_Library;
|
||||||
with System.Soft_Links; use System.Soft_Links;
|
with System.Soft_Links; use System.Soft_Links;
|
||||||
|
|
||||||
|
@ -67,16 +69,19 @@ package body System.Exception_Traces is
|
||||||
(Traceback : System.Address;
|
(Traceback : System.Address;
|
||||||
Len : Natural) return String
|
Len : Natural) return String
|
||||||
is
|
is
|
||||||
Decorator_Traceback : Traceback_Entries.Tracebacks_Array (1 .. Len);
|
-- Note: do not use an address clause, which is not supported under .NET
|
||||||
for Decorator_Traceback'Address use Traceback;
|
|
||||||
|
|
||||||
-- Handle the "transition" from the array stored in the exception
|
subtype Trace_Array is Traceback_Entries.Tracebacks_Array (1 .. Len);
|
||||||
-- occurrence to the array expected by the decorator.
|
type Trace_Array_Access is access all Trace_Array;
|
||||||
|
|
||||||
pragma Import (Ada, Decorator_Traceback);
|
function To_Trace_Array is new
|
||||||
|
Ada.Unchecked_Conversion (Address, Trace_Array_Access);
|
||||||
|
|
||||||
|
Decorator_Traceback : constant Trace_Array_Access :=
|
||||||
|
To_Trace_Array (Traceback);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
return Current_Decorator.all (Decorator_Traceback);
|
return Current_Decorator.all (Decorator_Traceback.all);
|
||||||
end Decorator_Wrapper;
|
end Decorator_Wrapper;
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
|
@ -169,10 +169,10 @@ package body Sem_Ch13 is
|
||||||
Nam : TSS_Name_Type);
|
Nam : TSS_Name_Type);
|
||||||
-- Create a subprogram renaming of a given stream attribute to the
|
-- Create a subprogram renaming of a given stream attribute to the
|
||||||
-- designated subprogram and then in the tagged case, provide this as a
|
-- designated subprogram and then in the tagged case, provide this as a
|
||||||
-- primitive operation, or in the non-tagged case make an appropriate TSS
|
-- primitive operation, or in the untagged case make an appropriate TSS
|
||||||
-- entry. This is more properly an expansion activity than just semantics,
|
-- entry. This is more properly an expansion activity than just semantics,
|
||||||
-- but the presence of user-defined stream functions for limited types is a
|
-- but the presence of user-defined stream functions for limited types
|
||||||
-- legality check, which is why this takes place here rather than in
|
-- is a legality check, which is why this takes place here rather than in
|
||||||
-- exp_ch13, where it was previously. Nam indicates the name of the TSS
|
-- exp_ch13, where it was previously. Nam indicates the name of the TSS
|
||||||
-- function to be generated.
|
-- function to be generated.
|
||||||
--
|
--
|
||||||
|
@ -11206,7 +11206,7 @@ package body Sem_Ch13 is
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
|
|
||||||
-- Check for case of non-tagged derived type whose parent either has
|
-- Check for case of untagged derived type whose parent either has
|
||||||
-- primitive operations, or is a by reference type (RM 13.1(10)). In
|
-- primitive operations, or is a by reference type (RM 13.1(10)). In
|
||||||
-- this case we do not output a Too_Late message, since there is no
|
-- this case we do not output a Too_Late message, since there is no
|
||||||
-- earlier point where the rep item could be placed to make it legal.
|
-- earlier point where the rep item could be placed to make it legal.
|
||||||
|
|
|
@ -20398,7 +20398,7 @@ package body Sem_Ch3 is
|
||||||
or else Null_Present (Component_List (Def))
|
or else Null_Present (Component_List (Def))
|
||||||
then
|
then
|
||||||
if not Is_Tagged_Type (T) then
|
if not Is_Tagged_Type (T) then
|
||||||
Check_SPARK_Restriction ("non-tagged record cannot be null", Def);
|
Check_SPARK_Restriction ("untagged record cannot be null", Def);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -1890,7 +1890,7 @@ package body Sem_Ch7 is
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
else
|
else
|
||||||
-- Non-tagged type, scan forward to locate inherited hidden
|
-- For untagged type, scan forward to locate inherited hidden
|
||||||
-- operations.
|
-- operations.
|
||||||
|
|
||||||
Prim_Op := Next_Entity (E);
|
Prim_Op := Next_Entity (E);
|
||||||
|
|
Loading…
Reference in New Issue