summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aux.ads
Commit message (Collapse)AuthorAgeFilesLines
* 2012-08-06 Arnaud Charlet <charlet@adacore.com>charlet2012-08-061-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * prj-attr.adb (Register_New_Package): Add missing blank. 2012-08-06 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Is_Two_Dim_Packed_Array): New predicate, used when computing maximum size allowable to construct static aggregate. 2012-08-06 Vincent Pucci <pucci@adacore.com> * freeze.adb (Freeze_Entity): Inherit_Aspects_At_Freeze_Point calls added for derived types and subtypes. * sem_aux.adb, sem_aux.ads (Get_Rep_Item, Get_Rep_Pragma, Has_Rep_Pragma): New routines. * sem_ch13.ads (Inherit_Aspects_At_Freeze_Point): New routine. * sem_ch13.adb (Analyze_Aspect_Specifications): Error message for aspect Lock_Free fixed. (Inherits_Aspects_At_Freeze_Point): New routine. * sem_ch3.adb: Several flag settings removed since inheritance of aspects must be performed at freeze point. 2012-08-06 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Fix s-oscons.ads formatting on VxWorks. 2012-08-06 Vincent Pucci <pucci@adacore.com> * sem_dim.adb (Analyze_Dimension_Binary_Op): Issue an error message for unknown exponent at compile-time. 2012-08-06 Gary Dismukes <dismukes@adacore.com> * sem_eval.ads (Compile_Time_Known_Value_Or_Aggr): Enhance comment to make it clear that the aggregate's evaluation might still involve run-time checks even though the aggregate is considered known at compile time. * sinfo.ads (Compile_Time_Known_Aggregate): Correct comment to refer to Exp_Aggr instead of Sem_Aggr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190172 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-06-14 Robert Dewar <dewar@adacore.com>charlet2012-06-141-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_ch7.adb, exp_util.adb, sem_aux.ads, exp_ch9.adb, sem_ch10.adb, freeze.adb, sem_util.adb, exp_ch4.adb, s-taprop-dummy.adb: Minor reformatting. 2012-06-14 Vincent Pucci <pucci@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Lock_Free attribute case added. * par-prag.adb (Prag): Lock_Free pragma case added. * sem_attr.adb (Analyze_Attribute_Reference): Lock_Free attribute case added. * sem_ch13.adb (Analyze_Aspect_Specifications): Record_Rep_Item call added for Aspect_Lock_Free. * sem_ch9.adb (Allows_Lock_Free_Implementation): New Lock_Free error messages for subprogram bodies. (Lock_Free_Disabled): New routine. (Analyze_Protected_Body): Call to Lock_Free_Disabled added. * sem_prag.adb (Analyze_Pragma): Lock_Free pragma case added. * snames.adb-tmpl (Get_Pragma_Id): Name_Lock_Free case added. (Is_Pragma_Name): Name_Lock_Free case added. * snames.ads-tmpl: Attribute_Lock_Free and Pragma_Lock_Free added. 2012-06-14 Ed Schonberg <schonberg@adacore.com> * a-coorma.adb, a-cborma.adb, a-cbhama.adb, a-ciorma.adb: Add missing aliased keyword. 2012-06-14 Bob Duff <duff@adacore.com> * lib.ads, lib.adb, sem.adb (Write_Unit_Info): Move this procedure from Sem body to Lib spec, so it can be used for debugging elsewhere. 2012-06-14 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Check_Conformance): Add Ada 2012 check on mode conformance: "aliased" must apply to both or neither formal parameters. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188609 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-06-14 Vincent Pucci <pucci@adacore.com>charlet2012-06-141-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * einfo.adb einfo.ads (Get_Rep_Item): Removed. (Get_Rep_Item_For_Entity): Removed. (Get_Rep_Pragma): Removed. (Get_Rep_Pragma_For_Entity): Removed. (Has_Rep_Item): Removed. (Has_Rep_Pragma): Removed. (Has_Rep_Pragma_For_Entity): Removed. * exp_ch9.adb (Expand_N_Task_Type_Declaration): Has_Rep_Pragma_For_Entity replaced by Has_Rep_Pragma and Get_Rep_Pragma_For_Entity replaced by Get_Rep_Pragma. (Make_Task_Create_Call): Has_Rep_Pragma_For_Entity replaced by Has_Rep_Pragma and Get_Rep_Pragma_For_Entity replaced by Get_Rep_Pragma. * exp_intr.adb: Dependency to Sem_Aux added for call to Get_Rep_Pragma. * sem_aux.adb (Get_Rep_Item): New routine. (Get_Rep_Pragma): New routine. (Has_Rep_Item): New routine. (Has_Rep_Pragma): New routine. (Nearest_Ancestor): Minor reformatting. * sem_aux.ads (Get_Rep_Item): New routine. (Get_Rep_Pragma): New routine. (Has_Rep_Item): New routine. (Has_Rep_Pragma): New routine. * sem_ch13.adb (Duplicate_Clause): Restore original error messages. * sem_eval.adb (Subtypes_Statically_Match): Get_Rep_Item_For_Entity replaced by Get_Rep_Item. * sem_prag.adb (Analyze_Pragma): Restore original error messages. (Check_Duplicate_Pragma): Restore original error messages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188607 138bc75d-0d04-0410-961f-82ee72b054a4
* 2012-05-15 Hristian Kirtchev <kirtchev@adacore.com>charlet2012-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * a-calend.adb (Day_Of_Week): The routine once again treats all dates as historic. (Formatting_Operations.Split): All calls to UTC_Time_Offset are now controlled through formal parameter Is_Historic. (Formatting_Operations.Time_Of): All calls to UTC_Time_Offset are now handled through formal parameter Is_Historic. (Split): Update the call to Formatting_Operations.Split. (Time_Of): Update the call to Formatting_Operations.Time_Of. (To_Ada_Time): Update the call to Formatting_Operations.Time_Of. (To_Strict_Tm): Update the call to Formatting_Operations.Split. * a-calend.ads (Split): Add new formal Is_Historic along with comment on usage. This routine is now exported for the purposes of GNAT.Calendar.Locale. (Time_Of): Remove defaults. Add new formal Is_Historic along with comment on usage. This routine is now exported for the purposes of GNAT.Calendar.Locale. * a-calend-vms.adb (Split): Update the call to Formatting_Operations.Split. (Time_Of): Update the call to Formatting_Operations.Time_Of. * a-calend-vms.ads (Split): Add new formal Is_Historic along with comment on usage. (Time_Of): Remove defaults. Add new formal Is_Historic along with comment on usage. * a-calfor.adb (Split): Update the call to Formatting_Operations.Split. (Time_Of): Update the call to Formatting_Operations.Time_Of. * impunit.adb: Include g-calloc to the list of non-RM defined units. 2012-05-15 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Add_Source): Always add the source if it is excluded, to avoid incorrect duplicate checks. 2012-05-15 Yannick Moy <moy@adacore.com> * sem_aux.ads: Correct typo. * sem_eval.adb (Compile_Time_Known_Value): Return False in Alfa mode for a deferred constant when outside of the scope of its full view. 2012-05-15 Emmanuel Briot <briot@adacore.com> * g-comlin.adb, g-comlin.ads (Define_Switch): Allow specifying the name of the argument, for the automatic help message. (Getopt): do not systematically initialize switches with string values to the empty string, when the user has already specified a default. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187504 138bc75d-0d04-0410-961f-82ee72b054a4
* * a-assert.ads: Remove execute permission.mrs2012-04-101-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * a-chacon.ads: Likewise. * a-coteio.ads: Likewise. * a-envvar.ads: Likewise. * a-exetim-mingw.ads: Likewise. * a-fzteio.ads: Likewise. * a-izteio.ads: Likewise. * a-lcteio.ads: Likewise. * a-llctio.ads: Likewise. * a-scteio.ads: Likewise. * a-suenco.ads: Likewise. * a-suenst.ads: Likewise. * a-suewst.ads: Likewise. * a-suezst.ads: Likewise. * a-tirsfi.ads: Likewise. * a-wichha.ads: Likewise. * a-zchara.ads: Likewise. * a-zchhan.ads: Likewise. * a-zchuni.ads: Likewise. * a-zrstfi.ads: Likewise. * aspects.ads: Likewise. * g-byorma.ads: Likewise. * g-decstr.ads: Likewise. * g-encstr.ads: Likewise. * g-spchge.ads: Likewise. * g-u3spch.ads: Likewise. * g-wispch.ads: Likewise. * g-zspche.ads: Likewise. * namet-sp.ads: Likewise. * s-os_lib.ads: Likewise. * s-regexp.ads: Likewise. * s-regpat.ads: Likewise. * s-string.ads: Likewise. * s-tasloc.ads: Likewise. * s-utf_32.ads: Likewise. * sem_aux.ads: Likewise. * a-assert.adb: Likewise. * a-chacon.adb: Likewise. * a-envvar.adb: Likewise. * a-exetim-mingw.adb: Likewise. * a-suenco.adb: Likewise. * a-suenst.adb: Likewise. * a-suewst.adb: Likewise. * a-suezst.adb: Likewise. * a-tirsfi.adb: Likewise. * a-wichha.adb: Likewise. * a-zchhan.adb: Likewise. * a-zchuni.adb: Likewise. * a-zrstfi.adb: Likewise. * aspects.adb: Likewise. * g-byorma.adb: Likewise. * g-decstr.adb: Likewise. * g-encstr.adb: Likewise. * g-spchge.adb: Likewise. * g-u3spch.adb: Likewise. * g-wispch.adb: Likewise. * g-zspche.adb: Likewise. * namet-sp.adb: Likewise. * s-except.adb: Likewise. * s-inmaop-vxworks.adb: Likewise. * s-os_lib.adb: Likewise. * s-regexp.adb: Likewise. * s-regpat.adb: Likewise. * s-string.adb: Likewise. * s-tasloc.adb: Likewise. * s-utf_32.adb: Likewise. * s-wchcon.adb: Likewise. * sem_aux.adb: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186261 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-12-02 Bob Duff <duff@adacore.com>charlet2011-12-021-0/+18
| | | | | | | | | | | | | | | | | | | | * gnat_ugn.texi: Clarify usage of -p binder switch. 2011-12-02 Javier Miranda <miranda@adacore.com> * sem_util.ads, sem_util.adb, sem_aux.ads, sem_aux.adb (Effectively_Has_Constrained_Partial_View): Moved to sem_aux (In_Generic_Body): Moved to sem_aux. (Unit_Declaration_Node): Moved to sem_aux. * einfo.ads (Effectively_Has_Constrained_Partial_View): Complete documentation. * exp_attr.adb, live.adb, sem_ch10.adb, checks.adb, sem.adb, rtsfind.adb, sem_attr.adb, sem_elab.adb, exp_ch4.adb, sem_ch4.adb, exp_ch13.adb: Add with-clause on Sem_Aux. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181917 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-08-03 Hristian Kirtchev <kirtchev@adacore.com>charlet2011-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * a-except.adb, a-except-2005.adb (Raise_From_Controlled_Operation): Rewritten to create the message strings when the exception is not raised by an abort during finalization. * a-except.ads, a-except-2005.ads: Add pragma Export for procedure Raise_From_Controlled_Operation and update its associated comment. * a-fihema.ads, a-fihema.adb: New GNAT unit. Ada.Finalization.Heap_Management provides key functionality associated with controlled objects on the heap, their creation, finalization and reclamation. Type Finalization_Collection is effectively a wrapper which sits ontop of a storage pool and performs all necessary bookkeeping for all the objects it contains. Each access-to-controlled or access-to-class-wide type receives a collection as part of its expansion. The compiler generates buffer code and invokes Allocate / Deallocate to create and destroy allocated controlled objects. * a-finali.adb ("="): Removed. * a-finali.ads ("="): Removed. Controlled types no longer carry hidden fields Prev and Next. * ali.adb (Scan_ALI): Add parsing code to process PF / Has_Finalizer. A library unit with at least one controlled object on the library level has a special finalizer which is invoked by the binder. To signal this, ali files carry field PF. * ali.ads: New field in type Unit_Record called Has_Finalizer. Add associated comment on field usage. * a-tags.adb (Get_RC_Offset): Removed. (Needs_Finalization): New routine. * a-tags.ads: Update the structure of the GNAT dispatch tables. Dispatch tables now carry field Needs_Finalization which provides runtime indication whether a type is controlled or has controlled components or both. Remove field RC_Offset. (Get_RC_Offset): Removed along with its associated pragma Export. Since tagged types with controlled components no longer carry hidden field _controller, the special mechanism to retrieve its location is no longer needed. (Needs_Finalization): New routine. * atree.ads, atree.adb (Elist24): New routine. (Set_Elist24): New routine. * atree.h: Add a define clause for Elist24. * bindgen.adb New library-level variable Lib_Final_Built. (Gen_Adafinal_Ada): Reimplemented. Depending on the restrictions or the presence of a VM target, the routine generates calls to the proper library finalization routine. (Gen_Adainit_Ada): Import Finalize_Library_Objects only on non-VM targets. Set the correct library finalization routine depending on whether the library has controlled objects or this is a VM compilation. (Gen_Finalize_Library_Ada): New routine. This procedure generates calls to library-level finalizers of compiled units in reverse order of elaboration. It also produces exception management code and reraises a potential exception after all units have been finalized. (Gen_Finalize_Library_C): New routine. This procedure generates calls to library-level finalizers of compiled units in reverse order of elaboration. (Gen_Finalize_Library_Defs_C): New routine. This procedure generates the definitions of all library-level finalizers available to the compilation (Gen_Main_Ada): Directly call Adafinal which now contails all target dependent code. (Gen_Main_C): Add new local constant Needs_Library_Finalization. Call System.Standard_Library.Adafinal directly. If the library needs finalization actions, create the sequence of finalization calls. (Gen_Output_File_Ada): Alphabetize local variables and constants. Generate a with clause for System.Soft_Links when compiling for a VM. Remove the code which imports System.Standard_Library.Adafinal as Do_Finalize. Generate the library finalization routine. (Gen_Output_File_C): Add new local constant Needs_Library_Finalization. If the library needs finalization actions, create all the definitions of library- level finalizers. (Has_Finalizer): New routine. Determines whether at least one compiled unit has a library-level finalizer. Add type Qualification_Mode. (Set_Unit_Name): Add a formal which controls the replacement of a dot. * einfo.adb: New usage of field 15 as Return_Flag. Remove Finalization_Chain_Entity from the usages of field 19. Remove Associated_Final_Chain from the usages of field 23. New usage of field 23 as Associated_Collection. New usage of field 24 as Finalizer. New usage of flag 252 as Is_Processed_Transient. (Associated_Final_Chain): Removed. (Associated_Collection): New routine. (Finalization_Chain_Entity): Removed. (Finalizer): New routine. (Is_Finalizer): New routine. (Is_Processed_Transient): New routine. (Return_Flag): New routine. (Set_Associated_Final_Chain): Removed. (Set_Associated_Collection): New routine. (Set_Finalization_Chain_Entity): Removed. (Set_Finalizer): New routine. (Set_Is_Processed_Transient): New routine. (Set_Return_Flag): New routine. (Write_Entity_Flags): Include Is_Processed_Transient to the list of displayed flags. (Write_Field8_Name): Alphabetize the output. (Write_Field11_Name): Alphabetize the output. (Write_Field12_Name): Alphabetize the output. (Write_Field13_Name): Alphabetize the output. (Write_Field14_Name): Alphabetize the output. (Write_Field15_Name): Alphabetize the output. (Write_Field16_Name): Alphabetize the output. (Write_Field17_Name): Alphabetize the output. (Write_Field18_Name): Alphabetize the output. (Write_Field19_Name): Alphabetize the output. Remove the output of Finalization_Chain_Entity. (Write_Field20_Name): Alphabetize the output. (Write_Field21_Name): Alphabetize the output. (Write_Field22_Name): Alphabetize the output. (Write_Field23_Name): Alphabetize the output. Remove the output of Associated_Final_Chain. Add output for Associated_Collection. (Write_Field24_Name): Alphabetize the output. (Write_Field25_Name): Add output for Finalizer. (Write_Field26_Name): Alphabetize the output. (Write_Field27_Name): Alphabetize the output. (Write_Field28_Name): Alphabetize the output. * einfo.ads: Add new field description for Associated_Collection and its uses in nodes. Remove Associated_Final_Chain and its uses in nodes. Remove Finalization_Chain_Entity and its uses in nodes. Add new field description for Finalizer and its uses in nodes. Add new synthesized attribute Is_Finalizer. Add new flag description for Is_Processed_Transient and its uses in nodes. Add new field description for Return_Flag and its uses in nodes. (Associated_Final_Chain): Removed along with its pragma Inline. (Associated_Collection): New routine and pragma Inline. (Finalization_Chain_Entity): Removed along with its pragma Inline. (Finalizer): New routine and pragma Inline. (Is_Finalizer): New routine and pragma Inline. (Is_Processed_Transient): New routine and pragma Inline. (Return_Flag): New routine and pragma Inline. (Set_Associated_Final_Chain): Removed along with its pragma Inline. (Set_Associated_Collection): New routine and pragma Inline. (Set_Finalization_Chain_Entity): Removed along with its pragma Inline. (Set_Finalizer): New routine and pragma Inline. (Set_Is_Processed_Transient): New routine and pragma Inline. (Set_Return_Flag): New routine and pragma Inline. * exp_aggr.adb: Alphabetize subprograms. (Build_Array_Aggr_Code): Remove formal Flist and its associated comment. (Build_Record_Aggr_Code): Remove formals Flist and Obj along with their associated comments. Remove local variables External_Final_List and Attach. Rename Ctrl_Stuff_Done to Finalization_Done. Rename local variable A to Ancestor. Remove the retrieval of finalization lists. Update the call to Make_Adjust_Call. (Convert_Aggr_In_Allocator): Remove the retrieval of finalization lists. Update the call to Late_Expansion. (Convert_Aggr_In_Assignment): Update the call to Late_Expansion. (Convert_Aggr_In_Object_Decl): Update the call to Late_Expansion. (Gen_Assign): Remove the retrieval of the finalization list used to build the assignment. Update the calls to Make_Init_Call and Make_Adjust_Call. (Gen_Ctrl_Actions_For_Aggr): Renamed to Generate_Finalization_Actions. Remove the mechanism to determine attachment levels and finalization list retrieval. Remove the processing for coextensions. (Init_Controller): Removed. Controllers no longer exist. (Late_Expansion): Remove formals Flist and Obj along with their associated comments. Update the calls to Build_Record_Aggr_Code and Build_Array_Aggr_Code. * exp_ch13.adb (Expand_N_Free_Statement): New routine. (Expand_N_Freeze_Entity): Add special processing for finalizers which appear in entry bodies, protected subprograms and task bodies. * exp_ch13.ads (Expand_N_Free_Statement): New routine. * exp_ch3.adb (Add_Final_Chain): Removed. (Build_Array_Init_Proc): Alphabetize local variables. (Build_Assignment): Alphabetize local variables. Update the call to Maked_Adjust_Call. (Build_Class_Wide_Master): Rename local variables to better reflect their role. (Build_Discriminant_Assignments): Code reformatting. (Build_Init_Call_Thru): Code reformatting. (Build_Init_Procedure): Code reformatting. Generate a special version of Deep_Finalize which is capable of finalizing all initialized components and ignore the rest. (Build_Init_Statements): Rename local variables to better reflect their role. Reimplement the mechanism to include the creation and update of an index variable called a "counter". It is used as a bookmark for tracing initialized and non-initialized components. (Build_Initialization_Call): Remove local variable Controller_Typ. Alphabetize all local variables. Remove the initialization of the record controller and update the call to Make_Init_Call. (Build_Record_Init_Proc): Rename formal Pe to Rec_Ent. New local variable Counter. (Constrain_Array): Alphabetize. (Expand_Freeze_Array_Type): Create a collection instead of a finalization list. (Expand_Freeze_Class_Wide_Type): New routine. Creates TSS primitive Finalize_Address which is used in conjunction with allocated controlled objects. (Expand_N_Object_Declaration): Remove the creation of a finalization list for anonymous access types. Update the calls to Make_Init_Call and Make_Adjust_Call. (Expand_Freeze_Record_Type): Remove local variable Flist. Remove the retrieval of finalization lists. Remove the expansion of the record controller. Create TSS primitive Finalize_Address used in conjunction with controlled objects on the heap. Create finalization collections for access-to-controlled record components. (Expand_Record_Controller): Removed. (Freeze_Type): Remove the freezing of record controllers. Freezing of class-wide types now requires additional processing. Create finalization collections for access-to-controlled types. (Increment_Counter): New routine. (Make_Counter): New routine. (Make_Eq_If): Remove the mention of Name_uController. (Make_Predefined_Primitive_Specs): There is no longer need to skip types coming from System.Finalization_Root. (Predef_Deep_Spec): Reimplemented to reflect the new parameter profiles. (Predefined_Primitive_Bodies): There is no longer need to skip types coming from System.Finalization_Root. (Stream_Operation_OK): Do not generate stream routines for type Ada.Finalization.Heap_Management.Finalization_Collection. * exp_ch3.ads: Alphabetize subprograms. * exp_ch4.adb: Remove with and use clause for Sem_Ch8. Add with and use clause for Lib. (Complete_Coextension_Finalization): Removed. (Complete_Controlled_Allocation): New routine. Create a finalization collection for anonymous access-to-controlled types. Create a custom Allocate which interfaces with the back end and the machinery in Heap_Management. (Expand_Allocator_Expression): Add necessary calls to Complete_Controlled_Allocation. Remove the retrieval of finalization lists. Update the calls to Make_Adjust_Call. Generate a call to Ada.Finalization.Heap_Management.Set_Finalize_Address_Ptr to decorate the associated collection. (Expand_N_Allocator): Remove the processing for dynamic coextensions. Code clean up. Remove the retrieval of finalization lists and attachment levels. Update the call to Make_Init_Call. Generate a call to Ada.Finalization.Heap_Management.Set_Finalize_Address_Ptr to decorate the associated collection. (Get_Allocator_Final_List): Removed. Finalization lists are not available. (Suitable_Element): Remove the mention of Name_uController. * exp_ch5.adb: Remove with and use clauses for Ttypes and Uintp. (Make_Tag_Ctrl_Assignment): Rewritten to simply do a finalization of the left hand side, carry out the assignment and adjust the left hand side. * exp_ch6.adb (Add_Final_List_Actual_To_Build_In_Place_Call): Removed. (Add_Collection_Actual_To_Build_In_Place_Call): New routine. (BIP_Formal_Suffix): Rename BIP_Final_List and BIPfinallist to BIP_Collection and BIPcollection. (Build_Heap_Allocator): New routine used to allocate the return object of a build-in-place function onto a collection. (Expand_Ctrl_Function_Call): Moved from Exp_Ch7. (Expand_Call): Do not replace direct calls to Deep routines with their aliases. (Expand_N_Extended_Return_Statement): Give all variables shorter names and update their occurrences. Add a special return flag to monitor the [ab]normal execution of the function. The flag is set right before the return statement. Rewrite the mechanism used to allocate a build-in-place return object on the heap or on a storage pool. (Is_Direct_Deep_Call): New routine. (Make_Build_In_Place_Call_In_Allocator): Add a collection to a build-in-place function call instead of a final list. Build a call to Set_Finalize_Address_Ptr to decorate the associated collection. (Make_Build_In_Place_Call_In_Anonymous_Context): Create a temporary in order to name the build-in-place function call's result for later finalization. Add a collection to a build-in-place function call instead of a final list. (Make_Build_In_Place_Call_In_Assignment): Add a collection to a build-in-place function call instead of a final list. Remove the code which moves one final list and transforms it into the actual in a nested build-in-place call. (Make_Build_In_Place_Call_In_Object_Declaration): Add a collection to a build-in-place function call instead of a final list. (Move_Final_List): Removed. (Needs_BIP_Collection): New routine. (Needs_BIP_Final_List): Removed. * exp_ch6.ads: Replace BIP_Final_List with BIP_Collection in enumeration type BIP_Formal_Kind. Update the related comment. (Needs_BIP_Collection): New routine. (Needs_BIP_Final_List): Removed. * exp_ch7.adb: Add with and use clauses for Elists, Exp_Ch6, Stringt and Ttypes. Remove with and use clauses for Sem_Type. Alphabetize the majority of subprograms in this unit. Add Name_Finalize_Address to array Name_Of and TSS_Finalize_Address to array Deep_Name_Of. (Build_Adjust_Or_Finalize_Statements): Create the adjust or finalization statements for an array type. (Build_Adjust_Statements): Create the adjust statements for a record type. (Build_Cleanup_Statements): New routine. A procedure which given any construct containing asynchronous calls, references to _master, or is a task body, a task allocation or a protected body produces the necessary runtime calls to clean up these constructs. (Build_Exception_Handler): New routine. (Build_Final_List): Removed. (Build_Finalization_Collection): New routine. A core procedure which creates a collection to service heap allocated controlled objects associated with an access-to-controlled type. (Build_Finalize_Statements): Create the finalization statements for a record types. (Build_Finalizer): New routine. A core procedure which given any construct with declarations and/or statements detects all objects which need any type of clean up (controlled objects, protected objects) and generates all necessary code to clean up the said objects in the proper order. (Build_Finalizer_Call): New routine. (Build_Initialize_Statements): Create the initialization statements for an array type. The generated routine contains code to finalize partially initialized arrays. (Build_Object_Declarations): New routine. (Build_Raise_Statement): New routine. (Clean_Simple_Protected_Objects): Removed. (Controller_Component): Removed. (Enclosing_Function): New routine. (Expand_Cleanup_Actions): Create a finalizer for a construct which has either declarations or statements or both. (Expand_N_Package_Body): Create a finalizer for a non-generic package. (Expand_N_Package_Declaration): Create a finalizer for a non-generic package. (Find_Final_List): Removed. (Global_Flist_Ref): Removed. (In_Finalization_Root): Removed. (Insert_Actions_In_Scope_Around): Determine the range of the transient scope in terms of tree nodes. Process all transient variables within that range. (Make_Adjust_Call): Rewritten. There is no longer an attach call generated after the adjust. (Make_Attach_Call): Removed. (Make_Call): New routine. (Make_Clean): Removed. (Make_Deep_Array_Body): Rewritten to simply invoke the appropriate build routines. (Make_Deep_Proc): Rewritten to generate the new profile signature used in Deep routines. (Make_Deep_Record_Body): Rewritten to simply invoke the appropriate build routines. (Make_Final_Call): Modified to simply create a call to either Deep_Finalize or Finalize. (Make_Finalize_Address_Body): New routine. (Make_Finalize_Address_Stmts): New routine. A function which produces TSS primitive Finalize_Address used in conjunction with heap allocated controlled objects. (Make_Handler_For_Ctrl_Operation): Add specialized code for .NET/JVM. (Make_Init_Call): Rewritten. There is no longer an attach call generated after initialization. (Make_Local_Deep_Finalize): New routine. (Make_Set_Finalize_Address_Ptr_Call): New routine. (Make_Transient_Block): Remove the finalization list retrieval and manipulation. (Needs_Finalization): Moved to Exp_Util. (Parent_Field_Type): New routine. (Preprocess_Components): New routine. (Process_Transient_Objects): New routine. (Wrap_HSS_In_Block): New routine. (Wrap_Transient_Declaration): Remove finalization list management and controller insertion. (Wrap_Transient_Expression): Code reformatting. (Wrap_Transient_Statement): Code reformatting. * exp_ch7.ads (Build_Final_List): Removed. (Build_Finalization_Collection): New routine. (Build_Raise_Statement): New routine. (Controller_Component): Removed. (Expand_Ctrl_Function_Call): Moved to Exp_Ch6. (Find_Final_List): Removed. (In_Finalization_Root): Removed. (Is_Simple_Protected_Type): Update related comment. (Make_Adjust_Call): New parameter profile and associated comments. (Make_Attach_Call): Removed. (Make_Final_Call): New parameter profile and associated comments. (Make_Finalize_Address_Body): New routine. (Make_Init_Call): New parameter profile and associated comments. (Make_Local_Deep_Finalize): New routine. (Make_Set_Finalize_Address_Ptr_Call): New routine. (Needs_Finalization): Moved to Exp_Util. * exp_ch9.adb (Add_Object_Pointer): Code reformatting. (Expand_N_Protected_Body): Remove the handling of finalization lists. (Find_Protection_Type): Moved to Exp_Util. * exp_disp.adb: Remove with and use clauses for Exp_Ch7. (Make_DT): Update sequence of dispatch table initialization. Remove the initialization of field RC_Offset. Add initialization of field Needs_ Finalization. * exp_intr.adb (Expand_Unc_Deallocation): Code reformatting. Reimplement how an object is first finalized, then deallocated. * exp_strm.adb (Build_Record_Or_Elementary_Input_Function): Code reformatting. * exp_tss.ads: Add special suffix for TSS primitive Finalize_Address. Register TSS_Finalize_Address with type TSS_Names. * exp_util.adb (Build_Allocate_Deallocate_Proc): New routine. This core procedure provides the interface between an allocation / deallocation and the support machinery in Ada.Finalization.Heap_Management. (Find_Init_Call): Code reformatting. (Find_Init_Call_In_List): Code reformatting. (Find_Protection_Type): Moved from Exp_Ch9. (Find_Prim_Op): Reimplement to add preference of recovered primitive. (Has_Controlled_Coextensions): Removed. (Has_Controlled_Objects): New routine. (In_Library_Level_Package_Body): New routine. (Insert_Action_After): New routine. (Is_Finalizable_Transient): New routine. This predicate determines whether an object declaration is one of the many variants of controlled transients. (Is_Null_Access_BIP_Func_Call): New routine. (Is_Non_BIP_Func_Call): New routine. (Is_Related_To_Func_Return): New routine. (Needs_Finalization): Moved from Exp_Ch7. * exp_util.ads (Build_Allocate_Deallocate_Proc): New routine. (Find_Protection_Type): Moved from Exp_Ch9. (Has_Controlled_Coextensions): Removed. (Has_Controlled_Objects): New routine. (In_Library_Level_Package_Body): New routine. (Insert_Action_After): New routine. (Is_Finalizable_Transient): New routine. (Is_Null_Access_BIP_Func_Call): New routine. (Is_Non_BIP_Func_Call): New routine. (Is_Related_To_Func_Return): New routine. (Needs_Finalization): Moved from Exp_ch7. * expander.adb (Expand): Add a case for N_Free_Statement. * freeze.adb (Freeze_All): Replace the generation of a finalization list with a collection for access-to-controlled types. (Freeze_Entity): Code reformatting. (Freeze_Record_Type): Remove the freezing of a record controller component. (Freeze_Subprogram): Code reformatting. * inline.adb (Cleanup_Scopes): Remove the reset of the scope finalization list. * lib-writ.adb (Write_Unit_Information): Output "PF" when a package has a library-level finalizer. * lib-writ.ads: Add "PF" to the sequence of unit attributes. * a-filico.ads, a-filico.adb, s-finimp.ads, s-finimp.adb: Removed. * Makefile.rtl: Remove a-filico and s-finimp from the list of object files. Add a-fihema to the list of object files. * par-ch4.adb: Alphabetize the associations in type Is_Parameterless_Attribute. * rtsfind.ads: Ada.Finalization_List.Controller and System.Finalization_Implementation are no longer a GNAT unit. Update the range of type Ada_Finalization_Child. Remove the following recoverable entities: RE_Attach_To_Final_List RE_Deep_Tag_Attach RE_Finalize_List RE_Finalize_One RE_Finalizable_Ptr_Ptr RE_Global_Final_List RE_Limited_Record_Controller RE_List_Controller RE_Move_Final_List RE_Record_Controller RE_Simple_List_Controller Add the following recoverable entities: RE_Add_Offset_To_Address RE_Allocate RE_Base_Pool RE_Deallocate RE_Exception_Identity RE_Finalization_Collection RE_Finalization_Collection_Ptr RE_Needs_Finalization RE_Save_Library_Occurrence RE_Set_Finalize_Address_Ptr RE_Set_Storage_Pool_Ptr RE_Storage_Count * sem_aggr.adb (Resolve_Record_Aggregate): Remove mention of Name_uController. * sem_aux.adb (First_Discriminant): Remove mention of Name_uController. (First_Stored_Discriminant): Remove the mention of Name_uController. * sem_aux.ads: Comment reformatting. * sem_ch10.adb (Build_Chain): Signal the class-wide creation machinery to redecorate an already existing class-wide type. (Decorate_Tagged_Type): New parameter profile and associated comment. Create a "shadow class-wide type" for a shadow entity. * sem_ch11.adb (Analyze_Exception_Handlers): Remove the dubious setting of the final chain along with the associated comment. * sem_ch3.adb (Access_Type_Declaration): Add new local variable Full_Desig and set it to the full view of the designated type. Initialize the finalization collection to empty. (Build_Derived_Record_Type): Alphabetize local variables. Code reformatting. (Collect_Fixed_Components): Remove the mention of Name_uController. (Create_Constrained_Components): Remove the mention of Name_uController. (Make_Class_Wide_Type): Add specialized code to redecorate an existing class-wide type of a shadow entity. (Process_Full_View): Update the machinery which marks type Limited_Controlled's entity as limited. * sem_ch4.adb (Analyze_One_Call): Code reformatting. * sem_ch6.adb (Create_Extra_Formals): Do not generate a finalization list, instead make a collection build-in-place formal. * sem_ch8.adb (Analyze_Object_Renaming): Look at the available view of a designated type in order to establish a match between the renaming and the renamed entity. (Find_Selected_Component): Add guard to prevent spurious exceptions from being raised on .NET/JVM. * sem_disp.adb (Check_Dispatching_Operation): Include Finalize_Address to the list of primitive that need special processing. Update arrays C_Names and D_Names. (Replace_Types): Handle class-wide types. * sem_elab.adb (Check_A_Call): Since Deep_Initialize now has a different parameter profile, look at the first formal. * sem_prag.adb: Remove with and use clauses for Exp_Ch7. Add with and use clauses for Exp_Util. * sem_res.adb: Remove with and use clauses for Elists. (Propagate_Coextensions): Removed. (Resolve_Allocator): Do not propagate the list of coextensions from one allocator to another. * sem_util.adb (Build_Actual_Subtype_Of_Component): Rename variable Deaccessed_T to Desig_Typ. (Enter_Name): Remove the mention of Name_uController. (Gather_Components): Remove the mention of Name_uController. (Incomplete_Or_Private_View): New routine. (Is_Coextension_Root): Removed. (Is_Fully_Initialized_Type): Remove the mention of Name_uController. * sem_util.ads (Incomplete_Or_Private_View): New routine. (Is_Coextension_Root): Removed. * s-finroo.ads: Remove with clause for Ada.Unchecked_Conversion. Controlled types are now derived from a null tagged record. Remove types Finalizable_Ptr, Finalizable and Empty_Root_Controlled. * sinfo.adb (Coextensions): Removed. (Set_Coextensions): Removed. * sinfo.ads: Remove Coextensions from the explanation of node fields and its uses in nodes. Update the field usage of N_Allocator. (Coextensions): Removed along with its pragma Inline. (Set_Coextensions): Removed along with its pragma Inline. * snames.ads-tmpl: Remove names Name_uClean Name_uController Name_uFinal_List Name_uLocal_Final_List Name_Finalization_Root Name_Next Name_Prev Add names Name_uFinalizer Name_Finalize_Address * s-pooglo.adb (Allocate): Add overriding indicator. (Deallocate): Add overriding indicator. (Storage_Size): Add overriding indicator. * s-soflin.adb (Adafinal_NT): Invoke Finalize_Library_Objects rather than Finalize_Global_List. (Null_Finalize_Global_List): Removed. (Save_Library_Occurrence): New routine. * s-soflin.ads: Remove variable Finalize_Global_List along with its initialization. Add variable Finalize_Library_Objects along with its pragma Export. Add variables Library_Exception and Library_Exception_Set along with their pragma Export. (Null_Finalize_Global_List): Removed. (Save_Library_Occurrence): New routine. * s-tassta.adb (Finalize_Global_Tasks): Call Finalize_Library_Objects rather than Finalize_Global_List. * tbuild.adb (Unchecked_Convert_To): Capture and set the parent field of the constructed node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177275 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-08-03 Javier Miranda <miranda@adacore.com>charlet2011-08-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_util.adb, sem_aux.adb, exp_util.ads, sem_aux.ads: Move routine Is_VM_By_Copy_Actual from sem_aux to exp_util. 2011-08-03 Bob Duff <duff@adacore.com> * sem_ch8.adb (Is_Primitive_Operator_In_Use): Always check In_Use on the Base_Type. 2011-08-03 Joel Brobecker <brobecker@adacore.com brobecker> * g-sha256.ads, g-sha512.ads, g-sha1.ads, g-sha224.ads, g-sha384.ads, g-sehash.ads: Fix typo. Update header. 2011-08-03 Thomas Quinot <quinot@adacore.com> * exp_ch6.adb (Expand_Actuals): Remove Ada_2005 guard on build-in-place expansion. 2011-08-03 Gary Dismukes <dismukes@adacore.com> * sem_ch4.adb (Analyze_Overloaded_Selected_Component): Consider prefixes of private types along with records, since the selector may be a discriminant. * sem_res.adb (Resolve_Selected_Component): Consider prefixes of private types along with records, since the selector may be a discriminant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177259 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-08-03 Yannick Moy <moy@adacore.com>charlet2011-08-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alfa.ads Update format of ALFA section in ALI file in order to add a mapping from bodies to specs when both are present (ALFA_Scope_Record): add components for spec file/scope * get_alfa.adb (Get_ALFA): read the new file/scope for spec when present * lib-xref-alfa.adb (Collect_ALFA): after all scopes have been collected, fill in the spec information when relevant * put_alfa.adb (Put_ALFA): write the new file/scope for spec when present. 2011-08-03 Eric Botcazou <ebotcazou@adacore.com> * inline.adb (Add_Inlined_Subprogram): Do not consider the enclosing code unit to decide whether to add internally generated subprograms. 2011-08-03 Javier Miranda <miranda@adacore.com> * sem_aux.ads, sem_aux.adb (Is_VM_By_Copy_Actual): New subprogram. * exp_ch9.adb (Build_Simple_Entry_Call): Handle actuals that must be handled by copy in VM targets. 2011-08-03 Emmanuel Briot <briot@adacore.com> * make.adb, makeutl.adb, makeutl.ads (Make.Switches_Of): now shares code with Makeutl.Get_Switches. * prj-tree.adb: Update comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177256 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-08-02 Robert Dewar <dewar@adacore.com>charlet2011-08-021-0/+6
| | | | | | | | | | | | | | | * einfo.ads, einfo.adb (Suppress_Initialization): Replaces Suppress_Init_Procs. * exp_ch3.adb, exp_disp.adb, freeze.adb: Use Suppress_Initialization/Initialization_Suppressed. * gnat_rm.texi: New documentation for pragma Suppress_Initialization * sem_aux.ads, sem_aux.adb (Initialization_Suppressed): New function * sem_dist.adb: Use Suppress_Initialization/Initialization_Suppressed * sem_prag.adb: New processing for pragma Suppress_Initialization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177161 138bc75d-0d04-0410-961f-82ee72b054a4
* 2011-08-01 Vincent Celier <celier@adacore.com>charlet2011-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * s-parame-vms-ia64.ads: Fix typo in comment Minor reformatting * s-parame-vms-restrict.ads: Removed, unused. 2011-08-01 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Is_Variable_Size_Array): Remove local subprogram Is_Constant_Bound. * sem_ch3.adb (Constrain_Index): Remove side effects in the evaluation of the bounds. * sem_ch3.ads, sem_ch3.adb (Is_Constant_Bound): New extended version of the subprogram that was previously located inside function Exp_Ch3.Is_Variable_Size_Array. Moved here since it is shared by routines of sem_ch3 and exp_ch3. * sem_aux.ads (Constant_Value): Fix typo in comment. * checks.adb (Generate_Index_Checks): New implementation which, for array objects with constant bounds, generates the runtime check referencing the bounds of the array type. For other cases this routine provides its previous behavior obtaining such values from the array object. * sem_res.adb (Set_Slice_Subtype): Link a copied range subtree with its parent type. * atree.adb (New_Copy): Reset flag Is_Overloaded in the new copy since we cannot have semantic interpretations of the new node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177051 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix typos in gcc/ada.rwild2010-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ada/: * projects.texi: Fix typos. * gnat_rm.texi: Likewise. * gnat_ugn.texi: Likewise. * sem_util.adb: Fix typo in variable, typos in comments. * a-btgbso.adb: Fix typos in comments. * a-cbdlli.adb, a-cbhase.ads, a-cdlili.adb, a-cobove.adb, a-coinve.adb, a-convec.adb, a-direct.ads, a-strunb-shared.adb, a-strunb-shared.ads, a-stuten.ads, a-stwiun-shared.adb, a-stwiun-shared.ads, a-stzunb-shared.adb, a-stzunb-shared.ads, a-suenco.adb, a-suenst.adb, a-suewst.adb, a-suezst.adb, ali.ads, aspects.ads, atree.ads, binde.adb, bindgen.adb, checks.adb, checks.ads, einfo.ads, err_vars.ads, errout.adb, errout.ads, exp_aggr.adb, exp_attr.adb, exp_cg.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.ads, exp_disp.adb, exp_fixd.ads, freeze.adb, g-altive.ads, g-comlin.ads, g-excact.ads, g-mbdira.adb, g-sechas.ads, g-sehash.ads, g-sha1.ads, g-sha224.ads, g-sha256.ads, g-sha384.ads, g-sha512.ads, g-shsh32.ads, g-shsh64.ads, g-socket.adb, g-socket.ads, g-sothco.ads, gcc-interface/decl.c, gcc-interface/trans.c, gcc-interface/utils2.c, gnat1drv.adb, init.c, inline.adb, link.c, locales.c, make.adb, mingw32.h, namet.ads, osint.adb, par-ch12.adb, par-ch13.adb, par-ch3.adb, par-ch4.adb, par-prag.adb, par.adb, par_sco.adb, prepcomp.adb, prj-conf.ads, prj-dect.adb, prj-env.adb, prj-env.ads, prj-nmsc.adb, prj-tree.ads, prj-util.ads, prj.adb, prj.ads, s-auxdec-vms-alpha.adb, s-auxdec-vms_64.ads, s-oscons-tmplt.c, s-osinte-vxworks.ads, s-osprim-mingw.adb, s-regexp.adb, s-stusta.adb, s-taprop-mingw.adb, s-taprop-solaris.adb, scn.adb, scos.ads, sem.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_aux.ads, sem_ch12.adb, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb, sem_disp.ads, sem_eval.adb, sem_intr.adb, sem_prag.adb, sem_res.adb, sem_scil.adb, sem_util.ads, sem_warn.adb, sem_warn.ads, sinfo.ads, socket.c, styleg.adb, switch.ads, sysdep.c, tb-alvxw.c, xoscons.adb: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168082 138bc75d-0d04-0410-961f-82ee72b054a4
* 2010-10-22 Robert Dewar <dewar@adacore.com>charlet2010-10-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_util.ads, sem_util.adb, sem_aux.ads, sem_aux.adb (Is_Generic_Formal): Moved from Sem_Util to Sem_Aux. 2010-10-22 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): New subprogram, implements new iterator forms over arrays and containers, in loops and quantified expressions. * exp_util.adb (Insert_Actions): include N_Iterator_Specification. * par-ch4.adb (P_Quantified_Expression): Handle iterator specifications. * par-ch5.adb (P_Iterator_Specification): New subprogram. Modify P_Iteration_Scheme to handle both loop forms. * sem.adb: Handle N_Iterator_Specification. * sem_ch5.adb, sem_ch5.ads (Analyze_Iterator_Specification): New subprogram. * sinfo.adb, sinfo.ads: New node N_Iterator_Specification. N_Iteration_Scheme can now include an Iterator_Specification. Ditto for N_Quantified_Expression. * snames.ads-tmpl: Add names Cursor, Element, Element_Type, No_Element, and Previous, to support iterators over predefined containers. * sprint.adb: Handle N_Iterator_Specification. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165811 138bc75d-0d04-0410-961f-82ee72b054a4
* 2010-10-22 Robert Dewar <dewar@adacore.com>charlet2010-10-221-0/+18
| | | | | | | | | | | | | | | * checks.adb (Apply_Predicate_Check): Remove attempt at optimization when subtype is the same, caused legitimate checks to be missed. * exp_ch13.adb (Build_Predicate_Function): Use Nearest_Ancestor to get inheritance from right entity. * freeze.adb (Freeze_Entity): Use Nearest_Ancestor to freeze in the derived type case if the ancestor type has predicates. * sem_aux.ads, sem_aux.adb (Nearest_Ancestor): New function. * sem_prag.adb (Check_Enabled): Minor code reorganization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165807 138bc75d-0d04-0410-961f-82ee72b054a4
* 2010-10-08 Robert Dewar <dewar@adacore.com>charlet2010-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Check_Duplicate_Pragma): Check for entity match * gcc-interface/Make-lang.in: Update dependencies. * einfo.ads: Minor reformatting. 2010-10-08 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb, sem_ch3.adb, exp_ch7.adb, exp_util.adb, sem_aux.adb, sem_aux.ads, exp_ch4.adb, exp_ch6.adb, sem_ch6.adb, exp_aggr.adb, exp_ch3.adb: Change Is_Inherently_Limited_Type to Is_Immutably_Limited_Type to accord with new RM terminology. * sem_aux.adb (Is_Immutably_Limited_Type): A type that is a descendant of a formal limited private type is not immutably limited in a generic body. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165175 138bc75d-0d04-0410-961f-82ee72b054a4
* 2010-09-10 Ed Schonberg <schonberg@adacore.com>charlet2010-09-101-1/+2
| | | | | | | | | | | | | | | * sem_ch3.adb (Derive_Subprograms): An interface primitive operation that is a renaming must be derived like any other primitive operation, the renamed operation is not relevant to the derivation. 2010-09-10 Robert Dewar <dewar@adacore.com> * sem_aux.ads: Add comment for Is_Inherently_Limited_Type. * checks.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164155 138bc75d-0d04-0410-961f-82ee72b054a4
* 2010-06-22 Robert Dewar <dewar@adacore.com>charlet2010-06-221-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * s-rannum.adb: Minor reformatting. 2010-06-22 Javier Miranda <miranda@adacore.com> * sem_aux.adb, sem_aux.ads, sem_util.adb, sem_util.ads, sem_elim.adb, exp_cg.adb: Minor code reorganization: Move routine Ultimate_Alias from package Sem_Util to package Sem_Aux. 2010-06-22 Javier Miranda <miranda@adacore.com> * exp_disp.adb (Make_Secondary_DT, Make_DT): Minor code cleanup: remove useless restriction on imported routines when building the dispatch tables. 2010-06-22 Robert Dewar <dewar@adacore.com> * cstand.adb (Create_Standard): Set Has_Pragma_Pack for standard string types. 2010-06-22 Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Collect_Generic_Type_Ops): Protect code that handles generic subprogram declarations to ensure proper context. Add missing support for generic actuals. (Try_Primitive_Operation): Add missing support for concurrent types that have no Corresponding_Record_Type. Required to diagnose errors compiling generics or when compiling with no code generation (-gnatc). * sem_ch9.adb (Analyze_Protected_Type, Analyze_Task_Type): Do not build the corresponding record type. * sem_disp.ads, sem_disp.adb (Check_Dispatching_Operation): Complete documentation. Do minimum decoration when processing a primitive of a concurrent tagged type that covers interfaces. Required to diagnose errors in the Object.Operation notation compiling generics or under -gnatc. * exp_ch9.ads, exp_ch9.adb (Build_Corresponding_Record): Add missing propagation of attribute Interface_List to the corresponding record. (Expand_N_Task_Type_Declaration): Code cleanup. (Expand_N_Protected_Type_Declaration): Code cleanup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161203 138bc75d-0d04-0410-961f-82ee72b054a4
* 2009-07-29 Javier Miranda <miranda@adacore.com>charlet2009-07-291-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frontend.adb (Frontend): Code cleanup. * exp_atag.ads, exp_atag.adb (Build_Get_Predefined_Prim_Op_Address): Rewriten as a procedure because it a new out-mode parameters to keep up-to-date the controlling tag node in the caller. (Build_Get_Prim_Op_Address): Rewriten as a procedure because it has a new out-mode parameter to keep up-to-date the controlling tag node in the caller. * exp_ch7.adb, sem_ch5.adb, exp_util.adb, sem_util.adb, exp_ch4.adb, exp_ch6.adb, sem_ch4.adb, exp_ch3.adb: Add new dependency on new package Sem_SCIL. * sem_aux.ads, sem_aux.adb (First_Non_SCIL_Node): Removed. Routine available in new package Sem_SCIL. (Next_Non_SCIL_Node): Ditto. * exp_disp.adb (Adjust_SCIL_Node): Removed. Routine available in new package Sem_SCIL. (Expand_Dispatching_Call): Update call to modified Exp_Atags routines plus complete decoration of SCIL dispatching node. (Find_SCIL_Node): Removed. Routine available in new package Sem_SCIL. * exp_disp.ads (Adjust_SCIL_Node): Removed. Routine available in new package Sem_SCIL. (Find_SCIL_Node): Removed. Routine available in new package Sem_SCIL. * exp_ch3.adb (Build_Init_Procedure): Fix comment. * sem_scil.ads, sem_scil.adb: New files. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Addition of sem_scil.o. Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150199 138bc75d-0d04-0410-961f-82ee72b054a4
* 2009-07-28 Javier Miranda <miranda@adacore.com>charlet2009-07-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnat1drv.adb (Adjust_Global_Switches): Disable generation of SCIL nodes if we are not generating code. * frontend.adb (Check_SCIL_Node): New subprogram. Used to check attribute SCIL_Related_Node of SCIL dispatching nodes. (Check_SCIL_Nodes): New instantiation of Traverse_Proc. * sinfo.ads (Is_SCIL_Node,Set_Is_SCIL_Node): Removed (SCIL_Nkind,Set_SCIL_Nkind): Removed. (SCIL_Entity): Update documentation. (SCIL_Related_Node): Update documentation. (SCIL_Controlling_Tag): New attribute. (SCIL_Target_Prim): Update documentation. (N_Null_Statement): Remove attributes associated with SCIL nodes. (N_SCIL_Dispatch_Table_Object_Init): New node. (N_SCIL_Dispatch_Table_Tag_Init): New node. (N_SCIL_Dispatching_Call): New node. (N_SCIL_Tag_Init): New node. * sinfo.adb (Is_SCIL_Node,Set_Is_SCIL_Node): Removed (SCIL_Nkind,Set_SCIL_Nkind): Removed. (SCIL_Controlling_Tag/Set_SCIL_Controlling_Tag): New subprogram. (SCIL_Entity,Set_SCIL_Entity): Applicable only to SCIL nodes. (SCIL_Related_Node,Set_SCIL_Related_Node): Applicable only to SCIL nodes (SCIL_Target_Prim,Set_SCIL_Target_Prim): Applicable only to N_SCIL_Dispatching_Call nodes. * sem.adb (Analyze): No need to analyze SCIL nodes. * sem_aux.ads, sem_aux.adb (First_Non_SCIL_Node): New subprogram (Next_Non_SCIL_Node): New subprogram * sem_ch4.adb (Analyze_Type_Conversion): Adjust relocated SCIL dispatching nodes. * sem_ch5.adb (Analyze_Iteration_Scheme): Adjust relocated SCIL dispatching node. * sem_util.adb (Insert_Explicit_Dereference): Adjust relocated SCIL dispatching node. * exp_ch3.adb (Build_Array_Init_Proc): Skip SCIL nodes when processing null statement nodes. (Build_Init_Procedure): Generate new SCIL node. * exp_ch4.adb (Expand_N_And_Then): Adjust relocated SCIL dispatching node. * exp_ch6.adb (Is_Null_Procedure): Skip SCIL nodes. Required because they are currently implemented as special N_Null_Statement nodes. * exp_ch7.adb (Wrap_Transient_Statement): If the relocated node is a procedure call then check if some SCIL node references it and needs readjustment. * exp_disp.ads (SCIL_Node_Kind): Removed. (Adjust_SCIL_Node): New subprogram. (Find_SCIL_Node): New subprogram. (Get_SCIL_Node_Kind): Removed. (New_SCIL_Node): Removed. * exp_disp.adb (Adjust_SCIL_Node): New subprogram (Expand_Dispatching_Call): Generate new SCIL dispatching node including decoration of its new controlling_tag attribute. (Get_SCIL_Node_Kind): Removed. (Find_SCIL_Node): New subprogram. (Make_Secondary_DT): Generate new SCIL nodes. (Make_Tags): Generate new SCIL nodes. (New_SCIL_Node): Removed. * exp_util.adb (Insert_Actions): Handle SCIL nodes. (Remove_Side_Effects): Check if relocated nodes require readjustment of some SCIL dispatching node. * gcc-interface/trans.c (gnat_to_gnu): Do nothing with new SCIL nodes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150149 138bc75d-0d04-0410-961f-82ee72b054a4
* 2009-07-27 Ed Schonberg <schonberg@adacore.com>charlet2009-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_attr.adb (Expand_Attribute_Reference, case 'Valid): Reset the Is_Known_Valid flag on the temporary created for the value whose validity is being checked. * sem.adb (Do_Unit_And_Dependents): Further code reorganization to handle properly main units that are package specifications. 2009-07-27 Geert Bosch <bosch@adacore.com> * einfo.ads (Checks_May_Be_Suppressed): Fix typo in comment * sem_aux.ads: Fix typo in comment * sem_util.ads (Is_LHS): Adjust comment to match body 2009-07-27 Sergey Rybin <rybin@adacore.com> * gnat_ugn.texi (gnatcheck Complex_Inlined_Subprograms rule): Update rule definition. 2009-07-27 Olivier Hainque <hainque@adacore.com> * g-sse.ads, g-ssvety.ads: Update comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150113 138bc75d-0d04-0410-961f-82ee72b054a4
* 2009-04-10 Robert Dewar <dewar@adacore.com>charlet2009-04-101-0/+5
| | | | | | | | | | | | * sem_aux.ads, sem_aux.adb (Nearest_Current_Scope): New function. * sem_res.adb (Resolve_Call): Fix test for Suppress_Value_Tracking_On_Call (was wrong for the case of a call from a non-dynamic scope). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145881 138bc75d-0d04-0410-961f-82ee72b054a4
* 2009-04-09 Robert Dewar <dewar@adacore.com>charlet2009-04-091-13/+118
| | | | | | | | | | | | | | | | | | * sem_aggr.adb, exp_ch5.adb, sem_ch3.adb, exp_atag.adb, layout.adb, sem_dist.adb, exp_ch7.adb, sem_ch5.adb, sem_type.adb, exp_imgv.adb, exp_util.adb, sem_aux.adb, sem_aux.ads, exp_attr.adb, exp_ch9.adb, sem_ch7.adb, inline.adb, fe.h, sem_ch9.adb, exp_code.adb, einfo.adb, einfo.ads, exp_pakd.adb, checks.adb, sem_ch12.adb, exp_smem.adb, tbuild.adb, freeze.adb, sem_util.adb, sem_res.adb, sem_attr.adb, exp_dbug.adb, sem_case.adb, exp_tss.adb, exp_ch4.adb, exp_ch6.adb, sem_smem.adb, sem_ch4.adb, sem_mech.adb, sem_ch6.adb, exp_disp.adb, sem_ch8.adb, exp_aggr.adb, sem_eval.adb, sem_cat.adb, exp_dist.adb, sem_ch13.adb, exp_strm.adb, lib-xref.adb, sem_disp.adb, exp_ch3.adb: Reorganize einfo/sem_aux, moving routines from einfo to sem_aux git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145820 138bc75d-0d04-0410-961f-82ee72b054a4
* 2008-04-08 Robert Dewar <dewar@adacore.com>charlet2008-04-081-0/+86
Bob Duff <duff@adacore.com> Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> * alloc.ads: Add entries for Obsolescent_Warnings table * einfo.ads, einfo.adb: Minor reformatting. (Is_Discriminal): New subprogram. (Is_Prival): New subprogram. (Is_Protected_Component): New subprogram. (Is_Protected_Private): Removed. (Object_Ref, Set_Object_Ref): Removed. (Prival, Set_Prival): Change assertion. (Privals_Chain, Set_Privals_Chain): Removed. (Prival_Link, Set_Prival_Link): New subprogram. (Protected_Operation, Set_Protected_Operation): Removed. (Protection_Object, Set_Protection_Object): New subprogram. (Write_Field17_Name): Remove case for Object_Ref. (Write_Field20_Name): Add case for Prival_Link. (Write_Field22_Name): Remove case for Protected_Operation, Privals_Chain. Add case for Protection_Object. (Can_Use_Internal_Rep): Make this into a [base type only] attribute, so clients (Overlays_Constant): New flag (Is_Constant_Object): New predicate (Is_Standard_Character_Type): New predicate (Optimize_Alignment_Space): New flag (Optimize_Alignment_Time): New flag (Has_Postconditions): New flag (Obsolescent_Warrning): Field removed (Spec_PPC_List): New field (Relative_Deadline_Variable, Set_Relative_Deadline_Variable): Add subprograms to get and set the relative deadline associated to a task. * exp_attr.adb (May_Be_External_Call): Account for the case where the Access attribute is part of a named parameter association. (Expand_Access_To_Protected_Op): Test for the attribute occurring within an init proc and use that directly as the scope rather than traversing up to the protected operation's enclosing scope. Only apply assertion on Is_Open_Scopes in the case the scope traversal is done. For the init proc case use the address of the first formal (_init) as the protected object reference. Implement Invalid_Value attribute (Expand_N_Attribute_Reference): Case Attribute_Unrestricted_Access. contents of the dispatch table there is no need to duplicate the itypes associated with record types (i.e. the implicit full view of private types). Implement Enum_Val attribute (Expand_N_Attribute_Reference, case Old): Properly handle appearence within _Postconditions procedure (Expand_N_Attribute_Reference, case Result): Implement new attribute * exp_ch5.adb (Expand_N_Simple_Return_Statement): Handle case in which a return statement calls a function that is not available in configurable runtime. (Analyze_If_Statement): don't optimize simple True/False cases in -O0 (Expand_Non_Function_Return): Generate call to _Postconditions proc (Expand_Simple_Function_Return): Ditto * frontend.adb: Add call to Sem_Aux.Initialize * sem_aux.ads, sem_aux.adb: New file. * par-prag.adb: Add entries for pragmas Precondition/Postcondition Add new Pragma_Relative_Deadline. Add support for pragmas Check and Check_Policy * sem_attr.ads, sem_attr.adb (Check_Not_CPP_Type): New subprogram. (Check_Stream_Attribute): Add missing check (not allowed in CPP types) (Analyze_Attribute): In case of attributes 'Alignment and 'size add missing check because they are not allowed in CPP tagged types. Add Sure parameter to Note_Possible_Modification calls Add implementation of Invalid_Value attribute Implement new attribute Has_Tagged_Values Implement Enum_Val attribute (Analyze_Attribute, case Range): Set Name_Req True for prefix of generated attributes. (Analyze_Attribute, case Result): If prefix of the attribute is overloaded, it always resolves to the enclosing function. (Analyze_Attribute, case Result): Properly deal with analysis when Postconditions are not active. (Resolve_Attribute, case Result): Properly deal with appearence during preanalysis in spec. Add processing for attribute Result * sem_ch6.ads, sem_ch6.adb (Check_Overriding_Indicator): Code cleanup for operators. (Analyze_Subprogram_Body): Install private_with_clauses when the body acts as a spec. (Check_Inline_Pragma): recognize an inline pragma that appears within the subprogram body to which it applies. (Analyze_Function_Return): Check that type of the expression of a return statement in a function with a class-wide result is not declared at a deeper level than the function. (Process_PPCs): Deal with enabling/disabling, using PPC_Enabled flag (Verify_Overriding_Indicator): Handle properly subprogram bodies for user- defined operators. (Install_Formals): Moved to spec to allow use from Sem_Prag for analysis of precondition/postcondition pragmas. (Analyze_Subprogram_Body.Last_Real_Spec_Entity): New name for Last_Formal, along with lots of comments on what this is about (Analyze_Subprogram_Body): Fix case where we move entities from the spec to the body when there are no body entities (now possible with precondition and postcondition pragmas). (Process_PPCs): New procedure (Analyze_Subprogram_Body): Add call to Process_PPCs * sem_ch8.adb (Use_One_Type): refine warning on a redundant use_type clause. (Pop_Scope): Restore Check_Policy_List on scope exit (Push_Scope): Save Check_Policy_List on scope entry Change name In_Default_Expression => In_Spec_Expression Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression Change name Pre_Analyze_And_Resolve => Preanalyze_And_Resolve (Analyze_Object_Renaming): Allow 'Reference as object (Analyze_Pragma, case Restriction_Warnings): Call GNAT_Pragma (Process_Restrictions_Or_Restriction_Warnings): Check for bad spelling of restriction identifier. Add Sure parameter to Note_Possible_Modication calls * sem_prag.ads, sem_prag.adb (Analyze_Pragma, case Stream_Convert): Don't check for primitive operations when calling Rep_Item_Too_Late. (Process_Import_Or_Interface): Do not place flag on formal subprograms. (Analyze_Pragma, case Export): If the entity is a deferred constant, propagate information to full view, which is the one elaborated by the back-end. (Make_Inline): the pragma is effective if it applies to an internally generated subprogram declaration for a body that carries the pragma. (Analyze_Pragma, case Optimize_Alignment): Set new flag Optimize_Alignment_Local. (Analyze_PPC_In_Decl_Part): New procedure (Get_Pragma_Arg): Moved to outer level (Check_Precondition_Postcondition): Change to allow new visibility rules for package spec (Analyze_Pragma, case Check_Policy): Change placement rules to be same as pragma Suppress/Unsuppress. Change name In_Default_Expression => In_Spec_Expression Change name Analyze_Per_Use_Expression => Preanalyze_Spec_Expression Change name Pre_Analyze_And_Resolve => Preanalyze_And_Resolve (Check_Precondition_Postcondition): Do proper visibility preanalysis for the case of these pragmas appearing in the spec. (Check_Enabled): New function (Initialize): New procedure (Tree_Read): New procedure (Tree_Write): New procedure (Check_Precondition_Postcondition): New procedure Implement pragmas Check and Check_Policy Merge Assert processing with Check * sem_warn.adb (Warn_On_Known_Condition): Handle pragma Check New warning flag -gnatw.e * sinfo.ads, sinfo.adb (Has_Relative_Deadline_Pragma): New function returning whether a task (or main procedure) has a pragma Relative_Deadline. (Set_Has_Relative_Deadline_Pragma): Procedure to indicate that a task (or main procedure) has a pragma Relative_Deadline. Add Next_Pragma field to N_Pragma node (PPC_Enabled): New flag (Next_Pragma): Now used for Pre/Postcondition processing * snames.h, snames.ads, snames.adb: New standard name Inherit_Source_Path Add entry for 'Invalid_Value attribute Add entry for new attribute Has_Tagged_Values Add entry for Enum_Val attribute Add new standard names Aggregate, Configuration and Library. Add _Postconditions Add _Result Add Pragma_Precondition Add Pragma_Postcondition Add Attribute_Result New standard name Archive_Builder_Append_Option (Preset_Names): Add _relative_deadline and relative_deadline definitions There was also a missing non_preemptive_within_priorities. (Get_Pragma_Id, Is_Pragma_Name): Add support for pragma Relative_Deadline. Add support for pragmas Check and Check_Policy * tree_gen.adb: Call Sem_Aux.Tree_Write * tree_in.adb: Call Sem_Aux.Tree_Read * exp_ch11.adb (Expand_N_Raise_Statement): New Build_Location calling sequence * exp_intr.adb (Expand_Source_Info): New Build_Location calling sequence * exp_prag.adb (Expand_Pragma_Relative_Deadline): New procedure. (Expand_N_Pragma): Call the appropriate procedure for expanding pragma Relative_Deadline. (Expand_Pragma_Check): New procedure * sinput.ads, sinput.adb (Build_Location_String): Now appends to name buffer. * sinfo.adb (PPC_Enabled): New flag git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134010 138bc75d-0d04-0410-961f-82ee72b054a4