diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-30 11:20:27 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-30 11:20:27 +0000 |
commit | c6c0009396eae44ade07f7e4855f0dc35316d694 (patch) | |
tree | a172122c09cac7216fa87e2b8da69fa6e59fe00d /gcc/ada/exp_ch4.adb | |
parent | 9233179635359b5065c8c6ea90712f1b10dbb767 (diff) | |
download | gcc-c6c0009396eae44ade07f7e4855f0dc35316d694.tar.gz |
2015-01-30 Yannick Moy <moy@adacore.com>
* sem_attr.adb: Code clean up.
2015-01-30 Robert Dewar <dewar@adacore.com>
* ali.adb (Scan_ALI): Set Serious_Errors flag in Unit record.
* ali.ads (Unit_Record): Add new field Serious_Errors.
* lib-writ.adb (Write_Unit_Information): Set SE (serious errors)
attribute in U line.
* lib-writ.ads: New attribute SE (serious erors) in unit line.
2015-01-30 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb Update the usage of attributes Entry_Bodies_Array,
Lit_Indexes, Scale_Value, Storage_Size_Variable,
String_Literal_Low_Bound along associated routines and
Write_FieldX_Name.
(Pending_Access_Types): New routine.
(Set_Pending_Access_Types): New routine.
(Write_Field15_Name): Add an entry for Pending_Access_Types.
* einfo.ads Add new attribute Pending_Access_Types along
with usage in nodes. Update the usage of attributes
Entry_Bodies_Array, Lit_Indexes, Scale_Value,
Storage_Size_Variable, String_Literal_Low_Bound.
(Pending_Access_Types): New routine along with pragma Inline.
(Set_Pending_Access_Types): New routine along with pragma Inline.
* exp_ch3.adb (Expand_Freeze_Array_Type): Add new local variable
Ins_Node. Determine the insertion node for anonynous access type
that acts as a component type of an array. Update the call to
Build_Finalization_Master.
(Expand_Freeze_Record_Type): Update
the calls to Build_Finalization_Master.
(Freeze_Type): Remove
local variable RACW_Seen. Factor out the code that deals with
remote access-to-class-wide types. Create a finalization master
when the designated type contains a private component. Fully
initialize all pending access types.
(Process_RACW_Types): New routine.
(Process_Pending_Access_Types): New routine.
* exp_ch4.adb (Expand_Allocator_Expression): Allocation no longer
needs to set primitive Finalize_Address.
(Expand_N_Allocator): Allocation no longer sets primitive
Finalize_Address.
* exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
Update the call to Build_Finalization_Master.
(Make_Build_In_Place_Call_In_Allocator): Allocation no longer
needs to set primitive Finalize_Address.
* exp_ch7.adb (Add_Pending_Access_Type): New routine.
(Build_Finalization_Master): New parameter profile. Associate
primitive Finalize_Address with the finalization master if the
designated type has been frozen, otherwise treat the access
type as pending. Simplify the insertion of the master and
related initialization code.
(Make_Finalize_Address_Body): Allow Finalize_Address for class-wide
abstract types.
(Make_Set_Finalize_Address_Call): Remove forlam parameter Typ.
Simplify the implementation.
* exp_ch7.ads (Build_Finalization_Master): New parameter profile
along with comment on usage.
(Make_Set_Finalize_Address_Call): Remove formal parameter Typ. Update
the comment on usage.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Use routine
Finalize_Address to retrieve the primitive.
(Finalize_Address): New routine.
(Find_Finalize_Address): Removed.
* exp_util.ads (Finalize_Address): New routine.
* freeze.adb (Freeze_All): Remove the generation of finalization
masters.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Propagate any
pending access types from the partial to the full view.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220279 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 70 |
1 files changed, 14 insertions, 56 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 0e1b7ff9034..98b24a9a6a1 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1278,30 +1278,6 @@ package body Exp_Ch4 is Prefix => New_Occurrence_Of (Temp, Loc))), Typ => T)); end if; - - -- Generate: - -- Set_Finalize_Address (<PtrT>FM, <T>FD'Unrestricted_Access); - - -- Do not generate this call in the following cases: - - -- * .NET/JVM - these targets do not support address arithmetic - -- and unchecked conversion, key elements of Finalize_Address. - - -- * CodePeer mode - TSS primitive Finalize_Address is not - -- created in this mode. - - if VM_Target = No_VM - and then not CodePeer_Mode - and then Present (Finalization_Master (PtrT)) - and then Present (Temp_Decl) - and then Nkind (Expression (Temp_Decl)) = N_Allocator - then - Insert_Action (N, - Make_Set_Finalize_Address_Call - (Loc => Loc, - Typ => T, - Ptr_Typ => PtrT)); - end if; end if; Rewrite (N, New_Occurrence_Of (Temp, Loc)); @@ -4868,40 +4844,22 @@ package body Exp_Ch4 is (Obj_Ref => New_Copy_Tree (Init_Arg1), Typ => T)); - if Present (Finalization_Master (PtrT)) then - - -- Special processing for .NET/JVM, the allocated object - -- is attached to the finalization master. Generate: - - -- Attach (<PtrT>FM, Root_Controlled_Ptr (Init_Arg1)); + -- Special processing for .NET/JVM, the allocated object is + -- attached to the finalization master. Generate: - -- Types derived from [Limited_]Controlled are the only - -- ones considered since they have fields Prev and Next. - - if VM_Target /= No_VM then - if Is_Controlled (T) then - Insert_Action (N, - Make_Attach_Call - (Obj_Ref => New_Copy_Tree (Init_Arg1), - Ptr_Typ => PtrT)); - end if; + -- Attach (<PtrT>FM, Root_Controlled_Ptr (Init_Arg1)); - -- Default case, generate: + -- Types derived from [Limited_]Controlled are the only ones + -- considered since they have fields Prev and Next. - -- Set_Finalize_Address - -- (<PtrT>FM, <T>FD'Unrestricted_Access); - - -- Do not generate this call in CodePeer mode, as TSS - -- primitive Finalize_Address is not created in this - -- mode. - - elsif not CodePeer_Mode then - Insert_Action (N, - Make_Set_Finalize_Address_Call - (Loc => Loc, - Typ => T, - Ptr_Typ => PtrT)); - end if; + if VM_Target /= No_VM + and then Is_Controlled (T) + and then Present (Finalization_Master (PtrT)) + then + Insert_Action (N, + Make_Attach_Call + (Obj_Ref => New_Copy_Tree (Init_Arg1), + Ptr_Typ => PtrT)); end if; end if; |