gcc/gcc/ada/s-finmas.adb

555 lines
16 KiB
Ada
Raw Normal View History

[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . F I N A L I Z A T I O N _ M A S T E R S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2015, Free Software Foundation, Inc. --
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
-- --
-- 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Exceptions; use Ada.Exceptions;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
with System.Address_Image;
with System.HTable; use System.HTable;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
with System.IO; use System.IO;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
with System.Soft_Links; use System.Soft_Links;
with System.Storage_Elements; use System.Storage_Elements;
package body System.Finalization_Masters is
-- Finalize_Address hash table types. In general, masters are homogeneous
-- collections of controlled objects. Rare cases such as allocations on a
-- subpool require heterogeneous masters. The following table provides a
-- relation between object address and its Finalize_Address routine.
type Header_Num is range 0 .. 127;
function Hash (Key : System.Address) return Header_Num;
-- Address --> Finalize_Address_Ptr
package Finalize_Address_Table is new Simple_HTable
(Header_Num => Header_Num,
Element => Finalize_Address_Ptr,
No_Element => null,
Key => System.Address,
Hash => Hash,
Equal => "=");
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
---------------------------
-- Add_Offset_To_Address --
---------------------------
function Add_Offset_To_Address
(Addr : System.Address;
Offset : System.Storage_Elements.Storage_Offset) return System.Address
is
begin
return System.Storage_Elements."+" (Addr, Offset);
end Add_Offset_To_Address;
------------
-- Attach --
------------
procedure Attach (N : not null FM_Node_Ptr; L : not null FM_Node_Ptr) is
begin
Lock_Task.all;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Attach_Unprotected (N, L);
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
Unlock_Task.all;
-- Note: No need to unlock in case of an exception because the above
-- code can never raise one.
end Attach;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
------------------------
-- Attach_Unprotected --
------------------------
procedure Attach_Unprotected
(N : not null FM_Node_Ptr;
L : not null FM_Node_Ptr)
is
begin
L.Next.Prev := N;
N.Next := L.Next;
L.Next := N;
N.Prev := L;
end Attach_Unprotected;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
---------------
-- Base_Pool --
---------------
function Base_Pool
(Master : Finalization_Master) return Any_Storage_Pool_Ptr
is
begin
return Master.Base_Pool;
end Base_Pool;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-----------------------------------------
-- Delete_Finalize_Address_Unprotected --
-----------------------------------------
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
procedure Delete_Finalize_Address_Unprotected (Obj : System.Address) is
begin
Finalize_Address_Table.Remove (Obj);
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
end Delete_Finalize_Address_Unprotected;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
------------
-- Detach --
------------
procedure Detach (N : not null FM_Node_Ptr) is
begin
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Lock_Task.all;
Detach_Unprotected (N);
Unlock_Task.all;
-- Note: No need to unlock in case of an exception because the above
-- code can never raise one.
end Detach;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
------------------------
-- Detach_Unprotected --
------------------------
procedure Detach_Unprotected (N : not null FM_Node_Ptr) is
begin
if N.Prev /= null and then N.Next /= null then
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
N.Prev.Next := N.Next;
N.Next.Prev := N.Prev;
N.Prev := null;
N.Next := null;
end if;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
end Detach_Unprotected;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
--------------
-- Finalize --
--------------
overriding procedure Finalize (Master : in out Finalization_Master) is
Cleanup : Finalize_Address_Ptr;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
Curr_Ptr : FM_Node_Ptr;
Ex_Occur : Exception_Occurrence;
Obj_Addr : Address;
Raised : Boolean := False;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
function Is_Empty_List (L : not null FM_Node_Ptr) return Boolean;
-- Determine whether a list contains only one element, the dummy head
-------------------
-- Is_Empty_List --
-------------------
function Is_Empty_List (L : not null FM_Node_Ptr) return Boolean is
begin
return L.Next = L and then L.Prev = L;
end Is_Empty_List;
-- Start of processing for Finalize
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
begin
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Lock_Task.all;
-- Synchronization:
-- Read - allocation, finalization
-- Write - finalization
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
if Master.Finalization_Started then
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Unlock_Task.all;
[multiple changes] 2011-11-21 Robert Dewar <dewar@adacore.com> * sinput.ads: Minor comment fix. 2011-11-21 Robert Dewar <dewar@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case First_Bit, Last_Bit, Position): Handle 2005 case. 2011-11-21 Robert Dewar <dewar@adacore.com> * s-atocou-builtin.adb (Decrement): Use Unrestricted_Access to deal with fact that we properly detect the error if Access is used. (Increment): Same fix. * s-taprop-linux.adb (Create_Task): Use Unrestricted_Access to deal with fact that we properly detect the error if Access is used. * sem_util.adb (Is_Volatile_Object): Properly record that A.B is volatile if the B component is volatile. This affects the check for passing such a by reference volatile actual to a non-volatile formal (which should be illegal) 2011-11-21 Robert Dewar <dewar@adacore.com> * freeze.adb (Freeze_Enumeration_Type): Make sure to set both size and alignment for foreign convention enumeration types. * layout.adb (Set_Elem_Alignment): Redo setting of alignment when size is set. 2011-11-21 Yannick Moy <moy@adacore.com> * checks.adb (Apply_Access_Check, Apply_Arithmetic_Overflow_Check, Apply_Discriminant_Check, Apply_Divide_Check, Apply_Selected_Length_Checks, Apply_Selected_Range_Checks, Build_Discriminant_Checks, Insert_Range_Checks, Selected_Length_Checks, Selected_Range_Checks): Replace reference to Expander_Active with reference to Full_Expander_Active, so that expansion of checks is not performed in Alfa mode 2011-11-21 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Create_Task): Use Unrestricted_Access to deal with fact that we properly detect the error if Access is used. 2011-11-21 Hristian Kirtchev <kirtchev@adacore.com> * par-ch4.adb (P_Quantified_Expression): Add an Ada 2012 check. 2011-11-21 Hristian Kirtchev <kirtchev@adacore.com> * exp_imgv.adb: Add with and use clause for Errout. (Expand_Width_Attribute): Emit a warning when in configurable run-time mode to provide a better diagnostic message. 2011-11-21 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Finalize): Add comment concerning double finalization. 2011-11-21 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Access_Definition): If the access definition is itself the return type of an access to function definition which is ultimately the return type of an access to subprogram declaration, its scope is the enclosing scope of the ultimate access to subprogram. 2011-11-21 Steve Baird <baird@adacore.com> * sem_res.adb (Valid_Conversion): If a conversion was legal in the body of a generic, then the corresponding conversion is legal in the expanded body of an instance of the generic. From-SVN: r181568
2011-11-21 12:59:08 +01:00
-- Double finalization may occur during the handling of stand alone
-- libraries or the finalization of a pool with subpools. Due to the
-- potential aliasing of masters in these two cases, do not process
-- the same master twice.
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
return;
end if;
-- Lock the master to prevent any allocations while the objects are
-- being finalized. The master remains locked because either the master
-- is explicitly deallocated or the associated access type is about to
-- go out of scope.
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - allocation, finalization
-- Write - finalization
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
Master.Finalization_Started := True;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
while not Is_Empty_List (Master.Objects'Unchecked_Access) loop
Curr_Ptr := Master.Objects.Next;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Write - allocation, deallocation, finalization
Detach_Unprotected (Curr_Ptr);
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Finalize): Check Finalize_Address of the master rather than the current node. * s-finmas.ads: Move field Finalize_Address from type FM_Node to Finalization_Master. The list headers have two fields instead of three. This should fix alignment issue but subpool allocations are now unusable. Alphabetize subprograms. * s-stposu.adb (Allocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. Set the master's Finalize_Address attribute if not already set. (Deallocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. 2011-08-29 Gary Dismukes <dismukes@adacore.com> * exp_ch11.adb (Expand_N_Raise_Statement): Don't suppress expansion of reraise when compiling for CodePeer. 2011-08-29 Arnaud Charlet <charlet@adacore.com> * a-iteint.ads, Makefile.rtl: Add missing compilation of a-iteint.ads, now needed by a-convec.adb. Fix warning. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Add a guard for the processing of TSS routine Finalize_Address when compiling in CodePeer_Mode. 2011-08-29 Thomas Quinot <quinot@adacore.com> * a-strunb.ads, einfo.ads, g-comlin.ads, sem_ch6.adb, sem_warn.adb: Minor reformatting. 2011-08-29 Emmanuel Briot <briot@adacore.com> * prj-conf.adb (Get_Config_Switches): Also collect the list of languages from aggregated projects. 2011-08-29 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb, lib-xref.ads (Traverse_Declarations_Or_Statements, Traverse_Handled_Statement_Sequence, Traverse_Package_Body, Traverse_Package_Declaration, Traverse_Subprogram_Body, Traverse_Compilation_Unit): Add a parameter Inside_Stubs so that bodies for stubs are traversed too when parameter is set (Traverse_All_Compilation_Units): Traverse without going inside stubs (Traverse_Declarations_Or_Statements): Do the special traversing for stubs when required. * sem_util.adb, sem_util.ads (Get_Body_From_Stub): New function to return subprogram or package body from stub. (Is_Subprogram_Stub_Without_Prior_Declaration): New function to detect stubs without prior subprogram decl. 2011-08-29 Vasiliy Fofanov <fofanov@adacore.com> * gnat_ugn.texi: Fix typo. From-SVN: r178219
2011-08-29 15:01:34 +02:00
-- Skip the list header in order to offer proper object layout for
-- finalization.
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Finalize): Check Finalize_Address of the master rather than the current node. * s-finmas.ads: Move field Finalize_Address from type FM_Node to Finalization_Master. The list headers have two fields instead of three. This should fix alignment issue but subpool allocations are now unusable. Alphabetize subprograms. * s-stposu.adb (Allocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. Set the master's Finalize_Address attribute if not already set. (Deallocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. 2011-08-29 Gary Dismukes <dismukes@adacore.com> * exp_ch11.adb (Expand_N_Raise_Statement): Don't suppress expansion of reraise when compiling for CodePeer. 2011-08-29 Arnaud Charlet <charlet@adacore.com> * a-iteint.ads, Makefile.rtl: Add missing compilation of a-iteint.ads, now needed by a-convec.adb. Fix warning. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Add a guard for the processing of TSS routine Finalize_Address when compiling in CodePeer_Mode. 2011-08-29 Thomas Quinot <quinot@adacore.com> * a-strunb.ads, einfo.ads, g-comlin.ads, sem_ch6.adb, sem_warn.adb: Minor reformatting. 2011-08-29 Emmanuel Briot <briot@adacore.com> * prj-conf.adb (Get_Config_Switches): Also collect the list of languages from aggregated projects. 2011-08-29 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb, lib-xref.ads (Traverse_Declarations_Or_Statements, Traverse_Handled_Statement_Sequence, Traverse_Package_Body, Traverse_Package_Declaration, Traverse_Subprogram_Body, Traverse_Compilation_Unit): Add a parameter Inside_Stubs so that bodies for stubs are traversed too when parameter is set (Traverse_All_Compilation_Units): Traverse without going inside stubs (Traverse_Declarations_Or_Statements): Do the special traversing for stubs when required. * sem_util.adb, sem_util.ads (Get_Body_From_Stub): New function to return subprogram or package body from stub. (Is_Subprogram_Stub_Without_Prior_Declaration): New function to detect stubs without prior subprogram decl. 2011-08-29 Vasiliy Fofanov <fofanov@adacore.com> * gnat_ugn.texi: Fix typo. From-SVN: r178219
2011-08-29 15:01:34 +02:00
Obj_Addr := Curr_Ptr.all'Address + Header_Size;
-- Retrieve TSS primitive Finalize_Address depending on the master's
-- mode of operation.
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - allocation, finalization
-- Write - outside
if Master.Is_Homogeneous then
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - finalization
-- Write - allocation, outside
Cleanup := Master.Finalize_Address;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Finalize): Check Finalize_Address of the master rather than the current node. * s-finmas.ads: Move field Finalize_Address from type FM_Node to Finalization_Master. The list headers have two fields instead of three. This should fix alignment issue but subpool allocations are now unusable. Alphabetize subprograms. * s-stposu.adb (Allocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. Set the master's Finalize_Address attribute if not already set. (Deallocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. 2011-08-29 Gary Dismukes <dismukes@adacore.com> * exp_ch11.adb (Expand_N_Raise_Statement): Don't suppress expansion of reraise when compiling for CodePeer. 2011-08-29 Arnaud Charlet <charlet@adacore.com> * a-iteint.ads, Makefile.rtl: Add missing compilation of a-iteint.ads, now needed by a-convec.adb. Fix warning. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Add a guard for the processing of TSS routine Finalize_Address when compiling in CodePeer_Mode. 2011-08-29 Thomas Quinot <quinot@adacore.com> * a-strunb.ads, einfo.ads, g-comlin.ads, sem_ch6.adb, sem_warn.adb: Minor reformatting. 2011-08-29 Emmanuel Briot <briot@adacore.com> * prj-conf.adb (Get_Config_Switches): Also collect the list of languages from aggregated projects. 2011-08-29 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb, lib-xref.ads (Traverse_Declarations_Or_Statements, Traverse_Handled_Statement_Sequence, Traverse_Package_Body, Traverse_Package_Declaration, Traverse_Subprogram_Body, Traverse_Compilation_Unit): Add a parameter Inside_Stubs so that bodies for stubs are traversed too when parameter is set (Traverse_All_Compilation_Units): Traverse without going inside stubs (Traverse_Declarations_Or_Statements): Do the special traversing for stubs when required. * sem_util.adb, sem_util.ads (Get_Body_From_Stub): New function to return subprogram or package body from stub. (Is_Subprogram_Stub_Without_Prior_Declaration): New function to detect stubs without prior subprogram decl. 2011-08-29 Vasiliy Fofanov <fofanov@adacore.com> * gnat_ugn.texi: Fix typo. From-SVN: r178219
2011-08-29 15:01:34 +02:00
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
else
-- Synchronization:
-- Read - finalization
-- Write - allocation, deallocation
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Finalize): Check Finalize_Address of the master rather than the current node. * s-finmas.ads: Move field Finalize_Address from type FM_Node to Finalization_Master. The list headers have two fields instead of three. This should fix alignment issue but subpool allocations are now unusable. Alphabetize subprograms. * s-stposu.adb (Allocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. Set the master's Finalize_Address attribute if not already set. (Deallocate_Any_Controlled): Use the offset rather than the size of the header when converting the beginning of the object to a FM_Node. 2011-08-29 Gary Dismukes <dismukes@adacore.com> * exp_ch11.adb (Expand_N_Raise_Statement): Don't suppress expansion of reraise when compiling for CodePeer. 2011-08-29 Arnaud Charlet <charlet@adacore.com> * a-iteint.ads, Makefile.rtl: Add missing compilation of a-iteint.ads, now needed by a-convec.adb. Fix warning. 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Add a guard for the processing of TSS routine Finalize_Address when compiling in CodePeer_Mode. 2011-08-29 Thomas Quinot <quinot@adacore.com> * a-strunb.ads, einfo.ads, g-comlin.ads, sem_ch6.adb, sem_warn.adb: Minor reformatting. 2011-08-29 Emmanuel Briot <briot@adacore.com> * prj-conf.adb (Get_Config_Switches): Also collect the list of languages from aggregated projects. 2011-08-29 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb, lib-xref.ads (Traverse_Declarations_Or_Statements, Traverse_Handled_Statement_Sequence, Traverse_Package_Body, Traverse_Package_Declaration, Traverse_Subprogram_Body, Traverse_Compilation_Unit): Add a parameter Inside_Stubs so that bodies for stubs are traversed too when parameter is set (Traverse_All_Compilation_Units): Traverse without going inside stubs (Traverse_Declarations_Or_Statements): Do the special traversing for stubs when required. * sem_util.adb, sem_util.ads (Get_Body_From_Stub): New function to return subprogram or package body from stub. (Is_Subprogram_Stub_Without_Prior_Declaration): New function to detect stubs without prior subprogram decl. 2011-08-29 Vasiliy Fofanov <fofanov@adacore.com> * gnat_ugn.texi: Fix typo. From-SVN: r178219
2011-08-29 15:01:34 +02:00
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Cleanup := Finalize_Address_Unprotected (Obj_Addr);
end if;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
begin
Cleanup (Obj_Addr);
exception
when Fin_Occur : others =>
if not Raised then
Raised := True;
Save_Occurrence (Ex_Occur, Fin_Occur);
end if;
end;
-- When the master is a heterogeneous collection, destroy the object
-- - Finalize_Address pair since it is no longer needed.
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - finalization
-- Write - outside
if not Master.Is_Homogeneous then
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - finalization
-- Write - allocation, deallocation, finalization
Delete_Finalize_Address_Unprotected (Obj_Addr);
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
end if;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
end loop;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Unlock_Task.all;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
-- If the finalization of a particular object failed or Finalize_Address
-- was not set, reraise the exception now.
if Raised then
Reraise_Occurrence (Ex_Occur);
end if;
end Finalize;
----------------------
-- Finalize_Address --
----------------------
function Finalize_Address
(Master : Finalization_Master) return Finalize_Address_Ptr
is
begin
return Master.Finalize_Address;
end Finalize_Address;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
----------------------------------
-- Finalize_Address_Unprotected --
----------------------------------
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
function Finalize_Address_Unprotected
(Obj : System.Address) return Finalize_Address_Ptr
is
begin
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
return Finalize_Address_Table.Get (Obj);
end Finalize_Address_Unprotected;
--------------------------
-- Finalization_Started --
--------------------------
function Finalization_Started
(Master : Finalization_Master) return Boolean
is
begin
return Master.Finalization_Started;
end Finalization_Started;
----------
-- Hash --
----------
function Hash (Key : System.Address) return Header_Num is
begin
return
Header_Num
(To_Integer (Key) mod Integer_Address (Header_Num'Range_Length));
end Hash;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
-----------------
-- Header_Size --
-----------------
function Header_Size return System.Storage_Elements.Storage_Count is
begin
return FM_Node'Size / Storage_Unit;
end Header_Size;
----------------
-- Initialize --
----------------
overriding procedure Initialize (Master : in out Finalization_Master) is
begin
-- The dummy head must point to itself in both directions
Master.Objects.Next := Master.Objects'Unchecked_Access;
Master.Objects.Prev := Master.Objects'Unchecked_Access;
end Initialize;
--------------------
-- Is_Homogeneous --
--------------------
function Is_Homogeneous (Master : Finalization_Master) return Boolean is
begin
return Master.Is_Homogeneous;
end Is_Homogeneous;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
-------------
-- Objects --
-------------
function Objects (Master : Finalization_Master) return FM_Node_Ptr is
begin
return Master.Objects'Unrestricted_Access;
end Objects;
------------------
-- Print_Master --
------------------
procedure Print_Master (Master : Finalization_Master) is
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
Head : constant FM_Node_Ptr := Master.Objects'Unrestricted_Access;
Head_Seen : Boolean := False;
N_Ptr : FM_Node_Ptr;
begin
-- Output the basic contents of a master
-- Master : 0x123456789
-- Is_Hmgen : TURE <or> FALSE
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
-- Base_Pool: null <or> 0x123456789
-- Fin_Addr : null <or> 0x123456789
-- Fin_Start: TRUE <or> FALSE
Put ("Master : ");
Put_Line (Address_Image (Master'Address));
Put ("Is_Hmgen : ");
Put_Line (Master.Is_Homogeneous'Img);
Put ("Base_Pool: ");
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
if Master.Base_Pool = null then
Put_Line ("null");
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
else
Put_Line (Address_Image (Master.Base_Pool'Address));
end if;
Put ("Fin_Addr : ");
if Master.Finalize_Address = null then
Put_Line ("null");
else
Put_Line (Address_Image (Master.Finalize_Address'Address));
end if;
Put ("Fin_Start: ");
Put_Line (Master.Finalization_Started'Img);
-- Output all chained elements. The format is the following:
-- ^ <or> ? <or> null
-- |Header: 0x123456789 (dummy head)
-- | Prev: 0x123456789
-- | Next: 0x123456789
-- V
-- ^ - the current element points back to the correct element
-- ? - the current element points back to an erroneous element
-- n - the current element points back to null
-- Header - the address of the list header
-- Prev - the address of the list header which the current element
-- points back to
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
-- Next - the address of the list header which the current element
-- points to
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
-- (dummy head) - present if dummy head
N_Ptr := Head;
while N_Ptr /= null loop -- Should never be null
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
Put_Line ("V");
-- We see the head initially; we want to exit when we see the head a
-- second time.
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
if N_Ptr = Head then
exit when Head_Seen;
Head_Seen := True;
end if;
-- The current element is null. This should never happen since the
-- list is circular.
if N_Ptr.Prev = null then
Put_Line ("null (ERROR)");
-- The current element points back to the correct element
elsif N_Ptr.Prev.Next = N_Ptr then
Put_Line ("^");
-- The current element points to an erroneous element
else
Put_Line ("? (ERROR)");
end if;
-- Output the header and fields
Put ("|Header: ");
Put (Address_Image (N_Ptr.all'Address));
-- Detect the dummy head
if N_Ptr = Head then
Put_Line (" (dummy head)");
else
Put_Line ("");
end if;
Put ("| Prev: ");
if N_Ptr.Prev = null then
Put_Line ("null");
else
Put_Line (Address_Image (N_Ptr.Prev.all'Address));
end if;
Put ("| Next: ");
if N_Ptr.Next = null then
Put_Line ("null");
else
Put_Line (Address_Image (N_Ptr.Next.all'Address));
end if;
N_Ptr := N_Ptr.Next;
end loop;
end Print_Master;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
-------------------
-- Set_Base_Pool --
-------------------
procedure Set_Base_Pool
(Master : in out Finalization_Master;
Pool_Ptr : Any_Storage_Pool_Ptr)
is
begin
Master.Base_Pool := Pool_Ptr;
end Set_Base_Pool;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): Add code to set attribute Finalize_Address of the access type's finalization master. (Expand_N_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. Add a guard to prevent Associated_Storage_Pool from being set on .NET/JVM. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add code to set attribute Finalize_Address of the access type's finalization master. * exp_ch7.adb (Make_Finalize_Address_Call): New routine. * exp_ch7.ads (Make_Finalize_Address_Call): New routine. * rtsfind.ads: Add RE_Set_Finalize_Address to tables RE_Id and RE_Unit_Table. * s-finmas.adb: Add with clause for System.Address_Image. Add with and use clause for System.IO (Detach): Relax the assertion, to be reinstated later. (Finalize): Rewrite the iteration loop to avoid pointer comparison. Relax the assertion on Finalize_Address, to be reinstated later. (Is_Empty_List): New routine. (pm): New debug routine. (Set_Finalize_Address): New routine. * s-finmas.ads (pm): New debug routine. (Set_Finalize_Address): New routine. * s-stposu.adb (Allocate_Any_Controlled): Code reformatting. 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr-gcc.adb (GCC_Exception_Access, GNAT_GCC_Exception_Access): Remove convention C. 2011-08-29 Tristan Gingold <gingold@adacore.com> * s-taprop-vms.adb (Get_Exc_Stack_Addr): Remove. (Initialize_TCB): Remove Exc_Stack_Ptr initialization. (Finalize_TCB): Remove its finalization. (Initialize): Remove assignment of GET_Exc_Stack_Addr * s-soflin.adb (NT_Exc_Stack): Remove (Get_Exc_Stack_Addr_NT): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise. * s-soflin.ads (Get_Exc_Stack_Addr_NT): Remove. (Get_Exc_Stack_Addr): Likewise. (Get_Exc_Stack_Addr_Soft): Likewise * s-taspri-vms.ads (Exc_Stack_T): Remove. (Exc_Stack_Ptr_T): Likewise. (Private_Data): Remove Exc_Stack_Ptr component. 2011-08-29 Tristan Gingold <gingold@adacore.com> * raise-gcc.c (get_ip_from_context): New function. Factorize code. 2011-08-29 Tristan Gingold <gingold@adacore.com> * gnat_ugn.texi: Fix aix and x86-solaris info for run-time. 2011-08-29 Geert Bosch <bosch@adacore.com> * s-gearop.ads (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): New generic subprograms * s-gearop.adb (Back_Substitute, Diagonal, Forward_Eliminate, L2_Norm, Swap_Column): Implement new subprograms in order to eliminate dependency on BLAS and LAPACK libraries in Ada.Numerics.Generic_Real_Arrays and eventually also the complex version. Forward_Eliminate/Back_Substitute can be used to put a matrix in row echelon or reduced row echelon form using partial pivoting. * a-ngrear.adb: (Back_Substitute, Diagonal, Forward_Eleminate, Swap_Column): Instantiate from System.Generic_Array_Operations. ("*", "abs"): Implement by instantiation from Generic_Array_Operations. (Sqrt): Local function for simple computation of square root without adding dependencies on Generic_Elementary_Functions. (Swap): New subprogram to exchange floating point numbers. (Inverse): Reimplement using Jordan-Gauss elimination. (Jacobi): New procedure implementing Jacobi's method for computation of eigensystems, based on Rutishauser's implementation. (L2_Norm): Implement directly using the inner product. (Sort_Eigensystem): Sort eigenvalue/eigenvector pairs in order of decreasing eigenvalue as required by the Ada RM. (Swap_Column): New helper procedure for Sort_Eigensystem. Remove with of System.Generic_Real_BLAS and System.Generic_Real_LAPACK. Add with of Ada.Containers.Generic_Anonymous_Array_Sort, for Sort_Eigensystems. 2011-08-29 Thomas Quinot <quinot@adacore.com> * put_scos.adb (Put_SCOs): Do not emit a newline for an empty statements line. From-SVN: r178220
2011-08-29 15:07:49 +02:00
--------------------------
-- Set_Finalize_Address --
--------------------------
procedure Set_Finalize_Address
(Master : in out Finalization_Master;
Fin_Addr_Ptr : Finalize_Address_Ptr)
is
begin
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - finalization
-- Write - allocation, outside
Lock_Task.all;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Set_Finalize_Address_Unprotected (Master, Fin_Addr_Ptr);
Unlock_Task.all;
end Set_Finalize_Address;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
--------------------------------------
-- Set_Finalize_Address_Unprotected --
--------------------------------------
procedure Set_Finalize_Address_Unprotected
(Master : in out Finalization_Master;
Fin_Addr_Ptr : Finalize_Address_Ptr)
is
begin
if Master.Finalize_Address = null then
Master.Finalize_Address := Fin_Addr_Ptr;
end if;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
end Set_Finalize_Address_Unprotected;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
----------------------------------------------------
-- Set_Heterogeneous_Finalize_Address_Unprotected --
----------------------------------------------------
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
procedure Set_Heterogeneous_Finalize_Address_Unprotected
(Obj : System.Address;
Fin_Addr_Ptr : Finalize_Address_Ptr)
is
begin
Finalize_Address_Table.Set (Obj, Fin_Addr_Ptr);
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
end Set_Heterogeneous_Finalize_Address_Unprotected;
--------------------------
-- Set_Is_Heterogeneous --
--------------------------
procedure Set_Is_Heterogeneous (Master : in out Finalization_Master) is
begin
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
-- Synchronization:
-- Read - finalization
-- Write - outside
Lock_Task.all;
Master.Is_Homogeneous := False;
2011-10-24 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: For gnatelim, move the note about using the GNAT driver for getting the project support into gnatelim section. 2011-10-24 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Minor correction to documentation on address clause. 2011-10-24 Hristian Kirtchev <kirtchev@adacore.com> * s-finmas.adb (Attach): Synchronize and call the unprotected version. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Removed. (Delete_Finalize_Address_Unprotected): New routine. (Detach): Synchronize and call the unprotected version. (Detach_Unprotected): Remove locking. (Finalize): Add various comment on synchronization. Lock the critical region and call the unprotected versions of routines. (Finalize_Address): Removed. (Finalize_Address_Unprotected): New routine. (Set_Finalize_Address): Synchronize and call the unprotected version. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Removed. (Set_Heterogeneous_Finalize_Address_Unprotected): New routine. (Set_Is_Heterogeneous): Add comment on synchronization and locking. * s-finmas.ads: Flag Finalization_Started is no longer atomic because synchronization uses task locking / unlocking. (Attach): Add comment on usage. (Attach_Unprotected): New routine. (Delete_Finalize_Address): Renamed to Delete_Finalize_Address_Unprotected. (Detach): Add comment on usage. (Detach_Unprotected): New routine. (Finalize_Address): Renamed to Finalize_Address_Unprotected. (Set_Finalize_Address): Add comment on usage. (Set_Finalize_Address_Unprotected): New routine. (Set_Heterogeneous_Finalize_Address): Renamed to Set_Heterogeneous_Finalize_Address_Unprotected. * s-stposu.adb (Allocate_Any_Controlled): Add local variable Allocation_Locked. Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. (Deallocate_Any_Controlled): Add various comments on synchronization. Lock the critical region and call the unprotected version of routines. 2011-10-24 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Set_Fixed_Range): The bounds of a fixed point type are universal and must carry the corresponding type. * sem_eval.adb (Check_Non_Static_Context): If the type of the expression is universal real, as may be the case for a fixed point expression with constant operands in the context of a conversion, there is nothing to check. * s-finmas.adb: Minor reformatting From-SVN: r180368
2011-10-24 11:19:15 +02:00
Unlock_Task.all;
end Set_Is_Heterogeneous;
[multiple changes] 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> * a-fihema.ads, a-fihema.adb: Unit removed. * a-undesu.ads, a-undesu.adb: New unit implementing Ada.Unchecked_Deallocate_Subpool. * einfo.adb: Remove Associated_Collection from the node usage. Add Finalization_Master to the node usage. (Associated_Collection): Removed. (Finalization_Master): New routine. (Set_Associated_Collection): Removed. (Set_Finalization_Master): New routine. (Write_Field23_Name): Remove Associated_Collection from the output. Add Finalization_Master to the output. * einfo.ads: Remove attribute Associated_Collection and its uses in entities. Add new attribute Finalization_Master along with its uses in entitites. (Associated_Collection): Removed along with its pragma import. (Finalization_Master): New routine along with a pragma import. (Set_Associated_Collection): Removed along with its pragma import. (Set_Finalization_Master): New routine along with a pragma import. * exp_ch3.adb (Expand_Freeze_Array_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Freeze_Record_Type): Move the generation of Finalize_Address before the bodies of the predefined routines. Add comment explaining this. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Freeze_Type): Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Make_Finalize_Address_Body): Comment reformatting. (Make_Predefined_Primitive_Specs): Code reformatting. (Stream_Operation_OK): Update comment mentioning finalization collections. Replace RE_Finalization_Collection with RE_Finalization_Master. * exp_ch4.adb (Complete_Controlled_Allocation): Replace call to Associated_Collection with Finalization_Master. Replace call to Build_Finalization_Collection with Build_Finalization_Master. (Expand_Allocator_Expression): Replace call to Associated_Collection with Finalization_Master. Replace call to Set_Associated_Collection with Set_Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. (Expand_N_Allocator): Replace call to Associated_Collection with Finalization_Master. Remove the generation of Set_Finalize_Address_Ptr. * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Renamed to Add_Finalization_Master_Actual_To_Build_In_Place_Call. Update the comment on usage. Replace call to Needs_BIP_Collection with Needs_BIP_Finalization_Master Remplace BIP_Collection with BIP_Finalization_Master. Update all comments which mention finalization collections. Replace Associated_Collection with Finalization_Master. Replace Build_Finalization_Collection with Build_Finalization_Master. (BIP_Formal_Suffix): Update BIP_Collection's case. (Build_Heap_Allocator): Update the related comment. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Update comments which mention finalization collections. Replace Set_Associated_Collection with Set_Finalization_Master. (Expand_Call): Update the code which detects a special piece of library code for .NET/JVM. (Make_Build_In_Place_Call_In_Allocator): Replace the call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. Remove the code which generates a call to Make_Set_Finalize_Address_Ptr_Call. (Make_Build_In_Place_Call_In_Anonymous_Context): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Make_Build_In_Place_Call_In_Assignment): Replace call to Add_Collection_Actual_To_Build_In_Place_Call with Add_Finalization_Master_Actual_To_Build_In_Place_Call. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch6.ads: Rename BIP_Collection to BIP_Finalization_Master. (Needs_BIP_Collection): Renamed to Needs_BIP_Finalization_Master. * exp_ch7.adb (Build_BIP_Cleanup_Stmts): Update comment on usage. Rename local variable Collect to Fin_Mas_Id and update its occurrences. Replace call to Set_Associated_Collection with Set_Finalization_Master. (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Replace the call to Associated_Collection with Finalization_Master. Rename local variable Coll_Id to Fin_Mas_Id and update its occurrences. Update the way finalization master names are generated. Update the retrieval of the correct access type which will carry the pool and master attributes. (Make_Final_Call): Reimplement the way [Deep_]Finalize is retrieved. (Make_Finalize_Address_Body): Abstract types do not need Finalize_Address. Code reformatting. (Make_Finalize_Address_Stmts): Update comment on usage. (Make_Set_Finalize_Address_Ptr_Call): Removed. (Process_Declarations): Update comments. * exp_ch7.ads (Build_Finalization_Collection): Renamed to Build_Finalization_Master. Update associated comment. (Make_Set_Finalize_Address_Ptr_Call): Removed. * exp_ch13.adb: Update comments which mention finalization collections. (Expand_N_Free_Statement): Replace the call to Associated_Collection with Finalization_Master. * exp_util.adb (Build_Allocate_Deallocate_Proc): Reimplemented to create calls to routines Allocate_Any_Controlled and Deallocate_Any_Controlled. (Find_Finalize_Address): New routine. (Is_Allocate_Deallocate_Proc): Update the RTE entities used in the comparison. (Requires_Cleanup_Actions): Update the comment on freeze node inspection. * exp_util.ads: Remove comment on generated code for Build_Allocate_Deallocate_Proc. The code is now quite complex and it is better to simply look in the body. * freeze.adb (Freeze_All): Update the comment of finalization collections. Replace the call to Associated_Collection with Finalization_Master. Replace the call to Build_Finalization_Collection with Build_Finalization_Master. * impunit.adb: Add a-undesu and s-stposu to the list of units. * Makefile.rtl: Add files a-undesu, s-finmas and s-stposu. Remove file a-fihema. * rtsfind.adb (Get_Unit_Name): Remove the processing for children of Ada.Finalization. Add processing for children of System.Storage_Pools. * rtsfind.ads: Remove the naming of second level children of Ada.Finalization. Remove Ada_Finalization_Heap_Management from the list of units. Remove subtype Ada_Finalization_Child. Remove the following subprogram entities: RE_Allocate RE_Deallocate RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Set_Finalize_Address_Ptr Add the naming of second level children of System.Storage_Pools. Add System_Finalization_Masters and System_Storage_Pools_Subpools to the list of units. Add subtype System_Storage_Pools_Child. Add the following subprogram entities to System.Finalization_Masters: RE_Finalization_Master RE_Finalization_Master_Ptr Add the following subprogram entities to System.Storage_Pools.Subpools: RE_Allocate_Any_Controlled RE_Deallocate_Any_Controlled RE_Root_Storage_Pool_With_Subpools RE_Root_Subpool RE_Subpool_Handle Move the following subprogram entities from Ada.Finalization.Heap_Management to System.Finalization_Masters: RE_Add_Offset_To_Address RE_Attach RE_Base_Pool RE_Detach * sem_ch3.adb (Access_Type_Declaration): Replace the call to Set_Associated_Collection with Set_Finalization_Master. * sem_ch6.adb (Create_Extra_Formals): Update the way extra formal BIP_Finalization_Master is created. * s-finmas.adb: New unit System.Finalization_Masters. * s-finmas.ads: New unit System.Finalization_Masters. * s-stopoo.ads, s-stopoo.adb: Minor code reformatting. * s-stposu.ads, s-stposu.adb: New unit implementing System.Storage_Pools.Subpools. 2011-08-29 Bob Duff <duff@adacore.com> * tbuild.adb: Add assertion. From-SVN: r178183
2011-08-29 11:52:57 +02:00
end System.Finalization_Masters;