aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib.adb
AgeCommit message (Collapse)AuthorFilesLines
2019-08-20[Ada] Get rid of linear searches in LibEric Botcazou1-7/+37
This change is aimed at removing a couple of linear searches in the units management code that can become problematic performance-wise when the number of loaded units is in the several hundreds, which can happen for large files even at -O0 without any inlining. It introduces an auxiliary hash table to record a mapping between the name of units and their entry in the units table, and then replaces the linear searches by lookups in this names table. This can save up to 2% of the compilation time spent in the front-end in some cases. There should be no functional changes, except in the error message issued for circular unit dependencies in very peculiar and convoluted cases. 2019-08-20 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * lib.ads: Add with clause for GNAT.HTable. Add pragma Inline for Is_Loaded and alphabetize the list. (Unit_Name_Table_Size): New constant. (Unit_Name_Header_Num): New subtype. (Unit_Name_Hash): New function declaration. (Unit_Names): New simple hash table. (Init_Unit_Name): New procedure declaration. * lib.adb (Set_Unit_Name): Unregister the old name in the table, if any, and then register the new name. (Init_Unit_Name): New procedure. (Is_Loaded): Reimplement using a lookup in the names table. (Remove_Unit): Unregister the name. (Unit_Name_Hash): New function. * lib-load.adb (Create_Dummy_Package_Unit): Call Init_Unit_Name. (Load_Unit): Use a lookup in the names table to find out whether the unit has already been loaded. Call Init_Unit_Name and then Remove_Unit if the loading has failed. (Make_Child_Decl_Unit): Call Init_Unit_Name. (Make_Instance_Unit): Likewise. * lib-writ.adb (Ensure_System_Dependency): Likewise. From-SVN: r274720
2019-01-08[Ada] Bump copyright years to 2019Pierre-Marie de Rodat1-1/+1
From-SVN: r267683
2018-05-30[Ada] Reuse Is_Rewrite_Substitution where possiblePiotr Trojanek1-1/+1
Use a high-level Is_Rewrite_Substitution instead of a low-level inequality, with the intention to improve the code easier to read. Semantics unaffected, so no test provided. 2018-05-30 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * errout.adb, exp_aggr.adb, exp_ch7.adb, exp_util.adb, lib.adb, sem_ch13.adb, sem_ch4.adb, sem_res.adb, sem_util.adb (Has_Original_Node): Refactor to use Is_Rewrite_Substitution. From-SVN: r260935
2018-01-11[Ada] Bump copyright notices to 2018Arnaud Charlet1-1/+1
2018-01-11 Arnaud Charlet <charlet@adacore.com> gcc/ada/ Bump copyright notices to 2018. From-SVN: r256519
2017-10-14[multiple changes]Pierre-Marie de Rodat1-0/+30
2017-10-14 Bob Duff <duff@adacore.com> * exp_ch6.adb (Is_Build_In_Place_Result_Type): Include code for enabling b-i-p for nonlimited controlled types (but disabled). 2017-10-14 Justin Squirek <squirek@adacore.com> * sem_elab.adb (Is_Suitable_Variable_Assignment): Replace call to Has_Warnings_Off with Warnings_Off. 2017-10-14 Piotr Trojanek <trojanek@adacore.com> * sinfo.ads (Generic_Parent): Remove wrong (possibly obsolete) comment. 2017-10-14 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb (Analyze_Declarations): Analyze the contract of an enclosing package at the end of the visible declarations. * sem_prag.adb (Analyze_Initialization_Item): Suppress the analysis of an initialization item which is undefined due to some illegality. 2017-10-14 Patrick Bernardi <bernardi@adacore.com> * ali.adb: Add new ALI line 'T' to read the number of tasks contain within each unit that require a default-sized primary and secondary stack to be generated by the binder. (Scan_ALI): Scan new 'T' lines. * ali.ads: Add Primary_Stack_Count and Sec_Stack_Count to Unit_Record. * bindgen.adb (Gen_Output_File): Count the number of default-sized stacks within the closure that are to be created by the binder. (Gen_Adainit, Gen_Output_File_Ada): Generate default-sized secondary stacks and record these in System.Secodnary_Stack. (Resolve_Binder_Options): Check if System.Secondary_Stack is in the closure of the program being bound. * bindusg.adb (Display): Add "-Q" switch. Remove rouge "--RTS" comment. * exp_ch3.adb (Count_Default_Sized_Task_Stacks): New routine. (Expand_N_Object_Declaration): Count the number of default-sized stacks used by task objects contained within the object whose declaration is being expanded. Only performed when either the restrictions No_Implicit_Heap_Allocations or No_Implicit_Task_Allocations are in effect. * exp_ch9.adb (Create_Secondary_Stack_For_Task): New routine. (Expand_N_Task_Type_Declaration): Create a secondary stack as part of the expansion of a task type if the size of the stack is known at run-time and the restrictions No_Implicit_Heap_Allocations or No_Implicit_Task_Allocations are in effect. (Make_Task_Create_Call): If using a restricted profile provide secondary stack parameter: either the statically created stack or null. * lib-load.adb (Create_Dummy_Package_Unit, Load_Unit, Load_Main_Source): Include Primary_Stack_Count and Sec_Stack_Count in Unit_Record initialization expressions. * lib-writ.adb (Add_Preprocessing_Dependency, Ensure_System_Dependency): Include Primary_Stack_Count and Sec_Stack_Count in Unit_Record initialization expression. (Write_ALI): Write T lines. (Write_Unit_Information): Do not output 'T' lines if there are no stacks for the binder to generate. * lib-writ.ads: Updated library information documentation to include new T line entry. * lib.adb (Increment_Primary_Stack_Count): New routine. (Increment_Sec_Stack_Count): New routine. (Primary_Stack_Count): New routine. (Sec_Stack_Count): New routine. * lib.ads: Add Primary_Stack_Count and Sec_Stack_Count components to Unit_Record and updated documentation. (Increment_Primary_Stack_Count): New routine along with pragma Inline. (Increment_Sec_Stack_Count): New routine along with pragma Inline. (Primary_Stack_Count): New routine along with pragma Inline. (Sec_Stack_Count): New routine along with pragma Inline. * opt.ads: New constant No_Stack_Size. Flag Default_Stack_Size redefined. New flag Default_Sec_Stack_Size and Quantity_Of_Default_Size_Sec_Stacks. * rtfinal.c Fixed erroneous comment. * rtsfind.ads: Moved RE_Default_Secondary_Stack_Size from System.Secondary_Stack to System.Parameters. Add RE_SS_Stack. * sem_util.adb (Number_Of_Elements_In_Array): New routine. * sem_util.ads (Number_Of_Elements_In_Array): New routine. * switch-b.adb (Scan_Binder_Switches): Scan "-Q" switch. * libgnarl/s-solita.adb (Get_Sec_Stack_Addr): Removed routine. (Set_Sec_Stack_Addr): Removed routine. (Get_Sec_Stack): New routine. (Set_Sec_Stack): New routine. (Init_Tasking_Soft_Links): Update System.Soft_Links reference to reflect new procedure and global names. * libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb, libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb (Register_Foreign_Thread): Update parameter profile to allow the secondary stack size to be specified. * libgnarl/s-tarest.adb (Create_Restricted_Task): Update the parameter profile to include Sec_Stack_Address. Update Tasking.Initialize_ATCB call to remove Secondary_Stack_Size reference. Add secondary stack address and size to SSL.Create_TSD call. (Task_Wrapper): Remove secondary stack creation. * libgnarl/s-tarest.ads (Create_Restricted_Task, Create_Restricted_Task_Sequential): Update parameter profile to include Sec_Stack_Address and clarify the Size parameter. * libgnarl/s-taskin.adb (Initialize_ATCB): Remove Secondary_Stack_Size from profile and body. (Initialize): Remove Secondary_Stack_Size from Initialize_ATCB call. * libgnarl/s-taskin.ads: Removed component Secondary_Stack_Size from Common_ATCB. (Initialize_ATCB): Update the parameter profile to remove Secondary_Stack_Size. * libgnarl/s-tassta.adb (Create_Task): Updated parameter profile and call to Initialize_ATCB. Add secondary stack address and size to SSL.Create_TSD call, and catch any storage exception from the call. (Finalize_Global_Tasks): Update System.Soft_Links references to reflect new subprogram and component names. (Task_Wrapper): Remove secondary stack creation. (Vulnerable_Complete_Master): Update to reflect TSD changes. * libgnarl/s-tassta.ads: Reformat comments. (Create_Task): Update parameter profile. * libgnarl/s-tporft.adb (Register_Foreign_Thread): Update parameter profile to include secondary stack size. Remove secondary size parameter from Initialize_ATCB call and add it to Create_TSD call. * libgnat/s-parame.adb, libgnat/s-parame__rtems.adb, libgnat/s-parame__vxworks.adb (Default_Sec_Stack_Size): New routine. * libgnat/s-parame.ads, libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads, libgnat/s-parame__vxworks.ads: Remove type Percentage. Remove constants Dynamic, Sec_Stack_Percentage and Sec_Stack_Dynamic. Add constant Runtime_Default_Sec_Stack_Size and Sec_Stack_Dynamic. (Default_Sec_Stack_Size): New routine. * libgnat/s-secsta.adb, libgnat/s-secsta.ads: New implementation. Is now Preelaborate. * libgnat/s-soflin.adb: Removed unused with-clauses. With System.Soft_Links.Initialize to initialize non-tasking TSD. (Create_TSD): Update parameter profile. Initialize the TSD and unconditionally call SS_Init. (Destroy_TSD): Update SST.SS_Free call. (Get_Sec_Stack_Addr_NT, Get_Sec_Stack_Addr_Soft, Set_Sec_Stack_Addr_NT, Set_Sec_Stack_Addr_Soft): Remove routines. (Get_Sec_Stack_NT, Get_Sec_Stack_Soft, Set_Sec_Stack_NT, Set_Sec_Stack_Soft): Add routines. (NT_TSD): Move to private part of package specification. * libgnat/s-soflin.ads: New types Get_Stack_Call and Set_Stack_Call with suppressed access checks. Renamed *_Sec_Stack_Addr_* routines and objects to *_Sec_Stack_*. TSD: removed warning suppression and component intialization. Changed Sec_Stack_Addr to Sec_Stack_Ptr. (Create_TSD): Update parameter profile. (NT_TSD): Move to private section from body. * libgnat/s-soliin.adb, libgnat/s-soliin.ads: New files. * libgnat/s-thread.ads (Thread_Body_Enter): Update parameter profile. * libgnat/s-thread__ae653.adb (Get_Sec_Stack_Addr, Set_Sec_Stack_Addr): Remove routine. (Get_Sec_Stack, Set_Sec_Stack): Add routine. (Thread_Body_Enter): Update parameter profile and body to adapt to new System.Secondary_Stack. (Init_RTS): Update body for new System.Soft_Links names. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Add s-soliin.o. From-SVN: r253754
2017-10-09[multiple changes]Pierre-Marie de Rodat1-8/+25
2017-10-09 Bob Duff <duff@adacore.com> * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Use Defining_Identifier (Obj_Decl) in two places, because it might have changed. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Deal with cases involving 'Input on (not visibly) derived types. 2017-10-09 Hristian Kirtchev <kirtchev@adacore.com> * atree.adb: Add new soft link Rewriting_Proc. (Rewrite): Invoke the subprogram attached to the rewriting soft link. (Set_Rewriting_Proc): New routine. * attree.ads: Add new access-to-subprogram type Rewrite_Proc. (Set_Rewriting_Proc): New routine. * checks.adb (Install_Primitive_Elaboration_Check): Use 'E' character for *E*laboration flag to maintain consistency with other elaboration flag generating subprograms. * debug.adb: Document the new usage of flag -gnatdL. * einfo.adb: Node19 is now used as Receiving_Entry. Node39 is now used as Protected_Subprogram. Flag148 is now used as Is_Elaboration_Checks_OK_Id. Flag302 is now used as Is_Initial_Condition_Procedure. (Is_Elaboration_Checks_OK_Id): New routine. (Is_Initial_Condition_Procedure): New routine. (Protected_Subprogram): New routine. (Receiving_Entry): New routine. (SPARK_Pragma): Update assertion. (SPARK_Pragma_Inherited): Update assertion. (Suppress_Elaboration_Warnings): Removed. (Set_Is_Elaboration_Checks_OK_Id): New routine. (Set_Is_Initial_Condition_Procedure): New routine. (Set_Protected_Subprogram): New routine. (Set_Receiving_Entry): New routine. (Set_SPARK_Pragma): Update assertion. (Set_SPARK_Pragma_Inherited): Update assertion. (Write_Entity_Flags): Update the output for Flag148 and Flag302. (Write_Field19_Name): Add output for Receiving_Entry. (Write_Field39_Name): Add output for Protected_Subprogram. (Write_Field40_Name): Update the output for SPARK_Pragma. * einfo.ads: New attributes Is_Elaboration_Checks_OK_Id, Is_Initial_Condition_Procedure, Protected_Subprogram, Receiving_Entry. Remove attribute Suppress_Elaboration_Warnings. Update the stricture of various entities. (Is_Elaboration_Checks_OK_Id): New routine along with pragma Inline. (Is_Initial_Condition_Procedure): New routine along with pragma Inline. (Protected_Subprogram): New routine along with pragma Inline. (Receiving_Entry): New routine along with pragma Inline. (Suppress_Elaboration_Warnings): Removed. (Set_Is_Elaboration_Checks_OK_Id): New routine along with pragma Inline. (Set_Is_Initial_Condition_Procedure): New routine along with pragma Inline. (Set_Protected_Subprogram): New routine along with pragma Inline. (Set_Receiving_Entry): New routine along with pragma Inline. (Set_Suppress_Elaboration_Warnings): Removed. * exp_ch3.adb (Build_Init_Procedure): Use name _Finalizer to maintain consistency with other finalizer generating subprograms. (Default_Initialize_Object): Mark the block which wraps the call to finalize as being part of initialization. * exp_ch7.adb (Expand_N_Package_Declaration): Directly expand pragma Initial_Condition. (Expand_N_Package_Body): Directly expand pragma Initial_Condition. (Next_Suitable_Statement): Update the comment on usage. Skip over call markers generated by the ABE mechanism. * exp_ch9.adb (Activation_Call_Loc): New routine. (Add_Accept): Link the accept procedure to the original entry. (Build_Protected_Sub_Specification): Link the protected or unprotected version to the original subprogram. (Build_Task_Activation_Call): Code cleanup. Use a source location which is very close to the "begin" or "end" keywords when generating the activation call. * exp_prag.adb (Expand_Pragma_Initial_Condition): Reimplemented. * exp_spark.adb (Expand_SPARK): Use Expand_SPARK_N_Loop_Statement to process loops. (Expand_SPARK_N_Loop_Statement): New routine. (Expand_SPARK_N_Object_Declaration): Code cleanup. Partially insert the call to the Default_Initial_Condition procedure. (Expand_SPARK_Op_Ne): Renamed to Expand_SPARK_N_Op_Ne. * exp_util.adb (Build_DIC_Procedure_Body): Capture the SPARK_Mode in effect. (Build_DIC_Procedure_Declaration): Capture the SPARK_Mode in effect. (Insert_Actions): Add processing for N_Call_Marker. (Kill_Dead_Code): Explicitly kill an elaboration scenario. * exp_util.ads (Make_Invariant_Call): Update the comment on usage. * frontend.adb: Initialize Sem_Elab. Process all saved top level elaboration scenarios for ABE issues. * gcc-interface/trans.c (gnat_to_gnu): Add processing for N_Call_Marker nodes. * lib.adb (Earlier_In_Extended_Unit): New variant. * sem.adb (Analyze): Ignore N_Call_Marker nodes. (Preanalysis_Active): New routine. * sem.ads (Preanalysis_Active): New routine. * sem_attr.adb (Analyze_Access_Attribute): Save certain elaboration-related attributes. Save the scenario for ABE processing. * sem_ch3.adb (Analyze_Object_Declaration): Save the SPARK mode in effect. Save certain elaboration-related attributes. * sem_ch5.adb (Analyze_Assignment): Save certain elaboration-related attributes. Save the scenario for ABE processing. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Save the SPARK mode in effect. Save certain elaboration-related attributes. (Analyze_Subprogram_Body_Helper): Skip N_Call_Marker nodes when locating the first real statement. (Analyze_Subprogram_Declaration): Save the SPARK mode in effect. Save certain elaboration-related attributes. * sem_ch7.adb (Analyze_Package_Declaration): Do not suppress elaboration warnings. * sem_ch8.adb (Attribute_Renaming): Mark a subprogram body which was generated for purposes of wrapping an attribute used as a generic actual. (Find_Direct_Name): Save certain elaboration-related attributes. Save the scenario for ABE processing. (Find_Expanded_Name): Save certain elaboration-related attributes. Save the scenario for ABE processing. * sem_ch9.adb (Analyze_Entry_Declaration): Save certain elaboration-related attributes. (Analyze_Requeue): Save certain elaboration-related attributes. Save the scenario for ABE processing. (Analyze_Single_Task_Declaration): Save certain elaboration-related attributes. (Analyze_Task_Type_Declaration): Save certain elaboration-related attributes. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Save certain elaboration-related attributes. (Analyze_Generic_Subprogram_Declaration): Save the SPARK mode in effect. Save certain elaboration-related attributes. (Analyze_Package_Instantiation): Save certain elaboration-related attributes. Save the scenario for ABE processing. Create completing bodies in case the instantiation results in a guaranteed ABE. (Analyze_Subprogram_Instantiation): Save certain elaboration-related attributes Save the scenario for ABE processing. Create a completing body in case the instantiation results in a guaranteed ABE. (Provide_Completing_Bodies): New routine. * sem_elab.ads: Brand new implementation. * sem_prag.adb (Analyze_Pragma, cases Elaborate, Elaborate_All, Elaborate_Body): Do not suppress elaboration warnings. * sem_res.adb (Make_Call_Into_Operator): Set the parent field of the operator. (Resolve_Call): Save certain elaboration-related attributes. Save the scenario for ABE processing. (Resolve_Entity_Name): Do not perform any ABE processing here. (Resolve_Entry_Call): Inherit certain attributes from the original call. * sem_util.adb (Begin_Keyword_Location): New routine. (Defining_Entity): Update the parameter profile. Add processing for concurrent subunits that are rewritten as null statements. (End_Keyword_Location): New routine. (Find_Enclosing_Scope): New routine. (In_Instance_Visible_Part): Code cleanup. (In_Subtree): Update the parameter profile. Add new version. (Is_Preelaborable_Aggregate): New routine. (Is_Preelaborable_Construct): New routine. (Mark_Elaboration_Attributes): New routine. (Scope_Within): Update the parameter profile. (Scope_Within_Or_Same): Update the parameter profile. * sem_util.ads (Begin_Keyword_Location): New routine. (Defining_Entity): Update the parameter profile and the comment on usage. (End_Keyword_Location): New routine. (Find_Enclosing_Scope): New routine. (In_Instance_Visible_Part): Update the parameter profile. (In_Subtree): Update the parameter profile. Add new version. (Is_Preelaborable_Aggregate): New routine. (Is_Preelaborable_Construct): New routine. (Mark_Elaboration_Attributes): New routine. (Scope_Within): Update the parameter profile and the comment on usage. (Scope_Within_Or_Same): Update the parameter profile and the comment on usage. * sem_warn.adb (Check_Infinite_Loop_Warning): Use Has_Condition_Actions to determine whether a loop has meaningful condition actions. (Has_Condition_Actions): New routine. * sinfo.adb (ABE_Is_Certain): Removed. (Is_Declaration_Level_Node): New routine. (Is_Dispatching_Call): New routine. (Is_Elaboration_Checks_OK_Node): New routine. (Is_Initialization_Block): New routine. (Is_Known_Guaranteed_ABE): New routine. (Is_Recorded_Scenario): New routine. (Is_Source_Call): New routine. (Is_SPARK_Mode_On_Node): New routine. (No_Elaboration_Check): Removed. (Target): New routine. (Was_Attribute_Reference): New routine. (Set_ABE_Is_Certain): Removed. (Set_Is_Declaration_Level_Node): New routine. (Set_Is_Dispatching_Call): New routine. (Set_Is_Elaboration_Checks_OK_Node): New routine. (Set_Is_Initialization_Block): New routine. (Set_Is_Known_Guaranteed_ABE): New routine. (Set_Is_Recorded_Scenario): New routine. (Set_Is_Source_Call): New routine. (Set_Is_SPARK_Mode_On_Node): New routine. (Set_No_Elaboration_Check): Removed. (Set_Target): New routine. (Set_Was_Attribute_Reference): New routine. * sinfo.ads: Remove attribute ABE_Is_Certain. Attribute Do_Discriminant_Check now utilizes Flag3. Attribute No_Side_Effect_Removal now utilizes Flag17. Add new node N_Call_Marker. Update the structure of various nodes. (ABE_Is_Certain): Removed along with pragma Inline. (Is_Declaration_Level_Node): New routine along with pragma Inline. (Is_Dispatching_Call): New routine along with pragma Inline. (Is_Elaboration_Checks_OK_Node): New routine along with pragma Inline. (Is_Initialization_Block): New routine along with pragma Inline. (Is_Known_Guaranteed_ABE): New routine along with pragma Inline. (Is_Recorded_Scenario): New routine along with pragma Inline. (Is_Source_Call): New routine along with pragma Inline. (Is_SPARK_Mode_On_Node): New routine along with pragma Inline. (No_Elaboration_Check): Removed along with pragma Inline. (Target): New routine along with pragma Inline. (Was_Attribute_Reference): New routine along with pragma Inline. (Set_ABE_Is_Certain): Removed along with pragma Inline. (Set_Is_Declaration_Level_Node): New routine along with pragma Inline. (Set_Is_Dispatching_Call): New routine along with pragma Inline. (Set_Is_Elaboration_Checks_OK_Node): New routine along with pragma Inline. (Set_Is_Initialization_Block): New routine along with pragma Inline. (Set_Is_Known_Guaranteed_ABE): New routine along with pragma Inline. (Set_Is_Recorded_Scenario): New routine along with pragma Inline. (Set_Is_Source_Call): New routine along with pragma Inline. (Set_Is_SPARK_Mode_On_Node): New routine along with pragma Inline. (Set_No_Elaboration_Check): Removed along with pragma Inline. (Set_Target): New routine along with pragma Inline. (Set_Was_Attribute_Reference): New routine along with pragma Inline. * sprint.adb (Sprint_Node_Actual): Add an entry for N_Call_Marker. From-SVN: r253559
2017-09-29[multiple changes]Pierre-Marie de Rodat1-1/+1
2017-09-29 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Call_Helper): Replace with code more similar to what we had before. (Make_Build_In_Place_Call_In_Object_Declaration): Back out previous change. Set the Etype in the class-wide case. This fixes a regression in the libadalang test suite. 2017-09-29 Joel Brobecker <brobecker@adacore.com> * doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/the_gnat_compilation_model.rst: Avoid use of single colon in comment markup. * gnat_ugn.texi: Regenerate. 2017-09-29 Justin Squirek <squirek@adacore.com> * ali-util.adb, comperr.adb, cprint.adb, errout.adb, fmap.adb, fname-sf.adb, frontend.adb, lib-xref-spark_specific.adb, gnat1drv.adb, gnatls.adb, lib.adb, lib-load.adb, lib-writ.adb, prepcomp.adb, sinput-d.adb, sinput-l.adb, sprint.adb, targparm.adb: Update comparison for checking source file status and error message and/or call to Read_Source_File. * libgnat/s-os_lib.ads: Add new potential value constant for uninitialized file descriptors. * osint.adb, osint.ads (Read_Source_File): Add extra parameter to return result of IO to encompass a read access failure in addition to a file-not-found error. From-SVN: r253294
2017-04-27[multiple changes]Arnaud Charlet1-10/+34
2017-04-27 Eric Botcazou <ebotcazou@adacore.com> * fe.h (Warn_On_Questionable_Layout): Declare. * warnsw.ads (Warn_On_Record_Holes): Move down. (Warn_On_Questionable_Layout): New boolean variable. (Warning_Record): Add Warn_On_Questionable_Layout field. * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout. (Restore_Warnings): Likewise. (Save_Warnings): Likewise. (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters. * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to components_to_record. (gnu_field_to_gnat): New function. (warn_on_field_placement): Likewise. (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER parameters. Rename local variables and adjust recursive call. Rework final scan of the field list and implement warnings on the problematic placement of specific sorts of fields. 2017-04-27 Bob Duff <duff@adacore.com> * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb, * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb, * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb, * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb, * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb, * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb: For efficiency, cache results of Is_Internal_File_Name and Is_Predefined_File_Name in the Units table. This avoids a lot of repeated text processing. 2017-04-27 Emmanuel Briot <briot@adacore.com> * g-comlin.adb (Sort_Sections): remove useless test. 2017-04-27 Claire Dross <dross@adacore.com> * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to allow the use of regular equality over elements in contracts. (Formal_Model): Ghost package containing model functions that are used in subprogram contracts. (Current_To_Last): Removed, model functions should be used instead. (First_To_Previous): Removed, model functions should be used instead. (Strict_Equal): Removed, model functions should be used instead. (No_Overlap): Removed, model functions should be used instead. (Equivalent_Keys): Functions over cursors are removed. They were awkward with explicit container parameters. * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to allow the use of regular equality over elements in contracts. (Formal_Model): Ghost package containing model functions that are used in subprogram contracts. (Current_To_Last): Removed, model functions should be used instead. (First_To_Previous): Removed, model functions should be used instead. (Strict_Equal): Removed, model functions should be used instead. (No_Overlap): Removed, model functions should be used instead. 2017-04-27 Yannick Moy <moy@adacore.com> * gnat1drv.adb: Code cleanup. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Replace_Entity): The prefix of a 'Result attribute reference in a post- condition is the subprogram to which the condition applies. If the condition is inherited by a type extension, the prefix becomes a reference to the inherited operation, but there is no need to create a wrapper for this operation, because 'Result is expanded independently when elaborating the postconditions. From-SVN: r247338
2017-04-27[multiple changes]Arnaud Charlet1-4/+4
2017-04-27 Bob Duff <duff@adacore.com> * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that can reallocate. * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb, * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb: Reorder code so that above assertions do not fail. * table.ads: Remove obsolete comment on Locked. 2017-04-27 Claire Dross <dross@adacore.com> * a-cfdlli.ads: Code cleanup. 2017-04-27 Yannick Moy <moy@adacore.com> * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure when needed for proof. (Expand_SPARK): Call the new procedure. * exp_util.ads Fix typo. 2017-04-27 Gary Dismukes <dismukes@adacore.com> * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo fixes. From-SVN: r247323
2017-04-25Minor reformatting.Arnaud Charlet1-0/+1
From-SVN: r247164
2017-04-25[multiple changes]Arnaud Charlet1-0/+16
2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * a-numaux.ads: Fix description of a-numaux-darwin and a-numaux-x86. (Double): Define to Long_Float. * a-numaux-vxworks.ads (Double): Likewise. * a-numaux-darwin.ads (Double): Likewise. * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float. * a-numaux-x86.ads: Fix package description. * a-numaux-x86.adb (Is_Nan): Minor tweak. (Reduce): Adjust and complete description. Call Is_Nan instead of testing manually. Use an integer temporary to hold rounded value. * a-numaux-darwin.adb (Reduce): Likewise. (Is_Nan): New function. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Additional refinement on analysis of prefix whose type is a current instance of a synchronized type, but where the prefix itself is an entity that is an object. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve the identity of callable entities therein, because they have been properly resolved, and prefixed calls may have been rewritten as normal calls. 2017-04-25 Patrick Bernardi <bernardi@adacore.com> * exp_ch3.adb (Build_Init_Statements): Convert the expression of the pragma/aspect Secondary_Stack_Size to internal type System.Parameters.Size_Type before assigning it to the Secondary_Stack_Size component of the task type's corresponding record. 2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc) optimizations when the type is modular and the offsets are equal. 2017-04-25 Eric Botcazou <ebotcazou@adacore.com> * s-osinte-freebsd.ads: Minor comment tweaks 2017-04-25 Javier Miranda <miranda@adacore.com> * urealp.adb (UR_Write): Reverse previous patch adding documentation on why we generate multiplications instead of divisions (needed to avoid expressions whose computation with large numbers may cause division by 0). 2017-04-25 Bob Duff <duff@adacore.com> * erroutc.adb (Set_Specific_Warning_Off, Set_Warnings_Mode_Off): Use the correct source file for Stop. Was using Current_Source_File, which is only valid during parsing. Current_Source_File will have a leftover value from whatever file happened to be parsed last, because of a with_clause or something. 2017-04-25 Bob Duff <duff@adacore.com> * lib.ads, lib.adb (In_Internal_Unit): New functions similar to In_Predefined_Unit, but including GNAT units. * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem, because Should_Ignore_Pragma was not working reliably outside the parser, because Current_Source_File is not valid. * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem. * par-prag.adb: Call Should_Ignore_Pragma_Par. From-SVN: r247162
2016-07-06[multiple changes]Arnaud Charlet1-1/+8
2016-07-06 Arnaud Charlet <charlet@adacore.com> * lib.adb (Check_Same_Extended_Unit): Complete previous change. * sem_intr.adb (Errint): New parameter Relaxed. Refine previous change to only disable errors selectively. * sem_util.adb: minor style fix in object declaration 2016-07-06 Yannick Moy <moy@adacore.com> * sem_warn.adb (Check_Infinite_Loop_Warning.Find_Var): Special case a call to a volatile function, so that it does not lead to a warning in that case. 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch12.adb, sem_ch4.adb, sem_ch6.adb: Minor reformatting. 2016-07-06 Hristian Kirtchev <kirtchev@adacore.com> * gnat1drv.adb: Code clean up. Do not emit any code generation errors when the unit is ignored Ghost. 2016-07-06 Ed Schonberg <schonberg@adacore.com> * sem_eval.adb (Check_Non_Static_Context): If the expression is a real literal of a floating point type that is part of a larger expression and is not a static expression, transform it into a machine number now so that the rest of the computation, even if other components are static, is not evaluated with extra precision. 2016-07-06 Javier Miranda <miranda@adacore.com> * sem_ch13.adb (Freeze_Entity_Checks): Undo previous patch and move the needed functionality to Analyze_Freeze_Generic_Entity. (Analyze_Freeze_Generic_Entity): If the entity is not already frozen and has delayed aspects then analyze them. 2016-07-06 Yannick Moy <moy@adacore.com> * sem_prag.adb (Analyze_Pragma.Process_Inline.Set_Inline_Flags): Special case for unanalyzed body entity of ghost expression function. From-SVN: r238050
2016-07-06[multiple changes]Arnaud Charlet1-13/+24
2016-07-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb, sem_attr.adb, sem_ch13.adb: Minor reformatting. 2016-07-06 Arnaud Charlet <charlet@adacore.com> * lib.adb (Check_Same_Extended_Unit): Prevent looping forever. * gnatbind.adb: Disable some consistency checks in codepeer mode, which are not needed. 2016-07-06 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Check_Fixed_Point_Actual): Add a warning when a formal fixed point type is instantiated with a type that has a user-defined arithmetic operations, but the generic has no corresponding formal functions. This is worth a warning because of the special semantics of fixed-point operators. From-SVN: r238043
2016-06-14[multiple changes]Arnaud Charlet1-11/+19
2016-06-14 Hristian Kirtchev <kirtchev@adacore.com> * lib.adb: Minor reformatting. * sem_util.adb (Is_OK_Volatile_Context): Do include Address in the supported attributes. 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_N_Case_Expression): Code cleanup. Finalize any transient controlled objects on exit from a case expression alternative. (Expand_N_If_Expression): Code cleanup. (Process_Actions): Removed. (Process_If_Case_Statements): New routine. (Process_Transient_Object): Change the name of formal Rel_Node to N and update all occurrences. Update the comment on usage. When the type of the context is Boolean, the proper insertion point for the finalization call is after the last declaration. 2016-06-14 Ed Schonberg <schonberg@adacore.com> * lib-xref.ads, lib-xref.adb (Has_Deferred_Reference): new predicate to determine whether an entity appears in a context for which a Deferred_Reference was created, because it is not possible to determine when reference is analyzed whether it appears in a context in which the entity is modified. * sem_ch5.adb (Analyze_Statement): Do not emit a useless warning on assignment for an entity that has a deferred_reference. 2016-06-14 Javier Miranda <miranda@adacore.com> * sem_res.adb (Resolve_Actuals): Generate a reference to actuals that come from source. Previously the reference was generated only if the call comes from source but the call may be rewritten by the expander thus causing the notification of spurious warnings. 2016-06-14 Arnaud Charlet <charlet@adacore.com> * gnat1drv.adb: Remove further references to AAMP. * checks.adb (Apply_Scalar_Range_Check): Take Check_Float_Overflow info account. * live.ads, live.adb Added subprogram headers and start-of-processing-for comments. * sem_ch12.adb (Instantiate_Package_Body): Do not suppress checks when instantiating runtime units in CodePeer mode. From-SVN: r237432
2016-06-14[multiple changes]Arnaud Charlet1-7/+44
2016-06-14 Arnaud Charlet <charlet@adacore.com> * exp_ch3.adb (Expand_N_Object_Declaration): Only consider nodes from sources. 2016-06-14 Arnaud Charlet <charlet@adacore.com> * switch-c.adb, gnat1drv.adb (Adjust_Global_Switches): Only disable simple value propagation in CodePeer mode when warnings are disabled. (Scan_Front_End_Switches): Enable relevant front-end switches when using -gnateC. 2016-06-14 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (Is_OK_Volatile_Context): A reference to a volatile object is considered OK if appears as the prefix of attributes Address, Alignment, Component_Size, First_Bit, Last_Bit, Position, Size, Storage_Size. 2016-06-14 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (Add_SPARK_File): Do not traverse subunits directly, as they are already traversed as part of the top-level unit to which they belong. (Add_SPARK_Xrefs): Add assertions to ensure correct sorting. (Generate_Dereference): Use unique definition place for special variable __HEAP, to ensure correct sorting of references. * lib-xref.adb (Generate_Reference): Use top-level unit in case of subunits. * lib.adb, lib.ads (Get_Top_Level_Code_Unit): New functions that compute the top-level code unit for a source location of AST node, that go past subunits. From-SVN: r237431
2015-02-05015-02-05 Robert Dewar <dewar@adacore.com>Arnaud Charlet1-4/+4
* sem_ch13.adb (Add_Invariants): Don't assume invariant is standard Boolean. * sem_prag.adb (Analyze_Pragma, case Check): Don't assume condition is standard Boolean, it can be non-standard derived Boolean. 2015-02-05 Robert Dewar <dewar@adacore.com> * checks.adb (Enable_Range_Check): Disconnect attempted optimization for the case of range check for subscript of unconstrained array. 2015-02-05 Robert Dewar <dewar@adacore.com> * par-ch13.adb (With_Present): New function (Aspect_Specifications_Present): Handle WHEN in place of WITH (Get_Aspect_Specifications): Comment update. * par.adb: Comment updates. 2015-02-05 Robert Dewar <dewar@adacore.com> * errout.adb (Handle_Serious_Error): New setting of Fatal_Error. * frontend.adb (Frontend): New setting of Fatal_Error. * lib-load.adb (Create_Dummy_Package_Unit): New setting of Fatal_Error. (Load_Main_Source): New setting of Fatal_Error (Load_Unit): New setting of Fatal_Error. * lib-writ.adb (Add_Preprocessing_Dependency): New setting of Fatal_Error. (Ensure_System_Dependency): New setting of Fatal_Error. * lib.adb (Fatal_Error): New setting of Fatal_Error (Set_Fatal_Error): New setting of Fatal_Error. * lib.ads: New definition of Fatal_Error and associated routines. * par-ch10.adb (P_Compilation_Unit): New setting of Fatal_Error. * par-load.adb (Load): New setting of Fatal_Error. * rtsfind.adb (Load_RTU): New setting of Fatal_Error. * sem_ch10.adb (Analyze_Compilation_Unit): New setting of Fatal_Error. (Optional_Subunit): New setting of Fatal_Error. (Analyze_Proper_Body): New setting of Fatal_Error. (Load_Needed_Body): New setting of Fatal_Error. 2015-02-05 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Call): If the function being called has out parameters do not check for language version if the function comes from a predefined unit, as those are always compiled in Ada 2012 mode. 2015-02-05 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Process_Full_View): Verify that the full view of a type extension must carry an explicit limited keyword if the partial view does (RM 7.3 (10.1)). From-SVN: r220446
2014-08-01[multiple changes]Arnaud Charlet1-6/+9
2014-08-01 Eric Botcazou <ebotcazou@adacore.com> * sem_ch7.adb: Fix minor oversight in condition. 2014-08-01 Bob Duff <duff@adacore.com> * projects.texi: Minor documentation improvements. 2014-08-01 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add aspect No_Elaboration_Code_All. * gnat_rm.texi: Document No_Elaboration_Code_All pragma and aspect. * lib-load.adb: Initialize No_Elab_Code_All field. * lib-writ.adb: Initialize No_Elab_Code_All. * lib.ads, lib.adb: New field No_Elab_Code_All. * par-prag.adb: Add dummy entry for pragma No_Elaboration_Code_All. * restrict.ads, restrict.adb: Restriction No_Elaboration_Code_All no longer exists. * sem_ch10.adb (Analyze_Context): Processing for No_Elaboration_Code_All removed. (Generate_Parent_References): Moved to Sem_Util. * sem_prag.adb: Add processing for pragma No_Elaboration_Code_All. * sem_util.ads, sem_util.adb (Get_Parent_Entity): Moved here from Sem_Ch10. * snames.ads-tmpl: Add entry for pragma No_Elaboration_Code_All. * targparm.adb: Minor comment updates Add comments on ignoring pragma No_Elaboration_Code_All. 2014-08-01 Nicolas Roche <roche@adacore.com> * adaint.c (__gnat_set_close_on_exec): Ensure that we can unset "close_on_exec" flag. 2014-08-01 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Build_Wrapper_Spec, Replicate_Formals): When building the parameter specs of the wrapper program for a primitive operation of a synchronized type that implements an interface, copy the null_exclusion indicator as well. 2014-08-01 Robert Dewar <dewar@adacore.com> * sem_eval.ads: Minor reformatting. From-SVN: r213466
2014-07-31[multiple changes]Arnaud Charlet1-0/+10
2014-07-31 Vincent Celier <celier@adacore.com> * projects.texi: Minor spelling error fix. 2014-07-31 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Document No_Elaboration_Code_All restriction. * lib-writ.adb, lib-load.adb: Initialize No_Elab_Code field in unit information. * lib.ads, lib.adb (No_Elab_Code): New field in unit information. * restrict.adb (Process_Restriction_Synonyms): Add handling of No_Elaboration_Code_All. * restrict.ads (Process_Restriction_Synonyms): Now handles No_Elaboration_Code_All. * sem_ch10.adb (Analyze_Context): Enforce transitive with for No_Elaboration_Code_All. * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Handle setting of No_Elab_Code in unit information. Handle No_Elaboration_Code_All. * snames.ads-tmpl (Name_No_Elaboration_Code): New name for pragma processing. (Name_No_Elaboration_Code_All): New name for pragma processing. 2014-07-31 Eric Botcazou <ebotcazou@adacore.com> * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Reject array types with a null range and use the Esize of the component instead of its RM_Size to identify appropriate values. 2014-07-31 Hristian Kirtchev <kirtchev@adacore.com> * freeze.adb Add with and use clause for Aspects. (Freeze_Expression): Emit an error when a volatile constant lacks Boolean aspect Import. (Has_Boolean_Aspect_Import): New routine. From-SVN: r213347
2014-07-30[multiple changes]Arnaud Charlet1-0/+1
2014-07-30 Thomas Quinot <quinot@adacore.com> * lib-writ.ads: document format change. 2014-07-30 Pascal Obry <obry@adacore.com> * prj-util.adb (For_Interface_Sources): Do not include sources from withed externally built projects. 2014-07-30 Robert Dewar <dewar@adacore.com> * lib.adb: Minor reformatting. * prj-util.adb: Minor reformatting. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Build_Record_Aggr_Code): For an array component that depends on discriminants, and which is given by an others clause, create an explicit subtype with the discriminant values of the enclosing aggregate, because the backend cannot otherwise retrieve the actual bounds of the array. 2014-07-30 Fedor Rybin <frybin@adacore.com> * gnat_ugn.texi: Improve gnattest documentation. 2014-07-30 Pascal Obry <obry@adacore.com> * makeutl.adb (Insert_Project_Sources): Properly handle sources that are aggregated. We want to include sources not only part of libraries but also if part of an aggregated project from an aggregate library. * prj.adb (For_Project_And_Aggregated_Context): Properly check state of root project. From-SVN: r213296
2014-07-30lib-load.ads: Minor reformatting.Thomas Quinot1-1/+9
2014-07-30 Thomas Quinot <quinot@adacore.com> * lib-load.ads: Minor reformatting. * sinfo.ads (Library_Unit): Update comment. * lib.ads (Notes): Simplify. The Unit component in Notes_Entry is redundant. Instead used the pragma Node_Id directly as the element type. 2014-07-30 Thomas Quinot <quinot@adacore.com> * lib.adb (Store_Note): Store only notes that do not come from an instance, and that are in the extended main source unit. * lib-writ (Write_Unit_Information): Annotations from subunits must be emitted along with those for the main unit, and they must carry a specific file name. * ali.ads (Notes_Record): Use a File_Name_Type instead of a Unit_Id for the source file containing the pragma, as in the case of annotations from subunits we might not have a readily available unit id. * ali.adb (Scan_ALI): Account for above change in data structure. From-SVN: r213295
2014-07-18[multiple changes]Arnaud Charlet1-10/+0
2014-07-18 Robert Dewar <dewar@adacore.com> * bcheck.adb (Check_Consistent_Restrictions): Remove obsolete code checking for violation of No_Standard_Allocators_After_Elaboration (main program) * bindgen.adb (Gen_Adainit): Handle No_Standard_Allocators_After_Elaboration (Gen_Output_File_Ada): ditto. * exp_ch4.adb (Expand_N_Allocator): Handle No_Standard_Allocators_After_Elaboration. * Makefile.rtl: Add entry for s-elaall * rtsfind.ads: Add entry for Check_Standard_Allocator. * s-elaall.ads, s-elaall.adb: New files. * sem_ch4.adb (Analyze_Allocator): Handle No_Standard_Allocators_After_Elaboration. 2014-07-18 Robert Dewar <dewar@adacore.com> * lib.adb, lib.ads, lib-writ.adb, lib-writ.ads, ali.adb, ali.ads, lib-load.adb: Remove Lib.Has_Allocator and all uses. Remove AB parameter from ali files and all uses. Remove Allocator_In_Body and all uses. 2014-07-18 Robert Dewar <dewar@adacore.com> * g-expect-vms.adb: Add comment. 2014-07-18 Thomas Quinot <quinot@adacore.com> * par_sco.adb (Is_Logical_Operation): return True for N_If_Expression. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Resolve_Attribute, case 'Update): Do full analysis and resolution of each choice in the associations within the argument of Update, because they may be variable names. 2014-07-18 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Expand_Loop_Entry_Attribute): Insert any condition actions before the generated if statement. 2014-07-18 Hristian Kirtchev <kirtchev@adacore.com> * gnat_ugn.texi Enhance the documentation of switches -gnateA and -gnateV. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Build_Default_Subtype): Add missing condition so that code matches description: use the full view of the base only if the base is private and the subtype is not. From-SVN: r212779
2014-06-13lib.ads, [...] (Is_Compiler_Unit): Removed.Robert Dewar1-14/+1
2014-06-13 Robert Dewar <dewar@adacore.com> * lib.ads, lib.adb, lib-writ.adb, lib-load.adb (Is_Compiler_Unit): Removed. * opt.ads (Compiler_Unit): New flag. * par-ch5.adb (Test_Statement_Required): Call Check_Compiler_Unit for null statement sequence (not allowed in compiler unit). * par-prag.adb (Prag): Handle Compiler_Unit[_Warning] during parsing. * restrict.ads, restrict.adb (Check_Compiler_Unit): New version and new calling sequence. * sem_ch11.adb, sem_ch3.adb, sem_ch4.adb: New calling sequence for Check_Compiler_Unit. * sem_ch6.adb (Analyze_Extended_Return_Statement): Call Check_Compiler_Unit (this construct is not allowed in compiler units). * sem_prag.adb (Analyze_Pragma, case Compiler_Unit[_Warning]): Set Opt.Compiler_Unit. From-SVN: r211617
2014-01-22[multiple changes]Arnaud Charlet1-4/+4
2014-01-22 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): A subprogram body generated for an expression function within a protected body needs a set of renaming declarations if the expression function comes from source. 2014-01-22 Ed Schonberg <schonberg@adacore.com> * lib-xref.adb (Get_Type_Reference): In semantics-only mode, list interface progenitor of a tagged concurrent type, for better source navigation. 2014-01-22 Robert Dewar <dewar@adacore.com> * lib.adb (In_Extended_Main_Code_Unit): Return False for Standard_Location. (In_Extended_Main_Source_Unit): Return False for Standard_Location. * lib.ads (In_Extended_Main_Code_Unit): Add documentation on treatment of Slocs No_Location and Standard_Location. * restrict.adb (Check_Restriction_No_Dependence): Explicitly check for entity with Standard_Location Sloc, rather than relying on Lib routines to do that. * sem_res.adb (Resolve_Call): Implement SPARK_05 restriction that a call cannot occur before a later occuring body within the same unit. From-SVN: r206931
2014-01-21[multiple changes]Arnaud Charlet1-10/+0
2014-01-21 Robert Dewar <dewar@adacore.com> * exp_aggr.adb: Minor reformatting. 2014-01-21 Johannes Kanig <kanig@adacore.com> * gnat1drv.adb (Gnat1drv) remove obsolete reference to -gnatd.H. 2014-01-21 Bob Duff <duff@adacore.com> * gnat_ugn.texi: Document the "checks" attribute in gnat2xml. 2014-01-21 Steve Baird <baird@adacore.com> * gnat_rm.texi: Improve description of SPARK_Mode pragma. 2014-01-21 Vincent Celier <celier@adacore.com> * prj-part.adb (Parse_Single_Project): Accept to extend a project if it has only be imported by an project being extended. When a project that has only been imported by a project being extended is imported by another project that is not being extended, reset the previous indication, so that it will be an error if this project is extended later. * prj-tree.adb (Create_Project): Include component From_Extended in table Projects_HT * prj-tree.ads (Project_Name_And_Node): New Boolean component From_Extended 2014-01-21 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb: Add Node33 and Set_Node33. * einfo.ads, einfo.adb (SPARK_Pragma): New field (SPARK_Aux_Pragma): New field (SPARK_Pragma_Inherited): New flag (SPARK_Aux_Pragma_Inherited): New flag (SPARK_Mode_Pragmas): Removed. * lib.ads, lib.adb: Remove SPARK_Mode_Pragma, no longer used. * opt.ads (SPARK_Mode_Pragma): New global variable. * sem.ads: Add Save_SPARK_Mode_Pragma field to Scope_Stack_Entry. * sem_ch3.adb: Use new SPARK_Mode data structures. * sem_ch6.adb: Set SPARK_Mode fields in subprogram specs and bodies. * sem_ch7.adb: Set SPARK_Mode fields in package spec and body entities. * sem_ch8.adb (Push_Scope): Save SPARK_Mode_Pragma. (Pop_Scope): Restore SPARK_Mode_Pragma. * sem_prag.adb (Analyze_Pragma, case SPARK_Mode): Rewrite for new data structures. 2014-01-21 Arnaud Charlet <charlet@adacore.com> * back_end.adb: Undo previous change, not needed. Minor reformatting. From-SVN: r206879
2013-07-05aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect.Hristian Kirtchev1-1/+11
2013-07-05 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect. * aspects.ads: Add an entry for SPARK_Mode in tables Aspect_Id, Aspect_Argument, Aspect_Names. * atree.adb (Node32): New routine. (Set_Node32): New routine. * atree.ads (Node32): New routine. (Set_Node32): New routine. * einfo.adb: Node32 is now used as SPARK_Mode_Pragmas. (Set_SPARK_Mode_Pragmas): New routine. (SPARK_Mode_Pragmas): New routine. (Write_Field32_Name): Add and entry for SPARK_Modes. * einfo.ads: Add attribute SPARK_Mode_Pragmas along with usage in various entities. (Set_SPARK_Mode_Pragmas): New routine and pragma Inline. (SPARK_Mode_Pragmas): New routine and pragma Inline. * gnat_rm.texi: Add sections explaining the syntax and semantics of aspect/pragma SPARK_Mode. * gnat_ugn.texi: Add pragma SPARK_Mode to the list of configuration pragmas. * lib.adb (Set_SPARK_Mode_Pragma): New routine. (SPARK_Mode_Pragma): New routine. * lib.ads: Alphabetize the comments on fields of record Unit_Record. Add new field SPARK_Mode_Pragma along with comment on its usage. Update the layout of record Unit_Record. (Set_SPARK_Mode_Pragma): New routine and pragma Inline. (SPARK_Mode_Pragma): New routine and pragma Inline. * lib-load.adb (Create_Dummy_Package_Unit): Initialize field SPARK_Mode_Pragma. (Load_Main_Source): Initialize field SPARK_Mode_Pragma. (Load_Unit): Initialize field SPARK_Mode_Pragma. * lib-writ.adb (Add_Preprocessing_Dependency): Initialize field SPARK_Mode_Pragma. (Ensure_System_Dependency): Initialize field SPARK_Mode_Pragma. * opt.ads: Alphabetize verification flags. Store the compilation-wide SPARK mode in variable Global_SPARK_Mode. * par-prag.adb: Pragma SPARK_Mode does not need special processing by the parser. * sem_ch13.adb (Analyze_Aspect_Specifications): Convert aspect SPARK_Mode into a pragma. (Check_Aspect_At_Freeze_Point): Aspect SPARK_Mode does not need delayed processing. * sem_prag.adb: Add an entry for SPARK_Mode in table Sig_Flags. (Analyze_Pragma): Add processing for pragma SPARK_Mode. (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sem_prag.ads (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sinfo.ads: Update the comment on the usage of field Next_Pragma. * snames.ads-tmpl: Add new predefined name for SPARK_Mode and Auto. Add new pragma Id for SPARK_Mode. * types.ads: Add new type SPARK_Mode_Id. From-SVN: r200711
2012-06-14[multiple changes]Arnaud Charlet1-1/+80
2012-06-14 Robert Dewar <dewar@adacore.com> * 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. From-SVN: r188609
2011-09-05[multiple changes]Arnaud Charlet1-32/+31
2011-09-05 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): If the expression function comes from source, indicate that so does its rewriting, so it is compatible with any subsequent expansion of the subprogram body (e.g. when it is a protected operation). * sem_ch4.adb: minor reformatting 2011-09-05 Hristian Kirtchev <kirtchev@adacore.com> * lib.adb (Check_Same_Extended_Unit): Comment rewriting. Use Get_Source_Unit rather than Get_Code_Unit as instantiation unfolding may lead to wrong ancestor package in the case of instantiated subunit bodies. If a subunit is instantiated, follow the chain of instantiations rather than the stub structure. From-SVN: r178530
2011-08-03[multiple changes]Arnaud Charlet1-11/+69
2011-08-03 Eric Botcazou <ebotcazou@adacore.com> * gnat_ugn.texi: Document -Wstack-usage. * gcc-interface/misc.c (enumerate_modes): Add guard for ghost FP modes. 2011-08-03 Thomas Quinot <quinot@adacore.com> * sem_prag.adb Issue an error (not a warning) when a C++ type does not have keyword LIMITED. 2011-08-03 Yannick Moy <moy@adacore.com> * alfa.adb, alfa.ads, alfa_test.adb: New files. * ali.adb (Known_ALI_Lines): add 'C' lines (SCO) and 'F' lines (ALFA) (Scan_ALI): do not issue a fatal error if parsing known lines after Xref section (does not happen in compiler, only if code directly calls Scan_ALI). * get_alfa.adb, get_alfa.ads: New files. * lib-writ.adb, lib-writ.ads (Write_ALI): output ALFA information if needed. * lib-xref-alfa.adb: New file. * lib-xref.adb, lib-xref.ads (Xref_Entry): redefine information needed in cross-references for ALFA. Push ALFA treatments in separated local package. (Enclosing_Subpragram_Or_Package): treat specially subprogram identifiers. Return entity of package body instead of spec. Return Empty for a scope with no location. (Generate_Reference): adapt to new components for ALFA information. Remove the need for D references on definitions. (Is_Local_Reference): moved to ALFA local package (Output_References): extract subfunction as Extract_Source_Name (Output_Local_References): remove procedure, replaced by filtering of cross-references in package ALFA and printing in Put_ALFA. (Write_Entity_Name): remove procedure * lib.adb, lib.ads (Extract_Source_Name): extract here function to print exact name of entity as it appears in source file (Unit_Ref_Table): make type public for use in Lib.Xref.ALFA * put_alfa.adb, put_alfa.ads: New files. * xref_lib.adb (Search_Xref): protect read of cross-references against reading other sections of the ALI file, in gnatxref (Search): protect read of cross-references against reading other sections of the ALI file, in gnatfind. * gcc-interface/Make-lang.in: Update dependencies. 2011-08-03 Thomas Quinot <quinot@adacore.com> * sem_ch3.adb: Minor reformatting. 2011-08-03 Jose Ruiz <ruiz@adacore.com> * s-inmaop-vxworks.adb (Setup_Interrupt_Mask): Do nothing instead of raising an exception. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Set_String_Literal_Subtype): if index type is an integer type, always use 1 as the lower bound or string, even if lower bound of context is not static, to handle properly null strings in a non-static context. 2011-08-03 Bob Duff <duff@adacore.com> * sem_prag.adb (Resolve_Aggregate): An array aggregate with 'others' is always legal on the right-hand side of an assignment statement; there is always an applicable index constraint in this case. Therefore, the check for Pkind = N_Assignment_Statement is now unconditional -- it doesn't depend on whether Is_Constrained (Typ). From-SVN: r177239
2010-10-18[multiple changes]Arnaud Charlet1-0/+10
2010-10-18 Jose Ruiz <ruiz@adacore.com> * exp_ch9.adb (Expand_N_Task_Type_Declaration): Add field corresponding to the affinity when expanding the task declaration. (Make_Task_Create_Call): Add the affinity parameter to the call to create task. * sem_prag.adb (Analyze_Pragma): Add the analysis for pragma CPU, taking into account the case when it applies to a subprogram (only for main and with static expression) or to a task. * par_prag.adb:(Prag): Make pragma CPU a valid one. * snames.ads-tmpl (Name_uCPU, Name_CPU): Add these new name identifiers used by the expander for handling the affinity parameter when creating a task. (Pragma_Id): Add Pragma_CPU as a valid one. * rtsfind.ads (RTU_Id): Make System_Multiprocessors accesible. (RE_Id, RE_Unit_Table): Make the entities RE_CPU_Range and RE_Unspecified_CPU visible. * sinfo.ads, sinfo.adb (Has_Pragma_CPU, Set_Has_Pragma_CPU): Add these two subprograms to set/get the flag indicating whether there is a pragma CPU which applies to the entity. * lib.ads, lib.adb (Unit_Record, Default_Main_CPU, Main_CPU, Set_Main_CPU): Add the field Main_CPU to Unit_Record to store the value of the affinity associated to the main subprogram (if any). Default_Main_CPU is used when no affinity is set. Subprograms Set_Main_CPU and Main_CPU are added to set/get the affinity of the main subprogram. * ali.ads, ali.adb (ALIs_Record): Add field Main_CPU to contain the value of the affinity of the main subprogram. (Scan_ALI): Get the affinity of the main subprogram (encoded as C=XX in the M line). * lib-writ.ads, lib-writ.adb (M_Parameters): Encode the affinity of the main subprogram in the M (main) line using C=XX. * lib-load.adb (Create_Dummy_Package_Unit, Load_Main_Source, Load_Unit): Add new field Main_CPU. * bindgen.adb (Gen_Adainit_Ada, Gen_Adainit_C): Add the code to pass the affinity of the main subprogram to the run time. * s-taskin.ads (Common_ATCB): Add the field Base_CPU to store the affinity. (Unspecified_CPU): Add this constant to identify the case when no affinity is set for tasks. * s-taskin.adb (Initialize_ATCB): Store the value coming from pragma CPU in the common part of the ATCB. (Initialize): Store the value coming from pragma CPU (for the environment task) in the common part of the ATCB. * s-tassta.ads, s-tassta.adb (Create_Task): Add the affinity specified by pragma CPU to the ATCB. * s-tarest.ads, s-tarest.adb (Create_Restricted_Task): Add the affinity specified by pragma CPU to the ATCB. * s-tporft.adb (Register_Foreign_Thread): Add the new affinity parameter to the call to Initialize_ATCB. * s-taprop-linux.adb (Create_Task): Change the attributes of the thread to include the task affinity before creation. Additionally, the affinity selected with Task_Info is also enforced changing the attributes at task creation time, instead of changing it after creation. (Initialize): Change the affinity of the environment task if required by a pragma CPU. * s-osinte-linux.ads (pthread_setaffinity_np): Instead of using a wrapper to check whether the function is available or not, use a weak symbol. (pthread_attr_setaffinity_np): Add the import of this function which is used to change the affinity in the attributes used to create a thread. * adaint.c (__gnat_pthread_attr_setaffinity_np): Remove this wrapper. It was used to check whether the pthread function was available or not, but the use of a weak symbol handles this situation in a cleaner way. * s-taprop-mingw.adb (Create_Task, Initialize): Change the affinity of tasks (including the environment task) if required by a pragma CPU. * s-taprop-solaris.adb (Enter_Task): Change the affinity of tasks (including the environment task) if required by a pragma CPU. * s-taprop-vxworks.adb (Create_Task, Initialize): Change the affinity of tasks (including the environment task) if required by a pragma CPU. * init.c (__gl_main_cpu): Make this value visible to the run time. It will pass the affinity of the environment task. 2010-10-18 Javier Miranda <miranda@adacore.com> * einfo.adb (Direct_Primitive_Operations): Complete assertion. From-SVN: r165625
2010-10-08ali.adb: Set Allocator_In_Body if AB parameter present on M lineRobert Dewar1-0/+10
2010-10-08 Robert Dewar <dewar@adacore.com> * ali.adb: Set Allocator_In_Body if AB parameter present on M line * ali.ads (Allocator_In_Body): New flag * bcheck.adb (Check_Consistent_Restrictions): Handle case of main program violating No_Allocators_After_Elaboration restriction. * gnatbind.adb (No_Restriction_List): Add entries for No_Anonymous_Allocators, and No_Allocators_After_Elaboration. * lib-load.adb: Initialize Has_Allocator flag * lib-writ.adb: Initialize Has_Allocator flag (M_Parameters): Set AB switch if Has_Allocator flag set * lib-writ.ads: Document AB flag on M line * lib.adb (Has_Allocator): New function (Set_Has_Allocator): New procedure * lib.ads (Has_Allocator): New function (Set_Has_Allocator): New procedure (Has_Allocator): New flag in Unit_Record * sem_ch4.adb (Analyze_Allocator): Add processing for No_Allocators_After_Elaboration. From-SVN: r165171
2010-09-10[multiple changes]Arnaud Charlet1-9/+7
2010-09-10 Robert Dewar <dewar@adacore.com> * errout.adb: Remove tests of Parsing_Main_Subunit, since this test is now done in In_Extended_Main_Source_Unit. * errout.ads (Compiler_State[_Type]): Moved from Errout to Lib (Parsing_Main_Subunit): Moved from Errout to Lib and renamed as Parsing_Main_Extended_Source. * frontend.adb: Set Parsing_Main_Extended_Source True for parsing main unit. * lib-load.adb (Load_Unit): Add PMES parameter Set PMES appropriately in all calls to Load_Unit * lib-load.ads (Load_Unit): Add PMES parameter * lib.adb (In_Extended_Main_Source_Unit): When called with Compiler_State set to Parsing, test new flag Compiling_Main_Extended_Source. * lib.ads (Compiler_State[_Type]): Moved from Errout to Lib (Parsing_Main_Subunit): Moved from Errout to Lib and renamed as Parsing_Main_Extended_Source * par-load.adb (Load): Set PMES properly in call to Load_Unit 2010-09-10 Ed Schonberg <schonberg@adacore.com> * exp_cg.adb: Use proper entity to handle overloads. * sem_res.adb (Check_Parameterless_Call): An operator node without actuals cannot be a call, and must be treated as a string. From-SVN: r164182
2010-06-14ali.adb (Scan_ALI): Implement reading and storing of N linesRobert Dewar1-3/+11
2010-06-14 Robert Dewar <dewar@adacore.com> * ali.adb (Scan_ALI): Implement reading and storing of N lines (Known_ALI_Lines): Add entry for 'N' (notes) * ali.ads (Notes): New table to store Notes information * alloc.ads: Add entries for Notes table * lib-util.adb (Write_Info_Int): New procedure (Write_Info_Slit): New procedure (Write_Info_Uint): New procedure * lib-util.ads (Write_Info_Int): New procedure (Write_Info_Slit): New procedure (Write_Info_Uint): New procedure * lib-writ.adb (Write_Unit_Information): Output N (notes) lines * lib-writ.ads: Update documentation for N (Notes) lines * lib.adb (Store_Note): New procedure * lib.ads (Notes): New table (Store_Note): New procedure * sem_prag.adb: Call Store_Note for affected pragmas From-SVN: r160736
2009-07-13lib.adb, [...]: Minor reformatting and code reorganization.Robert Dewar1-5/+7
2009-07-13 Robert Dewar <dewar@adacore.com> * lib.adb, prj-nmsc.adb, prj-proc.adb, prj-proc.ads, prj.adb, prj.ads: Minor reformatting and code reorganization. * par-ch3.adb (Check_Restricted_Expression): New procedure From-SVN: r149566
2009-07-13lib.adb, [...]: Update comments.Arnaud Charlet1-0/+3
* lib.adb, make.adb, mlib.adb, exp_dist.adb: Update comments. Minor reformatting. From-SVN: r149562
2009-04-22lib-load.ads, [...] (Make_Child_Decl_Unit): New subprogram...Ed Schonberg1-3/+7
2009-04-22 Ed Schonberg <schonberg@adacore.com> * lib-load.ads, lib-load.adb (Make_Child_Decl_Unit): New subprogram, to create a unit table entry for the subprogram declaration created for a child suprogram body that has no separate specification. * sem_ch10.adb (Analyze_Compilation_Unit): For a child unit that is a subprogram body, call Make_Child_Decl_Unit. * lib.adb (Get_Cunit_Unit_Number): Verify that an entry not yet in the table can only be the created specification of a child subprogram body that is the main unit, which has not been entered in the table yet. * errout.adb (Output_Messages): Ignore created specification of a child subprogram body to prevent repeated listing of error messages. * gnat1drv.adb (gnat1drv): The generated specification for a child subprogram body does not generate code. From-SVN: r146559
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-13/+11
From-SVN: r145841
2008-11-07re PR ada/34289 (gnatmake -s doesn't work)Bechir Zalila1-1/+14
PR ada/34289 * lib.ads: (Enable_Switch_Storing): Declare. * lib.adb: (Enable_Switch_Storing): New procedure. * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatea. * make.adb: (Compile_Sources.Compile): Add -gnatea as first option. (Display): Never display -gnatea * gcc-interface/lang-specs.h: If -gnatea is present, pass -gnatez. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r141673
2008-04-08fe.h: Remove global Optimize_Alignment flag, no longer usedRobert Dewar1-1/+11
2008-04-08 Robert Dewar <dewar@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Ed Schonberg <schonberg@adacore.com> * fe.h: Remove global Optimize_Alignment flag, no longer used * layout.adb: Test Optimize_Alignment flags rather than global switch * lib.ads, lib.adb: New OA_Setting field in library record * lib-load.adb: New OA_Setting field in library record * lib-writ.ads, lib-writ.adb (Collect_Withs, Write_With_Lines): Place units mentioned in limited_with_ clauses in the ali file, with an 'Y' marker. New Ox fields in U line * opt.adb: New flag Optimize_Alignment_Local (Check_Policy_List[_Config]): New flags * opt.ads (Invalid_Value_Used): New flag New switch Optimize_Alignment_Local (Warn_On_Parameter_Order): New flag (Check_Policy_List[_Config]): New flags * ali.ads, ali.adb: Add indicator 'Y' to mark mark the presence of limited_with clauses. New data structures for Optimize_Alignment * bcheck.adb (Check_Consistent_Restriction_No_Default_Initialization): New procedure (Check_Consistent_Optimize_Alignment): Rework for new structure (Check_Consistent_Restrictions): Fix incorrect error message sem_ch10.adb (Decorate_Tagged_Type): Set the Parent field of a newly created class-wide type (to the Parent field of the specific type). (Install_Siblings): Handle properly private_with_clauses on subprogram bodies and on generic units. (Analyze_With_Clause, Install_Limited_Withed_Unit): Guard against an illegal limited_with_clause that names a non-existent package. (Check_Body_Required): Determine whether a unit named a limited_with clause needs a body. (Analyze_Context): A limited_with_clause is illegal on a unit_renaming. Capture Optimize_Alignment settings to set new OA_Setting field in library record. (Build_Limited_Views): Include task and protected type declarations. * sem_ch3.ads, sem_ch3.adb (Analyze_Object_Declaration): Handle the case of a possible constant redeclaration where the current object is an entry index constant. (Analyze_Object_Declaration): Generate an error in case of CPP class-wide object initialization. (Analyze_Object_Declaration): Add extra information on warnings for declaration of unconstrained objects. (Access_Type_Declaration): Set Associated_Final_Chain to Empty, to avoid conflicts with the setting of Stored_Constraint in the case where the access type entity has already been created as an E_Incomplete_Type due to a limited with clause. Use new Is_Standard_Character_Type predicate (Analyze_Object_Declaration): Apply access_constant check only after expression has been resolved, given that it may be overloaded with several access types. (Constant_Redeclaration): Additional legality checks for deferred constant declarations tha involve anonymous access types and/or null exclusion indicators. (Analyze_Type_Declaration): Set Optimize_Alignment flags (Analyze_Subtype_Declaration): Ditto (Analyze_Object_Declaration): Ditto (Analyze_Object_Declaration): Don't count tasks in generics 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 (Process_Discriminants): Additional check for illegal use of default expressions in access discriminant specifications in a type that is not explicitly limited. (Check_Abstract_Overriding): If an inherited function dispaches on an access result, it must be overridden, even if the type is a null extension. (Derive_Subprogram): The formals of the derived subprogram have the names and defaults of the parent subprogram, even if the type is obtained from the actual subprogram. (Derive_Subprogram): In the presence of interfaces, a formal of an inherited operation has the derived type not only if it descends from the type of the formal of the parent operation, but also if it implements it. This is relevant for the renamings created for the primitive operations of the actual for a formal derived type. (Is_Progenitor): New predicate, to determine whether the type of a formal in the parent operation must be replaced by the derived type. * sem_util.ads, sem_util.adb (Has_Overriding_Initialize): Make predicate recursive to handle components that have a user-defined Initialize procedure. Handle controlled derived types whose ancestor has a user-defined Initialize procedured. (Note_Possible_Modification): Add Sure parameter, generate warning if sure modification of constant Use new Is_Standard_Character_Type predicate (Find_Parameter_Type): when determining whether a protected operation implements an interface operation, retrieve the type of the formal from the entity when the formal is an access parameter or an anonymous-access-to-subprogram. Move Copy_Parameter_List to sem_util, for use when building stubbed subprogram bodies. (Has_Access_Values): Tagged types now return False (Within_HSS_Or_If): New procedure (Set_Optimize_Alignment_Flags): New procedure 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 From-SVN: r134011
2008-03-31g-table.adb, [...]: Fix comment typos.Ralf Wildenhues1-1/+1
gcc/ada/ * g-table.adb, g-tasloc.adb, g-traceb.ads, g-trasym.adb, g-utf_32.adb, gen-soccon.c, gigi.h, gmem.c, gnatbind.adb, gnatchop.adb, gnatcmd.adb, gnatcmd.ads, gnatdll.adb, gnatfind.adb, gnatlink.adb, gnatmem.adb, gprep.adb, i-cstrea-vms.adb, i-cstrin.adb, i-pacdec.ads, i-vxwork.ads, impunit.adb, init.c, initialize.c, inline.adb, layout.adb, lib-writ.adb, lib-writ.ads, lib-xref.adb, lib-xref.ads, lib.adb, link.c, live.ads, make.adb, makegpr.adb, makeutl.adb, math_lib.adb, mdll-utl.adb, mdll.ads, memroot.adb, memroot.ads, misc.c, mlib-prj.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-tru64.adb, mlib-tgt.ads, namet.adb, namet.h, nlists.adb, nlists.ads, nlists.h, opt.ads, osint-b.ads, osint-c.adb, osint-c.ads, osint.adb, osint.ads, output.ads, par-ch10.adb, par-ch12.adb, par-ch2.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-prag.adb, par-sync.adb, par-tchk.adb, par-util.adb, par.adb, prep.adb, prep.ads, prepcomp.adb, prj-attr.ads, prj-dect.adb, prj-env.adb, prj-ext.adb, prj-nmsc.adb, prj-nmsc.ads, prj-pp.adb, prj-proc.adb, prj-strt.ads, prj-tree.ads, prj.adb, prj.ads: Fix comment typos. From-SVN: r133770
2007-09-12types.ads, [...]: Minor reformatting.Robert Dewar1-0/+13
2007-09-12 Robert Dewar <dewar@adacore.com> * types.ads, a-charac.ads, freeze.adb: Minor reformatting. * a-except.adb, g-hesora.adb, g-speche.adb, lib.adb, lib.ads, lib-load.adb, lib-writ.adb, s-assert.adb, s-carun8.adb, s-casuti.adb, s-crc32.adb, s-exctab.adb, s-htable.adb, s-imgenu.adb, s-mastop.adb, s-memory.adb, s-memory.ads, s-secsta.adb, s-soflin.adb, s-sopco3.adb, s-sopco4.adb, s-sopco5.adb, s-stache.adb, s-stalib.adb, s-stoele.adb, s-strcom.adb, s-strops.adb, s-traceb.adb, s-traent.adb, s-wchcnv.adb, s-wchcon.adb, s-wchjis.adb, s-addope.adb, s-except.adb, s-os_lib.adb, s-string.adb, s-utf_32.adb, a-chlat1.ads, a-elchha.ads, a-except.ads, g-hesora.ads, g-htable.ads, g-speche.ads, par-prag.adb, restrict.adb, restrict.ads, s-assert.ads, s-carun8.ads, s-casuti.ads, s-crc32.ads, sem_ch11.adb, sem_prag.adb, s-exctab.ads, s-htable.ads, s-imgenu.ads, s-mastop.ads, snames.adb, snames.ads, snames.h, s-purexc.ads, s-secsta.ads, s-soflin.ads, s-sopco3.ads, s-sopco4.ads, s-sopco5.ads, s-stache.ads, s-stalib.ads, s-stoele.ads, s-strcom.ads, s-strops.ads, s-traceb.ads, s-traent.ads, s-unstyp.ads, s-wchcnv.ads, s-wchcon.ads, s-wchjis.ads, s-addope.ads, s-except.ads, s-os_lib.ads, s-string.ads, s-utf_32.ads: Implement pragma Compiler_Unit and adds it to relevant library units. From-SVN: r128426
2007-08-14binde.adb (Elab_All_Links): Remove unnecessary call to ↵Thomas Quinot1-43/+17
Generic_Separately_Compiled (if... 2007-08-14 Thomas Quinot <quinot@adacore.com> Vincent Celier <celier@adacore.com> * binde.adb (Elab_All_Links): Remove unnecessary call to Generic_Separately_Compiled (if a unit satisfies this predicate, there won't be an associated Afile). (Elab_All_Links): Fail if a referenced unit cannot be found * bindgen.adb: Fix comments in bindgen regarding consistency checks done in Bcheck: the checks are made across units within a partition, not across several partitions. Fix generation of C binder file for VxWorks. * lib.adb (Generic_Separately_Compiled): Rename to Generic_May_Lack_ALI, more descriptive of the current use of the predicate, and update documentation. * lib-writ.ads, lib-writ.adb (Write_With_Lines): Minor code reorganization and documentation update for the case of predefined library generics (for which we do not reference an Afile). From-SVN: r127439
2007-06-06sinput.ads, [...] (Unlock): New procedure.Robert Dewar1-2/+12
2007-04-20 Robert Dewar <dewar@adacore.com> * sinput.ads, sinput.adb, uintp.ads, urealp.adb, stringt.adb, sem_elim.adb, prj-strt.adb, repinfo.ads, repinfo.adb, namet.ads, elists.ads, elists.adb, lib.ads, lib.adb (Unlock): New procedure. Fix lower bound of tables. Add rep clauses. * nlists.adb: Ditto. (Prev_Node, Next_Node): Change index type to Int so that it properly covers the range First_Node_Id - 1 up. From-SVN: r125391
2007-04-06lib.ads, lib.adb (Tree_Read): Release the memory occupied by the switches ↵Serguei Rybin1-1/+6
from previously loaded tree 2007-04-06 Serguei Rybin <rybin@adacore.com> * lib.ads, lib.adb (Tree_Read): Release the memory occupied by the switches from previously loaded tree From-SVN: r123581
2006-10-31lib.adb, lib.ads: (In_Predefined_Unit): New functionsRobert Dewar1-0/+16
2006-10-31 Robert Dewar <dewar@adacore.com> * lib.adb, lib.ads: (In_Predefined_Unit): New functions * a-finali.ads, a-ngcoty.ads, a-strbou.ads, a-stream.ads, a-strmap.ads, a-strunb.ads, a-stwibo.ads, a-stwima.ads, a-stwiun.ads, a-taside.ads, a-coorse.ads, a-convec.ads, a-coinve.ads, a-cohama.ads, a-ciorse.ads, a-cihama.ads, a-cihase.ads, a-cohase.ads, a-ciorma.ads, a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-stzbou.ads, a-stzmap.ads, a-stzunb.ads, a-except-2005.ads: Add pragma Preelaborable_Warning From-SVN: r118242
2006-02-15ali-util.adb (Get_File_Checksum): Update to account for change in profile of ↵Thomas Quinot1-41/+43
Initialize_Scanner. 2006-02-13 Thomas Quinot <quinot@adacore.com> Vincent Celier <celier@adacore.com> Robert Dewar <dewar@adacore.com> * ali-util.adb (Get_File_Checksum): Update to account for change in profile of Initialize_Scanner. * gprep.adb (Gnatprep): Update to account for change in profile of Initialize_Scanner. (Process_One_File): Same. * lib.adb (Get_Code_Or_Source_Unit): New subprogram factoring the common code between Get_Code_Unit and Get_Source_Unit. Reimplement that behaviour using the new Unit information recorded in the source files table, rather than going through all units every time. (Get_Code_Unit): Reimplement in terms of Get_Code_Or_Source_Unit. (Get_Source_Unit): Same. * prepcomp.adb (Parse_Preprocessing_Data_File): Update to account for change in profile of Initialize_Scanner. (Prepare_To_Preprocess): Same. * lib.ads: Fix typo in comment (templace -> template). * prj-part.adb (Parse_Single_Project): Update to account for change in profile of Initialize_Scanner. * scn.adb (Initialize_Scanner): Account for change in profile of Scng.Initialize_Scanner: set Current_Source_Unit in Scn instead of Scng. Also record the association of the given Source_File_Index to the corresponding Unit_Number_Type. * scng.ads, scng.adb (Initialize_Scanner.Set_Reserved): Remove procedure. (Initialize_Scanner): Call Scans.Initialize_Ada_Keywords. Remove Unit formal for generic scanner: this formal is only relevant to Scn (the scanner instance used to parse Ada source files), not to other instances. Update comment accordingly. (Scan): Use new function Snames.Is_Keyword_Name. * sinfo-cn.adb: Fix typo in comment. * sinput.adb (Unit, Set_Unit): Accessors for new source file attribute Unit. * sinput.ads (Source_File_Record): New component Unit, used to capture the unit identifier (if any) associated to a source file. * sinput-c.adb, sinput-l.adb (Load_File): Initialize new component Unit in Source_File_Record. * sinput-p.adb (Source_File_Is_Subunit): Update to account for change in profile of Initialize_Scanner. * scans.adb (Initialize_Ada_Keywords): New procedure * scans.ads (Initialize_Ada_Keywords): New procedure to initialize the Ada keywords in the Namet table, without the need to call Initialize_Scanner. * snames.adb: Add pragma Ada_2005 (synonym for Ada_05) (Is_Keyword_Name): New function * snames.ads: Add subtype Configuration_Pragma_Names Add pragma Ada_2005 (synonym for Ada_05) (Is_Keyword_Name): New function * snames.h: Add pragma Ada_2005 (synonym for Ada_05) From-SVN: r111032
2005-12-09[multiple changes]Arnaud Charlet1-1/+1
2005-12-05 Robert Dewar <dewar@adacore.com> * i-c.adb, i-cexten.ads, i-cobol.adb, i-cobol.ads, i-cpoint.ads, i-cpp.adb, i-cpp.ads, i-cstrea.ads, i-cstrin.adb, i-cstrin.ads, inline.adb, interfac.ads, i-os2err.ads, i-os2lib.ads, i-os2syn.ads, i-os2thr.ads, itypes.adb, itypes.adb, itypes.ads, krunch.ads, krunch.adb, lib.adb, lib.ads, lib-list.adb, lib-load.adb, lib-load.ads, lib-sort.adb, live.adb, make.ads, i-cstrea-vms.adb, interfac-vms.ads, makegpr.adb, indepsw-gnu.adb, indepsw.ads, s-wchcon.ads, sdefault.ads, sem_ch10.adb, sem_eval.ads: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * s-vaflop-vms-alpha.adb: (Ne_F): New function (Ne_G): New function * exp_ch4.adb (Expand_Allocator_Expression): Factor duplicated code for tag assignment. (Rewrite_Comparison): Handle case where operation is not a comparison and ignore, and also handle type conversion case. 2005-12-05 Thomas Quinot <quinot@adacore.com> * exp_aggr.ads: Fix typo in comment. ???-mark Convert_Aggr_In_Assignment as needing documentation. 2005-12-05 Gary Dismukes <dismukes@adacore.com> * layout.adb: Replace various uses of byte by storage unit throughout. (Get_Max_SU_Size): Name changed from Get_Max_Size. In the case of a static size, convert to storage units before returning, to conform to spec. 2005-12-05 Matthew Gingell <gingell@adacore.com> * g-exctra.ads: Fix typo in comment. 2005-12-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * utils.c: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * g-soccon.ads: Further comment fixes to make the status of the default file clear * s-bitops.adb: Clarify comment for Bits_Array From-SVN: r108308
2005-09-05re PR ada/23646 (Ada testsuite hangs -- many new failures)Arnaud Charlet1-3/+1
PR ada/23646 * s-mastop-tru64.adb, s-mastop-irix.adb, s-mastop-vms.adb (Enter_Handler, Set_Signal_Machine_State): Removed, no longer used. Remove reference to System.Exceptions. * s-mastop-x86.adb: Removed, no longer used. * s-traceb-mastop.adb: Adjust calls to Pop_Frame. * a-excach.adb: Minor reformatting. * a-except.ads, a-except.adb: Remove global Warnings (Off) pragma, and instead fix new warnings that were hidden by this change. (AAA, ZZZ): Removed, replaced by... (Code_Address_For_AAA, Code_Address_For_ZZZ): ... these functions, who are used instead of constants, to help make Ada.Exception truly preelaborate. (Rcheck_*, Raise_Constraint_Error, Raise_Program_Error, Raise_Storage_Error): File is now a System.Address, to simplify code. (Elab code): Removed, no longer used. (Null_Occurrence): Remove Warnings Off and make this construct preelaborate. Remove code related to front-end zero cost exception handling, since it is no longer used. Remove -gnatL/-gnatZ switches. * a-exexda.adb (Append_Info_Exception_Name, Set_Exception_C_Msg): Update use of Except.Msg. * gnat1drv.adb, inline.adb, bindgen.adb, debug.adb, exp_ch11.ads, freeze.adb, frontend.adb, lib.adb, exp_ch11.adb: Remove code related to front-end zero cost exception handling, since it is no longer used. Remove -gnatL/-gnatZ switches. * lib-writ.ads: Minor reformatting Remove doc of UX * Makefile.rtl: Remove references to s-except*, s-mastop-x86* * Make-lang.in: Remove references to s-except.ads * s-except.ads: Removed, no longer used. * s-mastop.ads, s-mastop.adb: (Enter_Handler, Set_Signal_Machine_State): Removed, no longer used. Remove reference to System.Exceptions. * raise.h, usage.adb, targparm.adb, targparm.ads, switch-m.adb, switch-b.adb: Remove code related to front-end zero cost exception handling, since it is no longer used. Remove -gnatL/-gnatZ switches. From-SVN: r103848
2005-07-01Update FSF addressR. Kelley Cook1-2/+2
From-SVN: r101492
2004-06-25revert: [multiple changes]Arnaud Charlet1-10/+20
2004-06-25 Pascal Obry <obry@gnat.com> * makegpr.adb (Build_Library): Remove parameter Lib_Address and Relocatable from Build_Dynamic_Library call. * gnat_ugn.texi: Change documentation about Library_Kind. Dynamic and Relocatable are now synonym. * Makefile.in: Use s-parame-mingw.adb on MingW platform. * mlib-prj.adb (Build_Library): Remove DLL_Address constant definition. Remove parameter Lib_Address and Relocatable from Build_Dynamic_Library call. * mlib-tgt.ads, mlib-tgt.adb (Build_Dynamic_Library): Remove parameter Lib_Address and Relocatable. (Default_DLL_Address): Removed. * mlib-tgt-tru64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb, mlib-tgt-hpux.adb, mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-vms-alpha.adb, mlib-tgt-vms-ia64.adb, mlib-tgt-vxworks.adb: (Build_Dynamic_Library): Remove parameter Lib_Address and Relocatable. (Default_DLL_Address): Removed. * mlib-tgt-mingw.adb: Ditto. (Build_Dynamic_Library): Do not add "lib" prefix to the DLL name. * s-taprop-mingw.adb (Create_Task): Use Adjust_Storage_Size to compute the initial thread stack size. * a-strmap.ads: Move package L to private part as it is not used in the spec. Found while reading code. 2004-06-25 Olivier Hainque <hainque@act-europe.fr> * tracebak.c: Introduce support for a GCC infrastructure based implementation of __gnat_backtrace. * raise.c: Don't rely on a C mapping of the GNAT_GCC_Exception record any more. Use accessors instead. This eases maintenance and relaxes some alignment constraints. (_GNAT_Exception structure): Remove the Ada specific fields (EID_For, Adjust_N_Cleanups_For): New accessors, exported by a-exexpr.adb. (is_handled_by, __gnat_eh_personality): Replace component references to exception structure by use of the new accessors. * init.c (__gnat_initialize): Adjust comments to match the just reverted meaning of the -static link-time option. * adaint.c (convert_addresses): Arrange not to define a stub for mips-irix any more, as we now want to rely on a real version from a recent libaddr2line. * a-exexpr.adb: Provide new accessors to a GNAT_GCC occurrence, so that the personality routine can use them and not have to rely on a C counterpart of the record anymore. This simplifies maintenance and relaxes the constraint of having Standard'Maximum_Alignment match BIGGEST_ALIGNMENT. Update comments, and add a section on the common header alignment issue. 2004-06-25 Geert Bosch <bosch@gnat.com> * a-ngelfu.adb (Tanh): Use full 20 digit precision for constants in polynomial approximation. Fixes inconsistency with Cody/Waite algorithm. 2004-06-25 Robert Dewar <dewar@gnat.com> * gnat_rm.texi: Fix section on component clauses to indicate that the restriction on byte boundary placement still applies for bit packed arrays. Add comment on stack usage from Initialize_Scalars * gnat_ugn.texi: Add documentation for -gnatyLnnn * stylesw.ads, stylesw.adb: Implement new -gnatyLnnn option for limiting nesting level. * usage.adb: Add line for -gnatyLnnn switch * g-debpoo.ads, xtreeprs.adb, sinput.ads, sem_ch13.ads, sem_ch13.adb, exp_aggr.adb: Minor reformatting * sem_prag.adb (Process_Atomic_Shared_Volatile): Set Is_Atomic on base type as well as on the subtype. This corrects a problem in freeze in setting alignments of atomic types. * sem_eval.ads: Minor comment typo fixed * par-util.adb (Push_Scope_Stack): Check for violation of max nesting level. Minor reformatting. * fname.adb (Is_Predefined_File_Name): Require a letter after the minus sign. This means that file names like a--b.adb will not be considered predefined. * freeze.adb: Propagate new flag Must_Be_On_Byte_Boundary to containing record Test new flag and give diagnostic for bad component clause. (Freeze_Entity): Set alignment of array from component alignment in cases where this is safe to do. * exp_pakd.adb: Set new flag Must_Be_On_Byte_Boundary for large packed arrays. * cstand.adb: (Create_Standard): Set alignment of String to 1 * einfo.ads, einfo.adb: Introduce new flag Must_Be_On_Byte_Boundary * exp_ch4.adb (Expand_Array_Equality): Improve efficiency of generated code in the common constrained array cases. * a-storio.adb: Change implementation to avoid possible alignment problems on machines requiring strict alignment (data should be moved as type Buffer, not type Elmt). * checks.adb (Apply_Array_Size_Check): Improve these checks by killing the overflow checks which we really do not need (64-bits is enough). 2004-06-25 Vincent Celier <celier@gnat.com> * makegpr.adb (Is_Included_In_Global_Archive): New Boolean function (Add_Archives.Recursive_Add_Archives): Call Add_Archive_Path inconditionally for the main project. (Recursive_Add_Archives.Add_Archive_Path): New procedure (Link_Executables.Check_Time_Stamps): New procedure (Link_Executables.Link_Foreign): New procedure Changes made to reduce nesting level of this package (Check): New procedure (Add_Switches): When not in quiet output, check that a switch is not the concatenation of several valid switches. If it is, issue a warning. (Build_Global_Archive): If the global archive is rebuilt, linking need to be done. (Compile_Sources): Rebuilding a library archive does not imply rebuilding the global archive. (Build_Global_Archive): New procedure (Build_Library): New name for Build_Archive, now only for library project (Check_Archive_Builder): New procedure (Create_Global_Archive_Dependency_File): New procedure (Gprmake): Call Build_Global_Archive before linking * makegpr.adb: Use Other_Sources_Present instead of Sources_Present throughout. (Scan_Arg): Display the Copyright notice when -v is used * gnat_ugn.texi: Document new switch -files= (VMS qualifier /FILES=) for gnatls. * vms_data.ads: Add qualifier /MAX_NESTING=nnn (-gnatyLnnn) for GNAT COMPILE. Add new GNAT LIST qualifier /FILES= Added qualifier /DIRECTORY= to GNAT METRIC Added qualifier /FILES= to GNAT METRIC Added qualifier /FILES to GNAT PRETTY * switch.adb (Is_Front_End_Switch): Refine the test for --RTS or -fRTS, to take into account both versions of the switch. * switch-c.adb (Scan_Front_End_Switches): New switch -gnatez. Should always be the last switch to the gcc driver. Disable switch storing so that switches automatically added by the gcc driver are not put in the ALI file. * prj.adb (Project_Empty): Take into account changes in components of Project_Data. * prj.ads (Languages_Processed): New enumaration value All_Languages. * prj.ads (Project_Data): Remove component Lib_Elaboration: never used. Split Boolean component Ada_Sources_Present in two Boolean components Ada_Sources_Present and Other_Sources_Present. Minor reformatting * prj-env.adb (For_All_Source_Dirs.Add): Use Ada_Sources_Present instead of Sources_Present. (Set_Ada_Paths.Add.Recursive_Add): Ditto * prj-nmsc.adb: Minor reformatting (Check_Ada_Naming_Scheme): New name of procedure Check_Naming_Scheme (Check_Ada_Naming_Scheme_Validity): New name of previous procedure Check_Ada_Naming_Scheme. Change Sources_Present to Ada_Sources_Present or Other_Sources_Present throughout. * prj-part.adb (Post_Parse_Context_Clause): New Boolean parameter In_Limited. Make sure that all cycles where there is at least one "limited with" are detected. (Parse_Single_Project): New Boolean parameter In_Limited * prj-proc.adb (Recursive_Check): When Process_Languages is All_Languages, call first Prj.Nmsc.Ada_Check, then Prj.Nmsc.Other_Languages_Check. * prj-proc.adb (Process): Use Ada_Sources_Present or Other_Sources_Present (instead of Sources_Present) depending on Process_Languages. * lang-specs.h: Keep -g and -m switches in the same order, and as the last switches. * lib.adb (Switch_Storing_Enabled): New global Boolean flag (Disable_Switch_Storing): New procedure. Set Switch_Storing_Enabled to False. (Store_Compilation_Switch): Do nothing if Switch_Storing_Enabled is False. * lib.ads (Disable_Switch_Storing): New procedure. * make.adb: Modifications to reduce nesting level of this package. (Check_Standard_Library): New procedure (Gnatmake.Check_Mains): New procedure (Gnatmake.Create_Binder_Mapping_File): New procedure (Compile_Sources.Compile): Add switch -gnatez as the last option (Display): Never display -gnatez * Makefile.generic: When using $(MAIN_OBJECT), always use $(OBJ_DIR)/$(MAIN_OBJECT) * gnatcmd.adb (Check_Project): New function (Process_Link): New procedure to reduce nesting depth (Check_Files): New procedure to reduce the nesting depth. For GNAT METRIC, include the inherited sources in extending projects. (GNATCmd): When GNAT LS is invoked with a project file and no files, add the list of files from the sources of the project file. If this list is too long, put it in a temp text files and use switch -files= (Delete_Temp_Config_Files): Delete the temp text file that contains a list of source for gnatpp or gnatmetric, if one has been created. (GNATCmd): For GNAT METRIC and GNAT PRETTY, if the number of sources in the project file is too large, create a temporary text file that list them and pass it to the tool with "-files=<temp text file>". (GNATCmd): For GNAT METRIC add "-d=<abject dir>" as the first switch * gnatlink.adb (Gnatlink): Do not compile with --RTS= when the generated file is in not in Ada. * gnatls.adb: Remove all parameters And_Save that are no longer used. (Scan_Ls_Arg): Add processing for -files= (Usage): Add line for -files= * g-os_lib.adb (On_Windows): New global constant Boolean flag (Normalize_Pathname): When on Windows and the path starts with a directory separator, make sure that the resulting path will start with a drive letter. * clean.adb (Clean_Archive): New procedure (Clean_Project): When there is non-Ada code, delete the global archive, the archive dependency files, the object files and their dependency files, if they exist. (Gnatclean): Call Prj.Pars.Parse for All_Languages, not for Ada only. 2004-06-25 Thomas Quinot <quinot@act-europe.fr> * sinfo.ads: Fix typo in comment. * sem_dist.adb (Process_Remote_AST_Attribute): Simplify code that uses the TSS for remote access-to-subprogram types, since these TSS are always present once the type has been analyzed. (RAS_E_Dereference): Same. * sem_attr.adb (Analyze_Attribute): When analysis of an attribute reference raises Bad_Attribute, mark the reference as analyzed so the node (and any children resulting from rewrites that could have occurred during the analysis that ultimately failed) is not analyzed again. * exp_ch7.ads (Find_Final_List): Fix misaligned comment. * exp_dist.adb: Minor comment fix. * exp_ch4.adb (Expand_N_Allocator): For an allocator whose expected type is an anonymous access type, no unchecked deallocation of the allocated object can occur. If the object is controlled, attach it with a count of 1. This allows attachment to the Global_Final_List, if no other relevant list is available. (Get_Allocator_Final_List): For an anonymous access type that is the type of a discriminant or record component, the corresponding finalisation list is the one of the scope of the type. 2004-06-25 Ed Schonberg <schonberg@gnat.com> * sem_ch3.adb (Replace_Type): When computing the signature of an inherited subprogram, use the first subtype if the derived type declaration has no constraint. * exp_ch6.adb (Add_Call_By_Copy_Code): Check that formal is an array before applying previous optimization. Minor code cleanup. * exp_util.adb (Is_Possibly_Unaligned_Slice): If the component is placed at the beginning of an unpacked record without explicit alignment, a slice of it will be aligned and does not need a copy when used as an actual. 2004-06-25 Ed Schonberg <schonberg@gnat.com> PR ada/15591 PR ada/15592 * sem_ch8.adb (Attribute_Renaming): Reject renaming if the attribute reference is written with expressions mimicking parameters. 2004-06-25 Hristian Kirtchev <kirtchev@gnat.com> PR ada/15589 * sem_ch3.adb (Build_Derived_Record_Type): Add additional check to STEP 2a. The constraints of a full type declaration of a derived record type are checked for conformance with those declared in the corresponding private extension declaration. The message "not conformant with previous declaration" is emitted if an error is detected. 2004-06-25 Vasiliy Fofanov <fofanov@act-europe.fr> * g-traceb.ads: Document the need for -E binder switch in the spec. * g-trasym.ads: Document the need for -E binder switch in the spec. 2004-06-25 Jose Ruiz <ruiz@act-europe.fr> * sem_prag.adb: Add handling of pragma Detect_Blocking. * snames.h, snames.ads, snames.adb: Add entry for pragma Detect_Blocking. * s-rident.ads: Change reference to pragma Detect_Blocking. * targparm.ads, targparm.adb: Allow pragma Detect_Blocking in system.ads. * opt.ads (Detect_Blocking): New Boolean variable (defaulted to False) to indicate whether pragma Detect_Blocking is active. * par-prag.adb: Add entry for pragma Detect_Blocking. * rtsfind.adb (RTU_Loaded): Fix the temporary kludge to get past bug of not handling WITH. Note that this replaces the previous update which was incorrect. 2004-06-25 Javier Miranda <miranda@gnat.com> * sem_ch10.adb (Re_Install_Use_Clauses): Force the installation of the use-clauses to have a clean environment. * sem_ch8.adb (Install_Use_Clauses): Addition of a new formal to force the installation of the use-clauses to stablish a clean environment in case of compilation of a separate unit; otherwise the call to use_one_package is protected by the barrier Applicable_Use. * sem_ch8.ads (Install_Use_Clauses): Addition of a new formal to force the installation of the use-clauses to stablish a clean environment in case of compilation of a separate unit. (End_Use_Clauses): Minor comment cleanup. 2004-06-25 Sergey Rybin <rybin@act-europe.fr> * gnat_ugn.texi: Add description of the gnatpp 'files' switch From-SVN: r83658
2004-06-14[multiple changes]Arnaud Charlet1-1/+8
2004-06-14 Pascal Obry <obry@gnat.com> * gnat_ugn.texi: Document relocatable vs. dynamic Library_Kind on Windows. Fix minor typo. * mlib-tgt-mingw.adb: New implementation using the GCC -shared option which is now supported on Windows. With this implementation using the Library Project feature is no different on Windows than on UNIX. 2004-06-14 Vincent Celier <celier@gnat.com> * makegpr.adb (Compile_Sources): Nothing to do when there are no non-Ada sources. * mlib-tgt-vxworks.adb (Library_Exists_For): Remove incorrect comment * prj-part.adb (Parse_Single_Project): When a duplicate project name is found, show the project name and the path of the previously parsed project file. 2004-06-14 Ed Schonberg <schonberg@gnat.com> * exp_ch6.adb (Add_Call_By_Copy_Code): For an out-parameter that is an array, avoid copying the actual before the call. 2004-06-14 Thomas Quinot <quinot@act-europe.fr> * g-debpoo.adb: Remove alignment assumptions from GNAT.Debug_Pools. Instead, allocate memory on worst-case alignment assumptions, and then return an aligned address within the allocated zone. 2004-06-14 Robert Dewar <dewar@gnat.com> * bindgen.adb (Gen_Adainit_Ada): Do not generate external references to elab entities in predefined units in No_Run_Time_Mode. (Gen_Adainit_C): Same fix (Gen_Elab_Calls_Ada): Do not generate calls to elaborate predefined units in No_Run_Time_Mode (Gen_Elab_Calls_C): Same fix * symbols-vms-alpha.adb: Minor reformatting * g-debpoo.ads: Minor reformatting * lib.adb (In_Same_Extended_Unit): Version working on node id's * lib.ads (In_Same_Extended_Unit): Version working on node id's * lib-xref.adb: Minor cleanup, use new version of In_Same_Extended_Unit working on nodes. * make.adb: Minor reformatting * par-ch12.adb: Minor reformatting * par-prag.adb: Add dummy entry for pragma Profile_Warnings * prj-strt.adb: Minor reformatting * restrict.ads, restrict.adb: Redo handling of profile restrictions to be more general. * sem_attr.adb: Minor reformatting * sem_ch7.adb: Minor reformatting * sem_elab.adb (Check_A_Call): Deal with problem of calling init proc for type in the same unit as the object declaration. * sem_prag.adb (Check_Arg_Is_External_Name): New procedure, allows static string expressions and not just string literals. Minor reformatting (Set_Warning): Reset restriction warning flag for restriction pragma Implement pragma Profile_Warnings Implement pragma Profile (Restricted) Give obolescent messages for old restrictions and pragmas * snames.h, snames.ads, snames.adb: Add new entry for pragma Profile_Warnings. * s-rident.ads: Add declarations for restrictions required by profile Restricted and profile Ravenscar. * targparm.ads, targparm.adb: Allow pragma Profile in system.ads * gnat_ugn.texi: Correct some missing entries in the list of GNAT configuration pragmas. From-SVN: r83099