aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug.adb
AgeCommit message (Collapse)AuthorFilesLines
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-12-15exp_unst.adb (Unnest_Subprograms): Nothing to do if the main unit is a ↵Pierre-Marie de Rodat1-5/+8
generic package body. gcc/ada/ 2017-12-15 Ed Schonberg <schonberg@adacore.com> * exp_unst.adb (Unnest_Subprograms): Nothing to do if the main unit is a generic package body. Unnesting is only an issue when generating code, and if the main unit is generic then nested instance bodies have not been created and analyzed, and unnesting will crash in the absence of those bodies, 2017-12-15 Hristian Kirtchev <kirtchev@adacore.com> * inline.adb (Add_Inlined_Body): Do not add a function which is completed by an expression function defined in the same context as the initial declaration because the completing body is not in a package body. (Is_Non_Loading_Expression_Function): New routine. 2017-12-15 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Move the functionality of -gnatdL to -gnatd_i. Restore the behavior of -gnatdL from before revision 255412. * sem_elab.adb: Update the section of compiler switches. (Build_Call_Marker): Do not create a marker for a call which originates from an expanded spec or body of an instantiated gener, does not invoke a generic formal subprogram, the target is external to the instance, and -gnatdL is in effect. (In_External_Context): New routine. (Process_Conditional_ABE_Activation_Impl): Update the uses of -gnatdL and associated flag. (Process_Conditional_ABE_Call): Update the uses of -gnatdL and associated flag. * switch-c.adb (Scan_Front_End_Switches): Switch -gnatJ now sets switch -gnatd_i. * exp_unst.adb: Minor typo fixes and edits. 2017-12-15 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Possible_Freeze): Do not set Delayed_Freeze on an subprogram instantiation, now that the enclosing wrapper package carries an explicit freeze node. THis prevents freeze nodes for the subprogram for appearing in the wrong scope. This is relevant when the generic subprogram has a private or incomplete formal type and the instance appears within a package that declares the actual type for the instantiation, and that type has itself a delayed freeze. 2017-12-15 Patrick Bernardi <bernardi@adacore.com> * doc/gnat_ugn/gnat_and_program_execution.rst: Removed references to the environment variable GNAT_STACK_LIMIT from the Stack Overflow Checking section as it is no longer used by any of our supported targets. gcc/testsuite/ 2017-12-15 Hristian Kirtchev <kirtchev@adacore.com> * gnat.dg/expr_func_main.adb, gnat.dg/expr_func_pkg.ads, gnat.dg/expr_func_pkg.adb: New testcase. 2017-12-15 Hristian Kirtchev <kirtchev@adacore.com> * gnat.dg/abe_pkg.adb, gnat.dg/abe_pkg.ads: New testcase. 2017-12-15 Ed Schonberg <schonberg@adacore.com> * gnat.dg/subp_inst.adb, gnat.dg/subp_inst_pkg.adb, gnat.dg/subp_inst_pkg.ads: New testcase. From-SVN: r255683
2017-12-05[multiple changes]Pierre-Marie de Rodat1-2/+233
2017-12-05 Olivier Hainque <hainque@adacore.com> * s-dwalin.adb (Read_And_Execute_Isn): Adjust test checking for the end of section. Add comments explaining the rationale of the computation. 2017-12-05 Bob Duff <duff@adacore.com> * exp_ch11.adb: Minor refactoring. 2017-12-05 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Add debug switches d_a, d_e, and d_p, along with documentation. (Set_Underscored_Debug_Flag): New routine. * debug.ads: Add the flags for all underscore switches. (Set_Underscored_Debug_Flag): New routine. * einfo.adb: Flag303 is now Suppress_Elaboration_Warnings. (Suppress_Elaboration_Warnings): New routine. (Set_Suppress_Elaboration_Warnings): New routine. (Write_Entity_Flags): Add output for Suppress_Elaboration_Warnings. * einfo.ads: Add new flag Suppress_Elaboration_Warnings. (Suppress_Elaboration_Warnings): New routine along with pragma Inline. (Set_Suppress_Elaboration_Warnings): New routine along with pragma Inline. * exp_ch3.adb (Build_Init_Procedure): Restore the behavior of the legacy elaboration model. (Default_Initialize_Object): Restore the behavior of the legacy elaboration model. * exp_ch9.adb: Add with and use clause for Sem_Elab. (Build_Task_Activation_Call): Restore the behavior of the legacy elaboration model. * frontend.adb (Frontend): Restore the behavior of the legacy elaboration model. * opt.ads: Add new flags Legacy_Elaboration_Checks and Relaxed_Elaboration_Checks, along with documentation. * sem_attr.adb (Analyze_Access_Attribute): Restore the behavior of the legacy elaboration model. * sem_ch5.adb (Analyze_Assignment): Restore the behavior of the legacy elaboration model. * sem_ch7.adb (Analyze_Package_Declaration): Restore the behavior of the legacy elaboration model. * sem_ch8.adb (Attribute_Renaming): Restore the behavior of the legacy elaboration model. * sem_ch12.adb (Analyze_Instance_And_Renamings): Restore the behavior of the legacy elaboration model. (Analyze_Package_Instantiation): Restore the behavior of the legacy elaboration model. (Analyze_Subprogram_Instantiation): Restore the behavior of the legacy elaboration model. * sem_elab.adb: Update the documentation of the Processing phase. Update the documentation on elaboration-related compilation switches. Update the documentation on adding a new target. Add Processing_Attributes which represent the state of the Processing phase. Resurrect the previous elaboration model as "legacy elaboration model". (Build_Call_Marker): This routine does not function when the legacy elaboration model is in effect. Do not consider entry calls and requeue statements when debug flag d_e is in effect. Do not consider calls to subprograms which verify the runtime semantics of certain assertion pragmas when debug flag d_p is in effect. (Build_Variable_Reference_Marker): This routine does not function when the legacy elaboration model is in effect. (Check_Elaboration_Scenarios): This routine does not function when the legacy elaboration model is in effect. (Ensure_Prior_Elaboration): The various flags have now been replaced with a state. Do not generate implicit Elaborate[_All] pragmas when their creation has been suppressed. (Ensure_Prior_Elaboration_Static): The with clause is marked based on the requested pragma, not on the nature of the scenario. (In_External_Context): Removed. (Is_Assertion_Pragma_Target): New routine. (Is_Potential_Scenario): Stop the traversal of a task body when reaching an accept or select statement, and debug switch d_a is in effect. (Kill_Elaboration_Scenario): This routine does not function when the legacy elaboration model is in effect. (Process_Activation_Generic): The various flags have now been replaced with a state. (Process_Conditional_ABE): The various flags have now been replaced with a state. (Process_Conditional_ABE_Access): The various flags have now been replaced with a state. (Process_Conditional_ABE_Activation_Impl): The various flags have now been replaced with a state. Do not process an activation call which activates a task whose type is defined in an external instance, and debug switch dL is in effect. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Call): The various flags have now been replaced with a state. Do not process a call which invokes a subprogram defined in an external instance, and debug switch dL is in effect. (Process_Conditional_ABE_Call_Ada): The various flags have now been replaced with a state. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Call_SPARK): The various flags have now been replaced with a state. (Process_Conditional_ABE_Instantiation): The various flags have now been replaced with a state. (Process_Conditional_ABE_Instantiation_Ada): The various flags have now been replaced with a state. Suppress the generation of implicit Elaborate[_All] pragmas once a conditional ABE check has been installed. (Process_Conditional_ABE_Instantiation_SPARK): The various flags have now been replaced with a state. (Process_Guaranteed_ABE_Activation_Impl): The various flags have now been replaced with a state. (Process_Single_Activation): The various flags have now been replaced with a state. (Record_Elaboration_Scenario): This routine does not function when the legacy elaboration model is in effect. (Traverse_Body): The various flags have now been replaced with a state. * sem_elab.ads: Resurrect the pre-18.x elaboration model as "legacy elaboration model". * sem_prag.adb (Analyze_Pragma): Restore the behavior of the legacy elaboration model. * sem_res.adb (Resolve_Call): Restore the behavior of the legacy elaboration model. (Resolve_Entity_Name): Restore the behavior of the legacy elaboration model. * sem_util.adb (Mark_Elaboration_Attributes): This routine does not function when the legacy elaboration model is in effect. * sinfo.adb (Is_Known_Guaranteed_ABE): Update the assertion check. (No_Elaboration_Check): New routine. (Set_Is_Known_Guaranteed_ABE): Update the assertion check. (Set_No_Elaboration_Check): New routine. * sinfo.ads: Update the documentation of flag Is_Known_Guaranteed_ABE along with occurrences in nodes. Add new flag No_Elaboration_Check along with occurrences in nodes. * switch-c.adb (Scan_Front_End_Switches): Add processing for debug switches with underscores. Add processing for switches -gnatH and -gnatJ. * usage.adb (Usage): Add output for switches -gnatH and -gnatJ. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the documentation to include the legacy and relaxed elaboration models. * gnat_ugn.texi: Regenerate. 2017-12-05 Arnaud Charlet <charlet@adacore.com> * doc/gnat_ugn/platform_specific_information.rst: Minor edit. Improve doc on required packages for linux 32bits. 2017-12-05 Doug Rupp <rupp@adacore.com> * tracebak.c (ppc64-vx7): USE_GCC_UNWINDER for 64bit. 2017-12-05 Javier Miranda <miranda@adacore.com> * checks.adb (Generate_Range_Check): Force evaluation of the node in more cases. This patch was written to improve the code generated by the CCG compiler but it is enabled for all targets since double evaluation is always a potential source of inefficiency. 2017-12-05 Gary Dismukes <dismukes@adacore.com> * doc/gnat_ugn/gnat_utility_programs.rst: Remove reference to obsolete -fdump-xref switch. From-SVN: r255412
2017-11-16[multiple changes]Pierre-Marie de Rodat1-0/+6
2017-11-16 Steve Baird <baird@adacore.com> * debug.adb: Update another comment to indicate gnat2scil's use of the -gnatd.7 switch. 2017-11-16 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Call_Helper): Avoid creating a transient scope in the case of nested build-in-place calls. From-SVN: r254827
2017-11-16[multiple changes]Pierre-Marie de Rodat1-1/+1
2017-11-16 Joel Brobecker <brobecker@adacore.com> * doc/gnat_ugn/gnat_utility_programs.rst: Document the switches available in gnatsymbolize. 2017-11-16 Steve Baird <baird@adacore.com> * debug.adb: Update comment to indicate gnat2scil's use of the -gnatd.7 switch. From-SVN: r254826
2017-10-20exp_aggr.adb (Initialize_Array_Component): Avoid adjusting a component of an ↵Pierre-Marie de Rodat1-1/+1
array aggregate if... gcc/ada/ 2017-10-20 Bob Duff <duff@adacore.com> * exp_aggr.adb (Initialize_Array_Component): Avoid adjusting a component of an array aggregate if it is initialized by a build-in-place function call. * exp_ch6.adb (Is_Build_In_Place_Result_Type): Use -gnatd.9 to disable bip for nonlimited types. * debug.adb: Document -gnatd.9. 2017-10-20 Bob Duff <duff@adacore.com> * sem_ch12.adb: Remove redundant setting of Parent. 2017-10-20 Eric Botcazou <ebotcazou@adacore.com> * sem_ch4.adb (Find_Concatenation_Types): Filter out operators if one of the operands is a string literal. 2017-10-20 Bob Duff <duff@adacore.com> * einfo.ads: Comment fix. 2017-10-20 Clement Fumex <fumex@adacore.com> * switch-c.adb: Remove -gnatwm from the switches triggered by -gnateC. 2017-10-20 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Extract_Power): Accept dimension values that are not non-negative integers when the dimensioned base type is an Integer type. gcc/testsuite/ 2017-10-20 Ed Schonberg <schonberg@adacore.com> * gnat.dg/dimensions.adb, gnat.dg/dimensions.ads: New testcase. From-SVN: r253941
2017-10-14[multiple changes]Pierre-Marie de Rodat1-1/+8
2017-10-14 Eric Botcazou <ebotcazou@adacore.com> * layout.ads (Set_Elem_Alignment): Add Align parameter defaulted to 0. * layout.adb (Set_Elem_Alignment): Likewise. Use M name as maximum alignment for consistency. If Align is non-zero, use the minimum of Align and M for the alignment. * cstand.adb (Build_Float_Type): Use Set_Elem_Alignment instead of setting the alignment directly. 2017-10-14 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Check): Defer evaluation of the optional string in an Assert pragma until the expansion of the pragma has rewritten it as a conditional statement, so that the string argument is only evaluaed if the assertion fails. This is mandated by RM 11.4.2. 2017-10-14 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Switch -gnatd.v and associated flag are now used to enforce the SPARK rules for elaboration in SPARK code. * sem_elab.adb: Describe switch -gnatd.v. (Process_Call): Verify the SPARK rules only when -gnatd.v is in effect. (Process_Instantiation): Verify the SPARK rules only when -gnatd.v is in effect. (Process_Variable_Assignment): Clarify why variable assignments are processed reglardless of whether -gnatd.v is in effect. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the sections on elaboration code and compilation switches. * gnat_ugn.texi: Regenerate. 2017-10-14 Gary Dismukes <dismukes@adacore.com> * exp_util.adb, freeze.adb, sem_aggr.adb, sem_util.ads, sem_util.adb, sem_warn.adb: Minor reformattings. From-SVN: r253757
2017-10-09[multiple changes]Pierre-Marie de Rodat1-6/+6
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-29exp_ch6.adb (Expand_Call_Helper): Handle case of build-in-place functions ↵Bob Duff1-1/+4
returning nonlimited types. 2017-09-29 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Call_Helper): Handle case of build-in-place functions returning nonlimited types. Allow for qualified expressions and type conversions. (Expand_N_Extended_Return_Statement): Correct the computation of Func_Bod to allow for child units. (Expand_Simple_Function_Return): Remove assumption that b-i-p implies limited (initialization of In_Place_Expansion), and implies >= Ada 2005. (Is_Build_In_Place_Result_Type): New function to accompany Is_Build_In_Place_Function and Is_Build_In_Place_Function_Call, because sometimes we just have the type on our hands, not the function. For now, does the same thing as the old version, so build-in-place is disabled for nonlimited types, except that you can use -gnatd.9 to enable it. * exp_ch6.ads (Is_Build_In_Place_Result_Type): New function to accompany Is_Build_In_Place_Function and Is_Build_In_Place_Function_Call, because sometimes we just have the type on our hands, not the function. (Make_Build_In_Place_Call_In_...): Handle nonlimited build-in-place cases. (Make_Build_In_Place_Call_In_Object_Declaration): Remove the questionable code at the end that was setting the Etype. * exp_aggr.adb (Is_Build_In_Place_Aggregate_Return): New function to determine whether "return (...agg...);" is returning from a build-in-place function. (Initialize_Ctrl_Array_Component, Initialize_Ctrl_Record_Component): Remove assumption that b-i-p implies limited (initialization of In_Place_Expansion). (Build_Record_Aggr_Code): AI-287: fix comment; it can't be wrapped in an unchecked conversion. Add assertions. (Convert_Aggr_In_Object_Decl): Establish_Transient_Scope -- no need for secondary stack here, just because the type needs finalization. That code is obsolete. (Convert_To_Assignments): Only set Unc_Decl if Nkind (N) = N_Aggregate. For "return (...agg...);" don't assume b-i-p implies limited. Needs_Finalization does not imply secondary stack. (Expand_Array_Aggregate): Named notation. Reverse the sense of Component_OK_For_Backend -- more readability with fewer double negatives. * exp_attr.adb (Expand_N_Attribute_Reference): Remove assumptions that b-i-p implies >= Ada 2005. * exp_ch3.adb (Expand_N_Object_Declaration): Remove assumptions that b-i-p implies >= Ada 2005. Remove Adjust if we're building the return object of an extended return statement in place. * exp_ch4.adb (Expand_Allocator_Expression, Expand_N_Indexed_Component, Expand_N_Selected_Component, Expand_N_Slice): Remove assumptions that b-i-p implies >= Ada 2005. * exp_ch5.adb (Expand_N_Assignment_Statement): Remove assumption that b-i-p implies >= Ada 2005. * exp_ch7.adb: Comment fix. * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): Remove assumptions that b-i-p implies >= Ada 2005. * exp_disp.adb (Expand_Interface_Actuals): Remove assumptions that b-i-p implies >= Ada 2005. * exp_util.adb (Build_Allocate_Deallocate_Proc): Look at Storage_Pool (Expr), in case Pool_Id is not set. (Initialized_By_Aliased_BIP_Func_Call): Handle case where the call is qualified or converted. (Is_Secondary_Stack_BIP_Func_Call): Don't check if Nkind (Selector_Name (Param)) = N_Identifier; that's all it could be. * sinfo.ads: Comment fixes. * snames.ads-tmpl: Comment fixes. * debug.adb: Add flag gnatd.9, to enable the build-in-place machinery. From-SVN: r253290
2017-09-12[multiple changes]Arnaud Charlet1-1/+6
2017-09-12 Bob Duff <duff@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Initialize Def_Id to Empty. 2017-09-12 Georges-Axel Jaloyan <jaloyan@adacore.com> * debug.adb: Reserving flag -gnatdF for safe pointer checking. * gnat1drv.adb (gnat1drv): Adding the call to the analysis on dF flag. * sem_spark.adb, sem_spark.ads: Implementation of the analysis, in preparation for the evolution of the SPARK language that includes a pointer analysis for checking non-aliasing of access types. The Check_Safe_Pointers function is the entry point, and will traverse the AST and raise compile-time errors everytime it detects non-begign aliasing. Detailed comments are present in the sem_spark.ads file. * sem_util.adb, sem_util.ads (First_Global, Next_Global): New functions to iterate over the list of globals of a subprogram. * libgnat/system.ads: Add restriction No_Finalization. * gcc-interface/Make-lang.in: Add new file sem_spark.adb and dependency on g-dynhta.adb. From-SVN: r252000
2017-09-08[multiple changes]Arnaud Charlet1-1/+6
2017-09-08 Yannick Moy <moy@adacore.com> * sem_prag.adb: Use System.Case_Util.To_Lower to simplify code. 2017-09-08 Arnaud Charlet <charlet@adacore.com> * opt.ads (Include_Subprogram_In_Messages): New variable. * errout.ads (Current_Subprogram_Ptr): New variable. * errout.adb (Error_Msg): Prepend current subprogram info in messages if Include_Subprogram_In_Messages is set. * sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to Current_Subprogram. * gnat1drv.adb (Adjust_Global_Switches): Set Include_Subprogram_In_Messages when -gnatdJ is set. * debug.adb: Document and reserve -gnatdJ. 2017-09-08 Georges-Axel Jaloyan <jaloyan@adacore.com> * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New functions to iterate over simple hastables. (Load_Factor_HTable): Remove obsolete and inefficient implementation. 2017-09-08 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Unqual_BIP_Function_Call): Adding missing checks on the presence of Entity() before checking the entity attributes. 2017-09-08 Eric Botcazou <ebotcazou@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Reorder some statements, use local variable and remove unnecessary processing. From-SVN: r251880
2017-09-08sem_ch3.adb, [...]: Remove references to Frontend_Layout_On_Target and ↵Arnaud Charlet1-5/+1
remaining references to... 2017-09-08 Arnaud Charlet <charlet@adacore.com> * sem_ch3.adb, layout.adb, layout.ads, exp_attr.adb, debug.adb, exp_pakd.adb, sem_prag.adb, gnat1drv.adb, targparm.adb, targparm.ads, repinfo.adb, exp_ch6.adb, exp_aggr.adb, sem_eval.adb, sem_ch13.adb, exp_ch3.adb: Remove references to Frontend_Layout_On_Target and remaining references to AAMP_On_Target. From-SVN: r251877
2017-09-08[multiple changes]Arnaud Charlet1-1/+1
2017-09-08 Bob Duff <duff@adacore.com> * s-trasym.ads (Hexa_Traceback): If Suppress_Hex is True, print "..." instead of a hexadecimal address. * s-trasym.adb: Ignore No_Hex in this version. Misc cleanup. 2017-09-08 Bob Duff <duff@adacore.com> * debug.adb: Minor reformatting. 2017-09-08 Bob Duff <duff@adacore.com> * a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the code so it doesn't trigger an "uninit var" warning. 2017-09-08 Nicolas Roche <roche@adacore.com> * s-hibaen.ads: Remove obsolete file. 2017-09-08 Arnaud Charlet <charlet@adacore.com> * a-locale.ads: Add comment explaining the state of this package. 2017-09-08 Arnaud Charlet <charlet@adacore.com> * sem_util.adb (Is_CCT_Instance): Allow calls in the context of packages. * sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body): allow calls in the context of package spec (for pragma Initializes) and bodies (for pragma Refined_State). 2017-09-08 Bob Duff <duff@adacore.com> * checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the new Exp. From-SVN: r251875
2017-09-08[multiple changes]Arnaud Charlet1-1/+1
2017-09-08 Eric Botcazou <ebotcazou@adacore.com> * debug.adb (dA): Adjust comment. * gnat1drv.adb (Gnat1drv): Likewise. * opt.ads (List_Representation_Info_Extended): New variable. * repinfo.adb (List_Record_Info): Split implementation into... (Compute_Max_Length): ...this. Recurse on records if requested. (List_Record_Layout): Likewise. * switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case statement, accept '0' and set List_Representation_Info_Extended on 'e'. * usage.adb (Usage): Document new -gnatRe variant. 2017-09-08 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool): Do not save the given entity in the global variable Default_Pool if the pragma appears within a generic unit. 2017-09-08 Bob Duff <duff@adacore.com> * errout.adb (Delete_Warning): Do not decrement Warnings_Treated_As_Errors. This is called before Warnings_Treated_As_Errors has been incremented to account for this warning. Decrementing it here can lead to negative values of Warnings_Treated_As_Errors, raising Constraint_Error in checks-on builds, and causing the compiler to return an error code in checks-off builds. From-SVN: r251873
2017-09-08[multiple changes]Arnaud Charlet1-1/+1
2017-09-08 Arnaud Charlet <charlet@adacore.com> * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect entities of named concurrent types as Ref_Id and not of anonymous concurrent objects (because callers already know when a conversion is necessary and can easily do it); also, do not expect protected types or protected objects as Context_Id (because no flow-related SPARK pragmas are attached there); reflect these changes in a more precise comment. 2017-09-08 Olivier Hainque <hainque@adacore.com> * g-altive.ads: Add documentation. 2017-09-08 Bob Duff <duff@adacore.com> * sem_util.ads, debug.adb: Minor comment fix. * erroutc.ads: Comment fix. 2017-09-08 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Validate_Array_Type_Instance): Suppress check for compatibility of component types of formal and actual in an instantiation of a child unit, when the component type of the formal is itself a formal of an enclosing generic. From-SVN: r251872
2017-09-07[multiple changes]Arnaud Charlet1-1/+7
2017-09-07 Yannick Moy <moy@adacore.com> * a-exetim-mingw.ads: Add contract Global=>null on all operations that are modeled as having no read or write of global variables in SPARK. 2017-09-07 Raphael Amiard <amiard@adacore.com> * a-chtgop.adb, a-chtgop.ads (Generic_Iteration_With_Position): Added to Hmaps.Generic_Ops. * a-cohama.adb (Ada.Containers.Hmaps.Iterate): Pass proper position in cursors. * a-cihama.adb (Ada.Containers.Indefinite_Hmaps.Iterate): Pass pos in cursors. * a-cohase.adb (Ada.Containers.Hashed_Sets.Iterate): Pass proper position in cursors. 2017-09-07 Javier Miranda <miranda@adacore.com> * sem_elab.adb (Check_Task_Activation): Adding switch -gnatd.y to allow disabling the generation of implicit pragma Elaborate_All on task bodies. 2017-09-07 Javier Miranda <miranda@adacore.com> * exp_disp.adb (Make_Tags): Avoid suffix counter in the external name of the elaboration flag. Required to fix the regressions introduced by the initial version of this patch. 2017-09-07 Bob Duff <duff@adacore.com> * sem_ch6.adb (Analyze_Function_Return): Do not insert an explicit conversion to force the displacement of the "this" pointer to reference the secondary dispatch table in the case where the return statement is returning a raise expression, as in "return raise ...". 2017-09-07 Arnaud Charlet <charlet@adacore.com> * sem_disp.adb (Is_User_Defined_Equality): Removed procedure. * sem_util.ads, sem_util.adb (Is_User_Defined_Equality): Copied procedure from sem_disp.adb. * sem_ch12.ads (Get_Unit_Instantiation_Node): rename Package with Unit. * sem_ch12.adb (Get_Unit_Instantiation_Node): function extended to return the instantiation node for subprograms. Update references to Get_Unit_Instantiation_Node. * sem_ch7.adb (Install_Parent_Private_Declarations): update reference to Get_Unit_Instantiation_Node. * exp_dist.adb (Build_Package_Stubs): update reference to Get_Unit_Instantiation_Node. * sem_ch9.adb: minor typo in comment. * lib-xref-spark_specific.adb (Traverse_Declaration_Or_Statement): traverse into task type definition. 2017-09-07 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Analyze_Dimension_Type_Conversion): New procedure to handle properly various cases of type conversions where the target type and/or the expression carry dimension information. (Dimension_System_Root); If a subtype carries dimension information, obtain the source parent type that carries the Dimension aspect. 2017-09-07 Dmitriy Anisimkov <anisimko@adacore.com> * g-socket.adb, g-socket.ads (GNAT.Sockets.To_Ada): New routine. 2017-09-07 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained): If the prefix is a reference to an object, rewrite it as an explicit dereference, as required by 3.7.2 (2) and as is done with most other attributes whose prefix is an access value. 2017-09-07 Bob Duff <duff@adacore.com> * par-ch13.adb: Set the Inside_Depends flag if we are inside a Refined_Depends aspect. * par-ch2.adb: Set the Inside_Depends flag if we are inside a Refined_Depends pragma. * scans.ads: Fix documentation of Inside_Depends flag. * styleg.adb, styleg.ads: Minor reformatting and comment fixes. 2017-09-07 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Insert_Actions_In_Scope_Around): Account for the case where the are no lists to insert, but the secondary stack still requires management. * a-chtgop.adb, a-cihama.adb, a-cohama.adb, a-cohase.adb, a-tags.adb, comperr.adb, einfo.adb, exp_aggr.adb, exp_ch3.adb, exp_disp.adb, lib-xref.adb, lib-xref-spark_specific.adb, sem_ch12.adb, sem_ch13.adb, sem_ch6.adb, sem_dim.adb, sem_dim.ads, sem_elab.adb, sem_prag.adb: Minor reformatting. From-SVN: r251842
2017-09-06[multiple changes]Arnaud Charlet1-7/+3
2017-09-06 Eric Botcazou <ebotcazou@adacore.com> * ali.ads (ALIs_Record): Add No_Component_Reordering component. (No_Component_Reordering_Specified): New switch. * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified. (Scan_ALI): Set No_Component_Reordering and deal with NC marker. * bcheck.adb (Check_Consistent_No_Component_Reordering): New check. (Check_Configuration_Consistency): Invoke it. * debug.adb (d.r): Toggle the effect of the switch. (d.v): Change to no-op. * einfo.ads (Has_Complex_Representation): Restrict to record types. (No_Reordering): New alias for Flag239. (OK_To_Reorder_Components): Delete. (No_Reordering): Declare. (Set_No_Reordering): Likewise. (OK_To_Reorder_Components): Delete. (Set_OK_To_Reorder_Components): Likewise. * einfo.adb (Has_Complex_Representation): Expect record types. (No_Reordering): New function. (OK_To_Reorder_Components): Delete. (Set_Has_Complex_Representation): Expect base record types. (Set_No_Reordering): New procedure. (Set_OK_To_Reorder_Components): Delete. (Write_Entity_Flags): Adjust to above change. * fe.h (Debug_Flag_Dot_R): New macro and declaration. * freeze.adb (Freeze_Record_Type): Remove conditional code setting OK_To_Reorder_Components on record types with convention Ada. * lib-writ.adb (Write_ALI): Deal with NC marker. * opt.ads (No_Component_Reordering): New flag. (No_Component_Reordering_Config): Likewise. (Config_Switches_Type): Add No_Component_Reordering component. * opt.adb (Register_Opt_Config_Switches): Copy No_Component_Reordering onto No_Component_Reordering_Config. (Restore_Opt_Config_Switches): Restore No_Component_Reordering. (Save_Opt_Config_Switches): Save No_Component_Reordering. (Set_Opt_Config_Switches): Set No_Component_Reordering. * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering. * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the No_Reordering flag from the default. (Build_Derived_Private_Type): Likewise. (Build_Derived_Record_Type): Likewise. Then inherit it for untagged types and clean up handling of similar flags. (Record_Type_Declaration): Likewise. * sem_ch13.adb (Same_Representation): Deal with No_Reordering and remove redundant test on Is_Tagged_Type. * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering. (Sig_Flags): Likewise. * snames.ads-tmpl (Name_No_Component_Reordering): New name. (Pragma_Id): Add Pragma_No_Component_Reordering value. * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Copy the layout of the parent type only if the No_Reordering settings match. (components_to_record): Reorder record types with convention Ada by default unless No_Reordering is set or -gnatd.r is specified and do not warn if No_Reordering is set in GNAT mode. 2017-09-06 Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure): new predicate to reject declarations that can be completions, when there is a visible prior homograph that is a null procedure. * sem_ch6.adb (Analyze_Null_Procedure): use it. * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto. 2017-09-06 Thomas Quinot <quinot@adacore.com> * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal run of 253 characters or more. From-SVN: r251760
2017-04-27[multiple changes]Arnaud Charlet1-2/+2
2017-04-27 Steve Baird <baird@adacore.com> * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel flag when it is declared in order to avoid confusing CodePeer about the possibility of an uninitialized variable read. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is no dimensionality error if the subtype of the expression is identical to the nominal subtype in the declaration, even though the expression itself may have been constant-folded and lack a dimension vector. * sem_dim.ads: Add comments on setting of dimension vectors and its interaction with node rewritings and side-effect removal. 2017-04-27 Bob Duff <duff@adacore.com> * debug.adb: Minor comment correction. * sem_dim.ads: Minor reformatting and typo fixes. 2017-04-27 Bob Duff <duff@adacore.com> * g-table.adb, g-table.adsa, scos.h: From the C side, access First and Last of the tables via function calls, rather than relying on layout of data structures. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * exp_util.adb: No wrapper in GNATprove mode. 2017-04-27 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Comparison_Op): Always evaluate comparisons between values of universal types. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_elab.adb (Check_Internal_Call_Continue): Do not generate an elaboration counter nor a check when in GNATprove mode. * sem_util.adb (Build_Elaboration_Entity): Do not create an elaboration counter when in GNATprove mode. From-SVN: r247317
2017-04-27[multiple changes]Arnaud Charlet1-1/+6
2017-04-27 Steve Baird <baird@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Add "Suppress => All_Checks" to avoid generating unnecessary checks. 2017-04-27 Yannick Moy <moy@adacore.com> * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove. * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of inlining body in GNATprove mode when switch -gnatdm used. * sem_res.adb (Resolve_Call): Skip detection of lack of inlining in GNATprove mode when switch -gnatdm used. 2017-04-27 Arnaud Charlet <charlet@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause [Attribute_Address]): Call Set_Address_Taken when ignoring rep clauses, so that we keep an indication of the address clause before removing it from the tree. From-SVN: r247312
2017-04-27[multiple changes]Arnaud Charlet1-1/+6
2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem.adb (Analyze): Diagnose an illegal iterated component association. * sem_util.ads, sem_util.adb (Diagnose_Iterated_Component_Association): New routine. 2017-04-27 Bob Duff <duff@adacore.com> * adaint.c (__gnat_get_current_dir): Return 0 in length if getcwd fails. * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise exception if getcwd failed. 2017-04-27 Yannick Moy <moy@adacore.com> * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost entities with special prefix. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb Change the documentation of switch -gnatd.s. * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need to manage the secondary stack when an enclosing scope already performs this functionality (aka relaxed management). Switch -gnatd.s may be used to force strict management in which case the block will manage the secondary stack unconditionally. Add a guard to stop the traversal when encountering a package or a subprogram scope. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Call): Refine further the handling of limited views of return types in function calls. If the function that returns a limited view appears in the current unit, we do not replace its type by the non-limited view because this transformation is performed int the back-end. However, the type of the call itself must be the non-limited view, to prevent spurious resolution errors. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds): Removed, proposed implementation using generics for class-wide preconditions proved impractical. (Class_Wide_Clone): New attribute of subprogram. Designates subprogram created for primitive operations with class-wide pre/postconditions that contain calls to other primitives. The clone holds the body of the original primitive, but the pre/postonditions do not apply to it. The original body is rewritten as a wrapper for a call to the clone. (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If the flag is set, no code for the corresponding pre/postconditions is inserted into its body. 2017-04-27 Bob Duff <duff@adacore.com> * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore Scalar_Storage_Order if -gnatI is given. * sem_prag.adb (Analyze_Pragma): Ignore Default_Scalar_Storage_Order if -gnatI is given. From-SVN: r247298
2017-04-27[multiple changes]Arnaud Charlet1-2/+7
2017-04-27 Gary Dismukes <dismukes@adacore.com> * sem_ch4.adb: Minor reformatting. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Associations): minor reformatting. (Check_Fixed_Point_Actual): Do not emit a warning on a fixed point type actual that has user-defined arithmetic primitives, when there is a previous actual for a formal package that defines a fixed-point type with the parent user-defined operator. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Generate_Range_Check): Reinstate part of previous change. * sem_attr.adb (Resolve_Attribute): Generate a range check when the component type allows range checks. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_aux.adb (Is_Generic_Formal): Use original node to locate corresponding declaration, because formal derived types are rewritten as private extensions. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check dimensions of operands if node has been analyzed already, because previous analysis and dimension checking will have removed the dimension information from the operands. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Document the use of switch -gnatd.s. * einfo.ads Update the documentation on attribute Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove the uses of these attributes from certain entities. * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry which determines whether the block should continue to manage the secondary stack. (Manages_Sec_Stack): New routine. 2017-04-27 Bob Duff <duff@adacore.com> * atree.ads: Minor edit. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sinfo.ads: Update the section on Ghost mode. Add a section on SPARK mode. Update the placement of section on expression functions. 2017-04-27 Bob Duff <duff@adacore.com> * sinput.adb (Get_Source_File_Index): Don't assert that S is in the right range in the case where this is a .dg file under construction. 2017-04-27 Yannick Moy <moy@adacore.com> * sem_util.adb (Check_Result_And_Post_State): Handle more precisely each conjunct in expressions formed by and'ing sub-expressions. From-SVN: r247295
2017-04-25[multiple changes]Arnaud Charlet1-3/+10
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting. 2017-04-25 Bob Duff <duff@adacore.com> * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset Is_True_Constant for an array variable that is passed to a foreign function as an 'in' parameter. * debug.adb: Document -gnatd.q. From-SVN: r247218
2017-04-25sem_prag.adb (No_Return): Give an error if the pragma applies to a body.Bob Duff1-1/+6
2017-04-25 Bob Duff <duff@adacore.com> * sem_prag.adb (No_Return): Give an error if the pragma applies to a body. Specialize the error for the specless body case, as is done for (e.g.) pragma Convention. * debug.adb: Add switch -gnatd.J to disable the above legality checks. This is mainly for use in our test suite, to avoid rewriting a lot of illegal (but working) code. It might also be useful to customers. Under this switch, if a pragma No_Return applies to a body, and the procedure raises an exception (as it should), the pragma has no effect. If the procedure does return, execution is erroneous. 2017-04-25 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_Actuals): This is the root of the problem. It took N as an 'in out' parameter, and in some cases, rewrote N, but then set N to Original_Node(N). So the node returned in N had no Parent. The caller continued processing of this orphaned node. In some cases that caused a crash (e.g. Remove_Side_Effects climbs up Parents in a loop, and trips over the Empty Parent). The solution is to make N an 'in' parameter. Instead of rewriting it, return the list of post-call actions, so the caller can do the rewriting later, after N has been fully processed. (Expand_Call_Helper): Move most of Expand_Call here. It has too many premature 'return' statements, and we want to do the rewriting on return. (Insert_Post_Call_Actions): New procedure to insert the post-call actions in the appropriate place. In the problematic case, that involves rewriting N as an Expression_With_Actions. (Expand_Call): Call the new procedures Expand_Call_Helper and Insert_Post_Call_Actions. From-SVN: r247178
2017-04-25[multiple changes]Arnaud Charlet1-3/+3
2017-04-25 Bob Duff <duff@adacore.com> * freeze.adb (Freeze_Record_Type): Use the underlying type of the component type to determine whether it's elementary. For representation clause purposes, a private type should behave the same as its full type. * fname.ads, fname.adb (Is_Predefined_File_Name): Make sure things like "system.ali" are recognized as predefined. 2017-04-25 Javier Miranda <miranda@adacore.com> * debug.adb: Update documentation of -gnatd.6. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012 element iterator when the name is an overloaded function call, one of whose interpretations yields an array. From-SVN: r247155
2017-01-23[multiple changes]Arnaud Charlet1-1/+1
2017-01-23 Gary Dismukes <dismukes@adacore.com> * a-calend.adb, prep.adb, debug.adb, prj.ads, prepcomp.adb, exp_disp.adb, s-imgrea.adb, g-socket.adb, g-socket.ads, sem_ch13.adb, prj-tree.ads: Minor spelling change for consistency (behaviour -> behavior). 2017-01-23 Ed Schonberg <schonberg@adacore.com> * scng.adb (Scan): Use Ada version Ada_2020 to flag use of Target_Name. * par-ch4.adb (P_Primary): Ditto. * opt.ads: Add Ada_2020 (optimistically) to enumeration list of Ada_Version_Type. * switch-c.adb (Scan_Front_End_Switches): Recognize -gnat2020 for new Ada version Ada_2020. 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Expand_Loop_Entry_Attribute): Force the generation of a nominal type for the constant which captures the value of the attribute prefix. Various clean ups. * sem_attr.adb (Analyze_Attribute): Clean up the processing of 'Loop_Entry. 2017-01-23 Yannick Moy <moy@adacore.com> * sem_util.adb (Has_Enabled_Property): Treat protected objects and variables differently from other variables. From-SVN: r244787
2017-01-23sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Split original Ada 95 ↵Thomas Quinot1-1/+5
part off into new subprogram below. 2017-01-23 Thomas Quinot <quinot@adacore.com> * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Split original Ada 95 part off into new subprogram below. Call that subprogram (instead of proceeding with AI95-0133 behaviour) if debug switch -gnatd.p is in use. (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram * debug.adb Document new switch -gnatd.p * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust record for reverse bit order if an error has already been posted on the record type. This avoids generating extraneous "info:" messages for illegal code. From-SVN: r244786
2017-01-20[multiple changes]Arnaud Charlet1-1/+5
2017-01-20 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check for illegal inherited Implicit_Dereference aspects with renamed discriminants. 2017-01-20 Javier Miranda <miranda@adacore.com> * debug.adb (switch d.6): do not avoid declaring unreferenced itypes. * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms. * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms. (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent, Set_Prev, Tree_Read): Adding assertion. * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms. * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms. (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source, Set_Ekind, Set_Error_Posted, Set_Has_Aspects, Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count, Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN, Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN, Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent, Set_ListN_With_Parent): Adding assertion. 2017-01-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Process_Convention): Diagnose properly a pragma import that applies to several homograph subprograms. when one of them is declared by a subprogram body. 2017-01-20 Justin Squirek <squirek@adacore.com> * exp_ch6.adb (Expand_Call): Remove optimization that nulls out calls to null procedures. From-SVN: r244699
2017-01-19[multiple changes]Arnaud Charlet1-6/+5
2017-01-19 Javier Miranda <miranda@adacore.com> * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as Build_Back_End_Aggregate. (Generate_Aggregate_For_Derived_Type): Code cleanup. (Prepend_Stored_Values): Code cleanup. 2017-01-19 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Check for an incomplete return type after attempting to freeze it, so that other freeze actiona are generated in the proper order. 2017-01-19 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Resolve_Aggregate): If the type is a string type, ie. a type whose component is a character type, and the aggregate is positional, do not convert into a string literal if the index type is not an integer type, because the original type may be required in an enclosing operation. 2017-01-19 Bob Duff <duff@adacore.com> * binde.adb, debug.adb: Enable new elaboration order algorithm by default. -dp switch reverts to the old algorithm. 2017-01-19 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb Add with and use clauses for Exp_Ch7. (Analyze_Declarations): Create the DIC and Invariant procedure bodies s after all freezing has taken place. (Build_Assertion_Bodies): New routine. * sem_ch7.adb Remove the with and use clauses for Exp_Ch7 and Exp_Util. (Analyze_Package_Specification): Remove the generation of the DIC and Invariant procedure bodies. This is now done by Analyze_Declarations. * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant procedures are never treated as primitives. 2017-01-19 Yannick Moy <moy@adacore.com> * frontend.adb: Analyze inlined bodies and check elaboration rules in GNATprove mode too. * sem_elab.adb (Delay_Element): Add Boolean component to save indication that call is in SPARK code. (Check_Elab_Calls): Check elaboration rules in GNATprove mode, and correctly set the current value of SPARK_Mode. * lib-xref-spark_specific.adb (Add_SPARK_Xrefs): Simplify iteration over dereferences. 2017-01-19 Ed Schonberg <schonberg@adacore.com> * exp_ch4.adb (Expand_Concatenate): Do no enable overflow checks on the expression for the high bound of concatenation when checks are disabled, to suppress warnings about potential constraint errors in restricted runtimes. From-SVN: r244626
2017-01-13[multiple changes]Arnaud Charlet1-4/+15
2017-01-13 Javier Miranda <miranda@adacore.com> * einfo.ads (Component_Bit_Offset): Fix documentation. * sem_ch13.adb (Check_Record_Representation_Clause): Skip check on record holes for components with unknown compile-time offsets. 2017-01-13 Bob Duff <duff@adacore.com> * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag. * g-locfil.ads: Minor comment fix. 2017-01-13 Bob Duff <duff@adacore.com> * binde.adb (Elab_New): New elaboration order algorithm that is expected to cause fewer ABE issues. This is a work in progress. The new algorithm is currently disabled, and can be enable by the -dp switch, or by modifying the Do_Old and Do_New etc. flags and rebuilding. Experimental code is included to compare the results of the old and new algorithms. * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we can have multiple of these tables, so the old and new algorithms can coexist. * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in' parameter of type array. This avoids the global variable, and allows bounds checking (which is normally defeated by the tables packages). It also ensures that the Elab_Order is read-only to Bindgen. * bindgen.adb: Pass Elab_Order as an 'in' parameter to all subprograms that need it, as above. * debug.adb: Document new -dp switch. Modify doc of old -do switch. * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde and Bindgen. Move writing of closure (-R and -Ra switches) to Binde; that's more convenient. 2017-01-13 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): If the expression function is a completion, all entities referenced in the expression are frozen. As a consequence, a reference to an uncompleted private type from an enclosing scope is illegal. From-SVN: r244419
2017-01-12exp_ch9.adb, [...]: Minor reformatting.Gary Dismukes1-3/+2
2017-01-12 Gary Dismukes <dismukes@adacore.com> * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor reformatting. * debug.adb: Minor comment fixes. From-SVN: r244360
2017-01-12[multiple changes]Arnaud Charlet1-5/+1
2017-01-12 Arnaud Charlet <charlet@adacore.com> * sem_util.adb (Unique_Entity): For concurrent bodies that are defined with stubs and complete a declaration of a single concurrent object return the entity of an implicit concurrent type, not the entity of the anonymous concurrent object. * debug.adb: -gnatd.J is no longer used. * make.adb (Globalize): Removed, no longer used. * sem_ch9.adb: minor typo in comment for entry index 2017-01-12 Patrick Bernardi <bernardi@adacore.com> * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size. * exp_ch3.adb (Build_Init_Statements): As part of initialising the value record of a task, set its _Secondary_Stack_Size field if present. * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create a _Secondary_Stack_Size field in the value record of the task if a Secondary_Stack_Size rep item is present. (Make_Task_Create_Call): Include secondary stack size parameter. If No_Secondary_Stack restriction is in place, passes stack size of 0. * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma Secondary_Stack_Size. * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New function to define the overhead of the secondary stack. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Functions now include Secondary_Stack_Size parameter to pass to Initialize_ATCB. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New Secondary_Stack_Size component. * s-tassta.adb, s-tassta.ads (Create_Restricted_Task, Create_Restricted_Task_Sequential): Function now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call to include Secondary_Stack_Size parameter. * sem_ch13.adb (Analyze_Aspect_Specification): Add support for Secondary_Stack_Size aspect, turning the aspect into its corresponding internal attribute. (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute. * snames.adb-tmpl, snames.ads-tmpl: Added names Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size, Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size. From-SVN: r244358
2017-01-12[multiple changes]Arnaud Charlet1-1/+8
2017-01-12 Yannick Moy <moy@adacore.com> * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied subtree. 2017-01-12 Justin Squirek <squirek@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Fix Finalization_Size case by properly resolving the type after rewritting the node. 2017-01-12 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into the tree. (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree. * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb, exp_sel.ads: Minor reformatting. 2017-01-12 Justin Squirek <squirek@adacore.com> * exp_ch6.adb (Expand_Call): Add guard to prevent invariant checks from being created for internally generated subprograms. 2017-01-12 Bob Duff <duff@adacore.com> * lib-writ.ads: Remove incorrect comment. 2017-01-12 Javier Miranda <miranda@adacore.com> * debug.adb (-gnatd.K): Enable generation of contract-only procedures in CodePeer mode. * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms): New subprogram. (Analyze_Contracts): Generate contract-only procedures if -gnatdK is set. * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New subprogram. (Get_Contract_Only_Missing_Body_Name): New subprogram. (Get_Contract_Only_Body): New subprogram. (Set_Contract_Only_Body): New subprogram. (Is_Contract_Only_Body): New subprogram. (Set_Is_Contract_Only_Body): New subprogram. (SCIL_Nodes): Replace table by hash-table. From-SVN: r244356
2016-10-13[multiple changes]Arnaud Charlet1-5/+1
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Remove the aspects of the original expression function has been rewritten into a subprogram declaration or a body. Reinsert the aspects once they have been analyzed. 2016-10-13 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Expand_N_Asynchronous_Select): Return immediately on restricted profile. 2016-10-13 Javier Miranda <miranda@adacore.com> * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Register the pragma for its validation after the backend has been called only if its expression has some occurrence of attributes 'size or 'alignment * table.ads (Release_Threshold): New formal. (Release): Adding documentation of its new functionality. * table.adb (Release): Extend its functionality with a Release_Threshold. * nlists.adb (Next_Node table): Set its Release_Threshold. * atree.adb (Orig_Nodes table): Set its Release_Threshold. * atree.ads (Nodes table): Set its Release_Threshold. (Flags table): Set its Release_Threshold. * alloc.ads (Nodes_Release_Threshold): New constant declaration. (Orig_Nodes_Release_Threshold): New constant declaration. * debug.adb (switch d.9): Left free. * gnat1drv.adb (Post_Compilation_Validation_Checks): Enable validation of pragmas Compile_Time_Error and Compile_Time_Warning. From-SVN: r241117
2016-10-13[multiple changes]Arnaud Charlet1-1/+5
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Create_Extra_Formals): Generate an Itype reference for the object extra formal in case the subprogram is called within the same or nested scope. 2016-10-13 Claire Dross <dross@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Also create a renaming in GNATprove mode. 2016-10-13 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Fixed_Point_Type): in SPARK mode, the given bounds of the type must be strictly representable, and the range reduction by one delta ("shaving") allowed by the Ada RM, is not applicable in SPARK. 2016-10-13 Javier Miranda <miranda@adacore.com> * debug.adb (switch d.9): Used to temporarily disable the support needed for this enhancement since it causes regressions with large sources. * gnat1drv.adb (Post_Compilation_Validation_Checks): Temporarily leave the validation of pragmas Compile_Time_Warning and Compile_Time_Error under control of -gnatd.9/ From-SVN: r241115
2016-06-22[multiple changes]Arnaud Charlet1-1/+4
2016-06-22 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Is_Predicate_Static): An inherited predicate can be static only if it applies to a scalar type. 2016-06-22 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Adjust_Result_Type): Convert operand to base type to prevent spurious constraint checks on subtypes of Boolean. 2016-06-22 Bob Duff <duff@adacore.com> * debug.adb: Document debug switch -gnatd.o. * sem_elab.adb (Check_Internal_Call): Debug switch -gnatd.o now causes a more conservative treatment of indirect calls, treating P'Access as a call to P in more cases. We Can't make this the default, because it breaks common idioms, for example the soft links. * sem_util.adb: Add an Assert. 2016-06-22 Bob Duff <duff@adacore.com> * a-cuprqu.ads, a-cuprqu.adb: Completely rewrite this package. Use red-black trees, which gives O(lg N) worst-case performance on Enqueue and Dequeue. The previous version had O(N) Enqueue in the worst case. 2016-06-22 Arnaud Charlet <charlet@adacore.com> * sem_warn.adb: minor style fix in comment. * spark_xrefs.ads (Scope_Num): type refined to positive integers. * lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs. (Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs; now uses Dspec and Scope_Id from Collect_SPARK_Xrefs. (Collect_SPARK_Xrefs): refactored to avoid retraversing the list of scopes. * sem_ch3.adb (Build_Discriminal): Set Parent of the discriminal. From-SVN: r237687
2016-05-02[multiple changes]Arnaud Charlet1-1/+7
2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_prag.adb, comperr.adb: Minor reformatting. 2016-05-02 Ed Schonberg <schonberg@adacore.com> * exp_pakd.adb (Rj_Unchecked_Convert_To): Do not perform an unchecked conversion if the source size is 0 (indicating that its RM size is unknown). This will happen with packed arrays of non-discrete types, in which case the component type is known to match. 2016-05-02 Arnaud Charlet <charlet@adacore.com> * debug.adb: Reserve -gnatd.V. 2016-05-02 Javier Miranda <miranda@adacore.com> * sem_ch3.adb (Process_Full_View): Remove from visibility wrappers of synchronized types to avoid spurious errors with their wrapped entity. * exp_ch9.adb (Build_Wrapper_Spec): Do not generate the wrapper if no interface primitive is covered by the subprogram and this is not a primitive declared between two views; see Process_Full_View. (Build_Protected_Sub_Specification): Link the dispatching subprogram with its original non-dispatching protected subprogram since their names differ. (Expand_N_Protected_Type_Declaration): If a protected subprogram overrides an interface primitive then do not build a wrapper if it was already built. * einfo.ads, einfo.adb (Original_Protected_Subprogram): New attribute. * sem_ch4.adb (Names_Match): New subprogram. * sem_ch6.adb (Check_Synchronized_Overriding): Moved to library level and defined in the public part of the package to invoke it from Exp_Ch9.Build_Wrapper_Spec (Has_Matching_Entry_Or_Subprogram): New subprogram. (Report_Conflict): New subprogram. From-SVN: r235739
2016-05-02[multiple changes]Arnaud Charlet1-1/+4
2016-05-02 Tristan Gingold <gingold@adacore.com> * sem_ch3.adb (Analyze_Object_Declaration): Use Has_Protected to check for the no local protected objects restriction. 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb Anonymous_Master now uses Node35. (Anonymous_Master): Update the assertion and node reference. (Set_Anonymous_Master): Update the assertion and node reference. (Write_Field35_Name): Add output for Anonymous_Master. (Write_Field36_Name): The output is now undefined. * einfo.ads Update the node and description of attribute Anonymous_Master. Remove prior occurrences in entities as this is now a type attribute. * exp_ch3.adb (Expand_Freeze_Array_Type): Remove local variable Ins_Node. Anonymous access- to-controlled component types no longer need finalization masters. The master is now built when a related allocator is expanded. (Expand_Freeze_Record_Type): Remove local variable Has_AACC. Do not detect whether the record type has at least one component of anonymous access-to- controlled type. These types no longer need finalization masters. The master is now built when a related allocator is expanded. * exp_ch4.adb Remove with and use clauses for Lib and Sem_Ch8. (Current_Anonymous_Master): Removed. (Expand_N_Allocator): Call Build_Anonymous_Master to create a finalization master for an anonymous access-to-controlled type. * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call): Call routine Build_Anonymous_Master to create a finalization master for an anonymous access-to-controlled type. * exp_ch7.adb (Allows_Finalization_Master): New routine. (Build_Anonymous_Master): New routine. (Build_Finalization_Master): Remove formal parameter For_Anonymous. Use Allows_Finalization_Master to determine whether circumstances warrant a finalization master. This routine no longer creates masters for anonymous access-to-controlled types. (In_Deallocation_Instance): Removed. * exp_ch7.ads (Build_Anonymous_Master): New routine. (Build_Finalization_Master): Remove formal parameter For_Anonymous and update the comment on usage. * sem_util.adb (Get_Qualified_Name): New routines. (Output_Name): Reimplemented. (Output_Scope): Removed. * sem_util.ads (Get_Qualified_Name): New routines. 2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Document the use of switch -gnatd.H. * gnat1drv.adb (Adjust_Global_Switches): Set ASIS_GNSA mode when -gnatd.H is present. (Gnat1drv): Suppress the call to gigi when ASIS_GNSA mode is active. * opt.ads: Add new option ASIS_GNSA_Mode. * sem_ch13.adb (Alignment_Error): New routine. (Analyze_Attribute_Definition_Clause): Suppress certain errors in ASIS mode for attribute clause Alignment, Machine_Radix, Size, and Stream_Size. (Check_Size): Use routine Size_Too_Small_Error to suppress certain errors in ASIS mode. (Get_Alignment_Value): Use routine Alignment_Error to suppress certain errors in ASIS mode. (Size_Too_Small_Error): New routine. From-SVN: r235732
2016-05-02[multiple changes]Arnaud Charlet1-12/+6
2016-05-02 Arnaud Charlet <charlet@adacore.com> * exp_ch5.adb, layout.adb, gnatcmd.adb exp_attr.adb, make.adb, bindgen.adb, debug.adb, exp_pakd.adb, freeze.adb, sem_util.adb, gnatlink.adb, switch-m.adb, exp_ch4.adb, repinfo.adb, adabkend.adb, osint.adb: Remove dead code. 2016-05-02 Yannick Moy <moy@adacore.com> * a-tigeli.adb (Get_Line): Fix bound for test to decide when to compensate for character 0 added by call to fgets. From-SVN: r235710
2016-04-18Minor editing.Arnaud Charlet1-1/+1
From-SVN: r235143
2016-04-18[multiple changes]Arnaud Charlet1-1/+4
2016-04-18 Arnaud Charlet <charlet@adacore.com> * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New. * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them. * debug.adb: Reserve -gnatd.4 to force generation of C files. 2016-04-18 Yannick Moy <moy@adacore.com> * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static division by zero, instead possibly issue a warning. * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on static division by zero, instead add check flag on original expression. * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error): Only issue error when both SPARK_Mode is On and Warn is False. 2016-04-18 Yannick Moy <moy@adacore.com> * checks.adb (Apply_Scalar_Range_Check): Force warning instead of error when SPARK_Mode is On, on index out of bounds, and set check flag for GNATprove. From-SVN: r235138
2015-10-26debug.adb: Introduce debug flag -gnatd.5.Arnaud Charlet1-1/+5
2015-10-26 Arnaud Charlet <charlet@adacore.com> * debug.adb: Introduce debug flag -gnatd.5. From-SVN: r229349
2015-10-23[multiple changes]Arnaud Charlet1-7/+1
2015-10-23 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Switch -gnatd.5 is no longer in use, remove the associated documentation. * exp_dbug.adb (Get_External_Name): Do not add a special prefix for ignored Ghost entities or when switch -gnatd.5 is enabled. * exp_dbug.ads Remove the documentation concerning the encoding of ignored Ghost entities. 2015-10-23 Bob Duff <duff@adacore.com> * a-exextr.adb (Notify_Exception): For Unhandled_Raise_In_Main, mimic the output from Ada.Exceptions.Last_Chance_Handler; don't print "Exception raised". * s-stalib.ads, s-exctra.ads, s-exctra.adb: Add Unhandled_Raise_In_Main to types Exception_Trace_Kind/Trace_Kind. From-SVN: r229246
2015-10-23[multiple changes]Arnaud Charlet1-1/+7
2015-10-23 Bob Duff <duff@adacore.com> * exp_strm.adb (Build_Record_Or_Elementary_Input_Function): Use Underlying_Type for B_Typ, in case the Typ is a subtype of a type with unknown discriminants. * g-awk.ads: Minor style fix in comment 2015-10-23 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Document the use of debug switch -gnatd.5. * einfo.adb: Code reformatting. (Is_Ghost_Entity): Moved from ghost.adb. * einfo.ads New synthesized attribute Is_Ghost_Enity along with usage in nodes and pragma Inline. (Is_Ghost_Entity: Moved from ghost.ads. * exp_ch3.adb Code reformatting. (Expand_Freeze_Array_Type): Capture, set and restore the Ghost mode. (Expand_Freeze_Class_Wide_Type): Capture, set and restore the Ghost mode. (Expand_Freeze_Enumeration_Type): Capture, set and restore the Ghost mode. (Expand_Freeze_Record_Type): Capture, set and restore the Ghost mode. * exp_ch6.adb (Expand_Subprogram_Contract): Do not expand the contract of an ignored Ghost subprogram. * exp_ch13.adb Add with and use clauses for Ghost. (Expand_N_Freeze_Entity): Capture, set and restore the Ghost mode. * exp_dbug.adb (Get_External_Name): Code reformatting. Add a special prefix for ignored Ghost entities or when requested by -gnatd.5 for any Ghost entity. * exp_dbug.ads Document the use of prefix "_ghost_" for ignored Ghost entities. * exp_prag.adb (Expand_Pragma_Check): Capture, set and restore the Ghost mode. (Expand_Pragma_Loop_Variant): Use In_Assertion_Expr to signal the original context. * ghost.adb (Check_Ghost_Overriding): Code cleanup. (Is_Ghost_Entity): Moved to einfo.adb. (Is_OK_Declaration): Move the assertion expression check to the outer level. (Is_OK_Ghost_Context): An assertion expression is a valid Ghost context. * ghost.ads (Is_Ghost_Entity): Moved to einfo.ads. * sem_ch3.adb (Analyze_Object_Contract): A source Ghost object cannot be imported or exported. Mark internally generated objects as Ghost when applicable. (Make_Class_Wide_Type): Inherit the ghostness of the root tagged type. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Mark a stand alone subprogram body as Ghost when applicable. (Analyze_Subprogram_Declaration): Mark internally generated subprograms as Ghost when applicable. * sem_ch7.adb: Code cleanup. * sem_ch13.adb (Add_Invariants): Add various formal parameters to break dependency on global variables. (Build_Invariant_Procedure): Code cleanup. Capture, set and restore the Ghost mode. * sem_res.adb (Resolve_Actuals): The actual parameter of a source Ghost subprogram whose formal is of mode IN OUT or OUT must be a Ghost variable. 2015-10-23 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch8.adb Code cleanup. (Find_Expanded_Name): Replace the call to In_Pragmas_Depends_Or_Global with a call to In_Abstract_View_Pragma. (In_Abstract_View_Pragma): New routine. (In_Pragmas_Depends_Or_Global): Removed. * sem_prag.adb (Analyze_Part_Of): Catch a case where indicator Part_Of denotes the abstract view of a variable. From-SVN: r229224
2015-10-20[multiple changes]Arnaud Charlet1-5/+6
2015-10-20 Ed Schonberg <schonberg@adacore.com> * sem_smem.adb (Check_Shared_Var): Clean up code that handles type declarations with discriminants, remove obsolete check. 2015-10-20 Arnaud Charlet <charlet@adacore.com> * par_sco.adb: Minor style fixes. 2015-10-20 Vincent Celier <celier@adacore.com> * debug.adb: Update documentation of -gnatdu. From-SVN: r229048
2015-10-20[multiple changes]Arnaud Charlet1-2/+2
2015-10-20 Gary Dismukes <dismukes@adacore.com> * sem_ch13.adb: Minor reference change (RM => AARM). 2015-10-20 Eric Botcazou <ebotcazou@adacore.com> * make.adb (Check): Skip multilib switches reinstated by the compiler only when counting the number of switches, since it is what really matters in the regular operating mode. 2015-10-20 Arnaud Charlet <charlet@adacore.com> * einfo.adb: Add extra assertion for small clause. * cstand.adb: Minor style fix in comment. * debug.adb: Minor reformatting. * exp_util.adb: Fix minor typo. 2015-10-20 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Same_Instantiated_Function): New predicate in Check_Formal_Package_Instance, used to verify that the formal and the actual of an actual package match when both are functions given as attribute references. From-SVN: r229034
2015-10-20[multiple changes]Arnaud Charlet1-1/+8
2015-10-20 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Check_Usage): Update the calls to Usage_Error. (Usage_Error): Remove formal parameter Item. Emit a clearer message concerning a missing dependency item and place it on the related pragma. 2015-10-20 Bob Duff <duff@adacore.com> * debug.adb, expander.adb: Implement -gnatd.B switch, which triggers a bug box when an abort_statement is seen. This is useful for testing Comperr.Compiler_Abort. * gnat1drv.adb: Trigger bug box on all exceptions other than Unrecoverable_Error. From-SVN: r229032
2015-10-16[multiple changes]Arnaud Charlet1-6/+1
2015-10-16 Arnaud Charlet <charlet@adacore.com> * usage.adb, debug.adb, a-except.adb, a-except.ads, a-except-2005.adb, a-except-2005.ads, s-imgrea.adb: Minor code clean ups related to jgnat/dotnet removal. 2015-10-16 Arnaud Charlet <charlet@adacore.com> * s-osprim-vxworks.adb, s-osprim-darwin.adb, s-tadeca.adb, s-osprim-unix.adb, s-osprim-solaris.adb, s-osprim-posix.adb, s-osprim.ads (Monotonic_Clock): Removed, unused. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Object_Operation, Try_One_Interpretation): Do not reset the Obj_Type of the prefix if an interpretation involves an untagged type, to prevent a crash when analyzing an illegal program in All_Errors mode. 2015-10-16 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_N_Expression_With_Actions): Force the evaluation of the expression when its type is Boolean. (Force_Boolean_Evaluation): New routine. 2015-10-16 Bob Duff <duff@adacore.com> * sem_util.adb (Has_Discrim_Dep_Array): Remove this function, and the call. No longer needed now that the back end can handle such things. Should result in further speedups in some cases. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Build_Predicate_Functions): If expression for predicate is side-effect free, indicate that the predicate function is pure, to allow for optimization of redundant predicate checks. From-SVN: r228881
2015-10-16exp_ch5.adb, [...]: Code clean up: remove special handling for .NET and JVM.Arnaud Charlet1-13/+6
2015-10-16 Arnaud Charlet <charlet@adacore.com> * exp_ch5.adb, sem_ch3.adb, frontend.adb, exp_ch7.adb, exp_ch7.ads, sem_ch5.adb, sem_type.adb, exp_util.adb, exp_util.ads, comperr.adb, exp_attr.adb, sinfo.ads, exp_ch9.adb, make.adb, usage.adb, lib-writ.adb, sem_ch9.adb, bindgen.adb, debug.adb, einfo.adb, einfo.ads, types.ads, checks.adb, sem_prag.adb, s-tasini.adb, rtsfind.ads, freeze.adb, sem_util.adb, sem_util.ads, exp_dbug.adb, gnatlink.adb, gnat1drv.adb, targparm.adb, targparm.ads, exp_ch4.adb, exp_ch11.adb, repinfo.adb, s-soflin.adb, s-soflin.ads, exp_ch6.adb, exp_ch13.adb, sem_mech.adb, sem_ch6.adb, par-prag.adb, exp_disp.adb, sem_ch8.adb, exp_disp.ads, snames.adb-tmpl, exp_aggr.adb, sem_eval.adb, exp_intr.adb, sem_ch13.adb, snames.ads-tmpl, sem_disp.adb, exp_ch3.adb: Code clean up: remove special handling for .NET and JVM. From-SVN: r228874
2015-10-16[multiple changes]Arnaud Charlet1-1/+6
2015-10-16 Bob Duff <duff@adacore.com> * debug.adb: Document -gnatdQ switch. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Formal_Subprogram): Implement rule that a formal abstract subprogram cannot have a null default: RM 12.6 (4 1.2). From-SVN: r228869
2015-05-26[multiple changes]Arnaud Charlet1-1/+4
2015-05-26 Robert Dewar <dewar@adacore.com> * sem_aggr.adb (Resolve_Array_Aggregate): Defend against bad bounds. * debug.adb: Document -gnatd.k. * erroutc.adb (Set_Msg_Insertion_Line_Number): Implement -gnatd.k. 2015-05-26 Robert Dewar <dewar@adacore.com> * gnat1drv.adb (Gnat1drv): Provide new arguments for Get_Target_Parameters. * restrict.adb (Set_Restriction_No_Specification_Of_Aspect): new procedure. (Set_Restriction_No_Use_Of_Attribute): new procedure. * restrict.ads (Set_Restriction_No_Specification_Of_Aspect): new procedure. (Set_Restriction_No_Use_Of_Attribute): new procedure. * s-rident.ads (Integer_Parameter_Restrictions): New subtype. * targparm.adb (Get_Target_Parameters): Allow new restriction pragmas No_Specification_Of_Aspect No_Use_Of_Attribute No_Use_Of_Pragma. * targparm.ads: New parameters for Get_Target_Parameters. * tbuild.adb (Set_NOD): New name for Set_RND. (Set_NSA): New procedure. (Set_NUA): New procedure. (Set_NUP): New procedure. * tbuild.ads (Make_SC): Minor reformatting. (Set_NOD): New name for Set_RND. (Set_NSA, Set_NUA, Set_NUP): New procedure. 2015-05-26 Ed Schonberg <schonberg@adacore.com> * a-stwise.adb (Find_Token): If source'first is not positive, an exception must be raised, as specified by RM 2005 A.4.3 (68/1). This must be checked explicitly, given that run-time files are normally compiled without constraint checks. * a-stzsea.adb (Find_Token): Ditto. 2015-05-26 Ed Schonberg <schonberg@adacore.com> * sem_util.ads sem_util.adb (Is_Current_Instance): New predicate to fully implement RM 8.6 (17/3). which earlier only applied to synchronized types. Used to preanalyze aspects that include current instances of types, such as Predicate and Invariant. * sem_res.adb (Resolve_Entity_Name): Use Is_Current_Instance. * sem_ch13.adb (Add_Predicates): In ASIS mode, preserve original expression of aspect and analyze it to provide proper type information. 2015-05-26 Robert Dewar <dewar@adacore.com> * rtsfind.ads: Add entries for RE_Exn[_Long]_Float. * s-exnllf.adb (Exn_Float): New function. (Exn_Long_Float): New function. (Exn_Long_Long_Float): Rewritten interface. (Exp): New name for what used to be Exn_Long_Long_Float. * s-exnllf.ads (Exn_Float): New function. (Exn_Long_Float): New function. 2015-05-26 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Find_Selected_Component): Do not emit an error on a selected component when the prefix is a type name that is a Current_Instance. * einfo.ads: Minor grammar fix. 2015-05-26 Doug Rupp <rupp@adacore.com> * init.c [vxworks] (sysLib.h): Only for x86. From-SVN: r223678