aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
AgeCommit message (Collapse)AuthorFilesLines
2017-12-05[multiple changes]Pierre-Marie de Rodat1-2/+11
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-16sem_ch6.adb (Create_Extra_Formals): The type of the BIP_Object_Access formal ↵Bob Duff1-0/+39
must not have a designated type that... 2017-11-16 Bob Duff <duff@adacore.com> * sem_ch6.adb (Create_Extra_Formals): The type of the BIP_Object_Access formal must not have a designated type that is the full view coming from a limited-with'ed package. * sem_util.adb,sem_util.ads (Incomplete_View_From_Limited_With): New function called from sem_ch6. * sem_ch5.adb (Analyze_Assignment): Treat user-defined concatenation specially for b-i-p cases. From-SVN: r254801
2017-11-09[multiple changes]Pierre-Marie de Rodat1-1/+2
2017-11-09 Yannick Moy <moy@adacore.com> * binde.adb (Diagnose_Elaboration_Problem): Mark procedure No_Return. * checks.adb (Apply_Scalar_Range_Check): Rescope variable OK closer to use. Default initialize Hi, Lo. (Selected_Range_Checks): Retype Num_Checks more precisely. (Determine_Range, Determine_Range_R): Default initialize Hi_Right, Lo_Right. * contracts.adb (Process_Contract_Cases): Mark parameter Stmts as Unmodified. (Process_Postconditions): Mark parameter Stmts as Unmodified. * exp_attr.adb (Expand_Loop_Entry_Attribute): Default initialize Blk. * exp_ch4.adb (Expand_N_Allocator): Default initialize Typ. (Expand_Concatenate): Default initialize High_Bound. (Optimize_Length_Comparison): Default initialize Ent, Index. * exp_ch5.adb (Expand_Predicated_Loop): Default initialize L_Hi and L_Lo. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Default initialize Return_Stmt. * exp_ch9.adb (Expand_Entry_Barrier): Default initialize Func_Body and remove pragma Warnings(Off). * exp_imgv.adb (Expand_Image_Attribute): Default initialize Tent. * exp_util.adb (Find_Interface_Tag): Default initialize AI_Tag. * freeze.adb (Check_Component_Storage_Order): Default initialize Comp_Byte_Aligned rather than silencing messages with pragma Warnings(Off), which does not work for CodePeer initialization messages, and given that here the possible read of an unitialized value depends on a proper use of parameters by the caller. * inline.adb (Expand_Inlined_Call): Default initialize Lab_Decl, Targ. * sem_ch12.adb (Build_Operator_Wrapper): Default initialize Expr. * sem_ch3.adb (Build_Derived_Array_Type): Default initialize Implicit_Base. * sem_ch4.adb (List_Operand_Interps): Default initialize Nam and remove pragma Warnings(Off). (Analyze_Case_Expression): Rescope checking block within branch where Others_Present is set by the call to Check_Choices. * sem_ch5.adb (Analyze_Assignment): Default initialize Save_Full_Analysis. * sem_ch6.adb (Analyze_Function_Return): Default initialize Obj_Decl, and restructure code to defend against previous errors, so that, in that case, control does not flow to the elsif condition which read an uninitialized Obj_Decl. * sem_ch9.adb (Analyze_Requeue): Default initialize Synch_Type. (Check_Interfaces): Default initialize Full_T_Ifaces and Priv_T_Ifaces, which seem to be left uninitialized and possibly read in some cases. * sem_dim.adb (Analyze_Aspect_Dimension_System): Retype Position more precisely. This requires to exchange the test for exiting in case of too many positions and the increment to Position, inside the loop. * sem_eval.adb (Eval_Concatenation): Default initialize Folded_Val, which cannot be read uninitialized, but the reasons for that are quite subtle. * sem_intr.adb (Check_Intrinsic_Call): Default initialize Rtyp. * sem_prag.adb (Collect_Subprogram_Inputs_Outputs): Default initialize Spec_Id. * sem_res.adb (Make_Call_Into_Operator): Default initialize Opnd_Type, and test for presence of non-null Opnd_Type before testing its scope, in a test which would read its value uninitialized, and is very rarely exercized (it depends on the presence of an extension of System). * sem_spark.ads: Update comment to fix name of main analysis procedure. * sem_warn.adb (Warn_On_Known_Condition): Default initialize Test_Result. * set_targ.adb (FailN): Mark procedure with No_Return. * stylesw.adb (Save_Style_Check_Options): Delete useless code to initialize all array Options to white space, as there is already code doing the same for the remaining positions in Options at the end of the procedure. 2017-11-09 Eric Botcazou <ebotcazou@adacore.com> * exp_ch11.adb (Possible_Local_Raise): Do not issue the warning for generic instantiations either. From-SVN: r254570
2017-10-20sinfo.ads, sinfo.adb (Alloc_For_BIP_Return): New flag to indicate that an ↵Bob Duff1-5/+7
allocator came from a b-i-p return statement. 2017-10-20 Bob Duff <duff@adacore.com> * sinfo.ads, sinfo.adb (Alloc_For_BIP_Return): New flag to indicate that an allocator came from a b-i-p return statement. * exp_ch4.adb (Expand_Allocator_Expression): Avoid adjusting the return object of a nonlimited build-in-place function call. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Set the Alloc_For_BIP_Return flag on generated allocators. * sem_ch5.adb (Analyze_Assignment): Move Assert to where it can't fail. If the N_Assignment_Statement has been transformed into something else, then Should_Transform_BIP_Assignment won't work. * exp_ch3.adb (Expand_N_Object_Declaration): A previous revision said, "Remove Adjust if we're building the return object of an extended return statement in place." Back out that part of the change, because the Alloc_For_BIP_Return flag is now used for that. From-SVN: r253940
2017-10-09[multiple changes]Pierre-Marie de Rodat1-75/+97
2017-10-09 Hristian Kirtchev <kirtchev@adacore.com> * sem_unit.adb (Find_Enclosing_Scope): Do not treat a block statement as a scoping construct when it is byproduct of exception handling. 2017-10-09 Hristian Kirtchev <kirtchev@adacore.com> * sinfo.ads: Update table Is_Syntactic_Field to reflect the nature of semantic field Target of node N_Call_Marker. 2017-10-09 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Allocator): Reject properly an allocator that attempts to copy a limited value, when the allocator is the expression in an expression function. 2017-10-09 Joel Brobecker <brobecker@adacore.com> * doc/share/conf.py: Tell the style checker that this is a Python fragment, and therefore that pyflakes should not be run to validate this file. 2017-10-09 Eric Botcazou <ebotcazou@adacore.com> * einfo.ads (Is_Boolean_Type): Add pragma Inline. (Is_Entity_Name): Likewise. (Is_String_Type): Likewise. * sem_type.adb (Full_View_Covers): Do not test Is_Private_Type here and remove useless comparisons on the base types. (Covers): Use simple tests for Standard_Void_Type. Move up cheap tests on T2. Always test Is_Private_Type before Full_View_Covers. 2017-10-09 Bob Duff <duff@adacore.com> * exp_ch4.adb: Minor refactoring. From-SVN: r253568
2017-10-09[multiple changes]Pierre-Marie de Rodat1-6/+14
2017-10-09 Javier Miranda <miranda@adacore.com> * sem_ch3.adb (Replace_Components): Browse the list of discriminants, not components. 2017-10-09 Hristian Kirtchev <kirtchev@adacore.com> * sem_elab.adb (Static_Elaboration_Checks): Elaboration requirements are verified only in the static model. 2017-10-09 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification, Check_Reverse_Iteration): Check that the domain of iteration supports reverse iteration when it is a formal container. This requires the presence of a Previous primitive in the Iterable aspect. * sem_ch13.adb (Resolve_Iterable_Operation): Verify legality of primitives Last and Previous to support reverse iteration over formal containers. (Validate_Iterable_Aspect): Add check for reverse iteration operations. * exp_ch5.adb (Build_Formal_Container_Iteration): Add proper expansion for reverse iteration using primitives Last and Previous in generated loop. 2017-10-09 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Subprogram_Name): If this is a child unit, use the name of the Defining_Program_Unit_Name, which is an identifier, in order to construct the string for the fully qualified name. From-SVN: r253567
2017-10-09[multiple changes]Pierre-Marie de Rodat1-9/+15
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-10-09exp_ch6.adb (Expand_N_Extended_Return_Statement): Add self-checking code so ↵Pierre-Marie de Rodat1-11/+108
if BIPAlloc is not passed in... gcc/ada/ 2017-10-09 Bob Duff <duff@adacore.com> * exp_ch6.adb (Expand_N_Extended_Return_Statement): Add self-checking code so if BIPAlloc is not passed in, it will likely raise Program_Error instead of cause miscellaneous chaos. (Is_Build_In_Place_Result_Type): Return False if not Expander_Active, as for the other Is_B-I-P... functions. * sem_aggr.adb (Resolve_Extension_Aggregate): For an extension aggregate whose ancestor part is a build-in-place call returning a nonlimited type, transform the assignment to the ancestor part to use a temp. * sem_ch3.adb (Build_Itype_Reference): Handle the case where we're creating an Itype for a library unit entity. (Check_Initialization): Avoid spurious error message on internally-generated call. * sem_ch5.adb (Analyze_Assignment): Handle the case where the right-hand side is a build-in-place call. This didn't happen when b-i-p was only for limited types. * sem_ch6.adb (Create_Extra_Formals): Remove assumption that b-i-p implies >= Ada 2005. * sem_ch7.adb (Scan_Subprogram_Refs): Avoid traversing the same nodes repeatedly. * sem_util.adb (Next_Actual): Handle case of build-in-place call. 2017-10-09 Arnaud Charlet <charlet@adacore.com> * doc/gnat_ugn/gnat_and_program_execution.rst: Minor edit. 2017-10-09 Piotr Trojanek <trojanek@adacore.com> * libgnarl/s-taprob.adb: Minor whitespace fix. 2017-10-09 Bob Duff <duff@adacore.com> * namet.ads: Minor comment fix. 2017-10-09 Piotr Trojanek <trojanek@adacore.com> * sem_aux.adb (Unit_Declaration_Node): Detect protected declarations, just like other program units listed in Ada RM 10.1(1). 2017-10-09 Justin Squirek <squirek@adacore.com> * sem_ch8.adb (Update_Chain_In_Scope): Modify warning messages. 2017-10-09 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Associations, Check_Generic_Parent): If an actual for a formal package is an instantiation of a child unit, create a freeze node for the instance of the parent if it appears in the same scope and is not frozen yet. 2017-10-09 Pierre-Marie de Rodat <derodat@adacore.com> * exp_atag.ads, libgnat/a-tags.adb, libgnat/a-tags.ads: Enhance in-source documentation for tagged types's Offset_To_Top. 2017-10-09 Bob Duff <duff@adacore.com> * exp_ch3.adb (Build_Assignment): Parameter name N was somewhat confusing. Same for N_Loc. Remove assumption that b-i-p implies limited. This is for the case of a function call that occurs as the default for a record component. (Expand_N_Object_Declaration): Deal with the case where expansion has created an object declaration initialized with something like F(...)'Reference. * exp_ch3.adb: Minor reformatting. 2017-10-09 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_Attribute_Reference, case 'Valid): The prefix of the attribute is an object, but it may appear within a conversion. The object itself must be retrieved when generating the range test that implements the validity check on a scalar type. gcc/testsuite/ 2017-10-09 Ed Schonberg <schonberg@adacore.com> * gnat.dg/validity_check2.adb, gnat.dg/validity_check2_pkg.ads: New testcase. From-SVN: r253548
2017-09-25[multiple changes]Pierre-Marie de Rodat1-0/+1
2017-09-25 Justin Squirek <squirek@adacore.com> * aspects.adb, bindgen.adb, clean.adb, erroutc.adb, exp_ch13.adb, exp_dbug.adb, exp_unst.adb, exp_util.adb, frontend.adb, gnat1drv.adb, gnatdll.adb, gnatlink.adb, gnatls.adb, gnatname.adb, gnatxref.adb, gnatfind.adb, libgnat/a-cfhama.ads, libgnat/a-exetim__mingw.adb, libgnat/a-strmap.adb, libgnat/a-teioed.adb, libgnat/g-alvety.ads, libgnat/g-expect.adb, libgnat/g-regist.adb, libgnat/g-socket.adb, libgnat/g-socthi__mingw.ads, libgnat/s-stausa.adb, libgnat/s-tsmona__linux.adb, libgnat/s-tsmona__mingw.adb, libgnarl/s-taenca.adb, libgnarl/s-tassta.adb, libgnarl/s-tarest.adb, libgnarl/s-tpobop.adb, make.adb, makeusg.adb, namet.adb, output.ads, put_scos.adb, repinfo.adb, rtsfind.adb, scn.ads, sem_attr.adb, sem_aux.ads, sem_warn.ads, targparm.adb, xr_tabls.adb, xref_lib.adb: Removal of ineffective use-clauses. * exp_ch9.adb (Is_Simple_Barrier_Name): Check for false positives with constant folded barriers. * ghost.adb, sprint.adb, sem_ch10.adb, sem_warn.adb: Change access to Subtype_Marks and Names list in use-clause nodes to their new singular counterparts (e.g. Subtype_Mark, Name). * par.adb, par-ch8.adb (Append_Use_Clause): Created to set Prev_Ids and More_Ids in use-clause nodes. (P_Use_Clause): Modify to take a list as a parameter. (P_Use_Package_Clause, P_Use_Type_Clause): Divide names and subtype_marks within an aggregate use-clauses into individual clauses. * par-ch3.adb, par-ch10.adb, par-ch12.adb: Trivally modify call to P_Use_Clause to match its new behavior. * sem.adb (Analyze): Mark use clauses for non-overloaded entities. * sem_ch4.adb (Try_One_Interp): Add sanity check to handle previous errors. * sem_ch6.adb (Analyze_Generic_Subprogram_Body, Analyze_Subprogram_Body_Helper): Update use clause chain at the end of the declarative region. * sem_ch7.adb (Analyze_Package_Body_Helper): Update use clause chain after analysis (Analyze_Package_Specification): Update use clause chain when there is no body. * sem_ch8.ads, sem_ch8.adb (Analyze_Use_Package, Analyze_Use_Type): Add parameter to determine weither the installation of scopes should also propagate on the use-clause "chain". (Mark_Use_Clauses): Created to traverse use-clause chains and determine what constitutes a valid "use" of a clause. (Update_Use_Clause_Chain): Created to aggregate common machinary used to clean up use-clause chains (and warn on ineffectiveness) at the end of declaritive regions. * sem_ch8.adb (Analyze_Package_Name): Created to perform analysis on a package name from a use-package clause. (Analyze_Package_Name_List): Created to perform analysis on a list of package names (similar to Analyze_Package_Name). (Find_Most_Prev): Created to traverse to the beginning of a given use-clause chain. (Most_Decendant_Use_Clause): Create to identify which clause from a given set is highest in scope (not always the most prev). (Use_One_Package, Use_One_Type): Major cleanup and reorganization to handle the new chaining algorithm, also many changes related to redundant clauses. A new parameter has also been added to force installation to handle certain cases. * sem_ch9.adb (Analyze_Entry_Body, Analyze_Protected_Body, Analyze_Task_Body): Mark use clauses on relevant entities. * sem_ch10.adb, sem_ch10.ads (Install_Context_Clauses, Install_Parents): Add parameter to determine weither the installation of scopes should also propagate on the use-clause "chain". * sem_ch12.adb (Inline_Instance_Body): Add flag in call to Install_Context to avoid redundant chaining of use-clauses. * sem_ch13.adb: Minor reformatting. * sem_res.adb (Resolve): Mark use clauses on operators. (Resolve_Call, Resolve_Entity_Name): Mark use clauses on relevant entities. * sinfo.adb, sinfo.ads (Is_Effective_Use_Clause, Set_Is_Effective_Use_Clause): Add new flag to N_Use_Clause nodes to represent any given clause's usage/reference/necessity. (Prev_Use_Clause, Set_Prev_Use_Clause): Add new field to N_Use_Clause nodes to allow loose chaining of redundant clauses. (Set_Used_Operations, Set_Subtype_Mark, Set_Prev_Ids, Set_Names, Set_More_Ids, Set_Name): Modify set procedure calls to reflect reorganization in node fields. * types.ads (Source_File_Index): Adjust index bounds. (No_Access_To_Source_File): New constant. 2017-09-25 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_One_Aspect): In ASIS mode make a full copy of the expression to be used in the generated attribute specification (rather than relocating it) to avoid resolving a potentially malformed tree when the expression is resolved through an ASIS-specific call to Resolve_Aspect_Expressions. This manifests itself as a crash on a function with parameter associations. From-SVN: r253144
2017-09-25[multiple changes]Pierre-Marie de Rodat1-4/+6
2017-09-25 Yannick Moy <moy@adacore.com> * exp_spark.adb (Expand_SPARK_Indexed_Component, Expand_SPARK_Selected_Component): New procedures to insert explicit dereference if required. (Expand_SPARK): Call the new procedures. 2017-09-25 Patrick Bernardi <bernardi@adacore.com> * libgnat/a-stwiun.adb, libgnat/s-stchop__vxworks.adb, libgnat/g-socthi__vxworks.ads, libgnat/a-stzunb.adb, libgnat/a-strunb.adb, libgnarl/s-osinte__lynxos178.adb, libgnarl/s-intman__vxworks.adb, libgnarl/s-osinte__darwin.adb, libgnarl/a-exetim__darwin.adb: Removed ineffective use-clauses. 2017-09-25 Vasiliy Fofanov <fofanov@adacore.com> * adaint.c (win32_wait): Properly handle error and take into account the WIN32 limitation on the number of simultaneous wait objects. 2017-09-25 Yannick Moy <moy@adacore.com> * sem_ch3.adb (Constant_Redeclaration): Do not insert a call to the invariant procedure in GNATprove mode. * sem_ch5.adb (Analyze_Assignment): Likewise. From-SVN: r253143
2017-09-08[multiple changes]Arnaud Charlet1-1/+4
2017-09-08 Bob Duff <duff@adacore.com> * par-prag.adb, sem_prag.adb, snames.ads-tmpl: Implement pragma Ada_2020, along the same lines as the other Ada version pragmas. 2017-09-08 Gary Dismukes <dismukes@adacore.com> * sem_ch12.adb: Minor typo fixes and reformatting. 2017-09-08 Yannick Moy <moy@adacore.com> * sem_aggr.adb (Resolve_Record_Aggregate): Rewrite bounds of aggregate subexpressions which may depend on discriminants of the enclosing aggregate. 2017-09-08 Yannick Moy <moy@adacore.com> * sem_ch5.adb: Prevent assertion failure on illegal code. 2017-09-08 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (Add_SPARK_Xrefs.Is_SPARK_Scope): Avoid calling Renamed_Entity on an entity which cannot be a renaming. 2017-09-08 Eric Botcazou <ebotcazou@adacore.com> * exp_aggr.adb: Add with & use clause for Urealp. (Aggr_Assignment_OK_For_Backend): Accept (almost all) elementary types instead of just discrete types. * sem_eval.adb (Expr_Value): Deal with N_Null for access types. * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Be prepared for the FP zero value in the memset case. Add small guard. 2017-09-08 Eric Botcazou <ebotcazou@adacore.com> * s-htable.adb (Static_HTable.Reset): Use aggregate instead of loop. From-SVN: r251894
2017-09-08[multiple changes]Arnaud Charlet1-1/+2
2017-09-08 Arnaud Charlet <charlet@adacore.com> * exp_intr.adb (Append_Entity_Name): Move to ... * sem_util.ads, sem_util.adb: ... here to share it. (Subprogram_Name): New subprogram, to compute the name of the enclosing subprogram/entity. * errutil.adb (Error_Msg): Fill new field Node. * erroutc.ads (Subprogram_Name_Ptr): New. (Error_Msg_Object): New field Node. * erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account. * errout.adb (Error_Msg): New variant with node id parameter. Fill new parameter Node when emitting messages. Revert previous changes for Include_Subprogram_In_Messages. * sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when generating warning message. 2017-09-08 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (P_Iterated_Component_Association): Place construct under -gnat2020 flag, given that it is a future feature of the language. * sem_aggr.adb (Resolve_Iterated_Component_Association): Mark defining identifier as referenced to prevent spurious warnings: corresponding loop is expanded into one or more loops whose variable has the same name, and the expression uses those names and not the original one. From-SVN: r251883
2017-09-06[multiple changes]Arnaud Charlet1-9/+8
2017-09-06 Gary Dismukes <dismukes@adacore.com> * sem_ch5.adb: Minor reformatting and a typo fix 2017-09-06 Arnaud Charlet <charlet@adacore.com> * sinput-l.ads: minor remove extra period at the end of comment 2017-09-06 Arnaud Charlet <charlet@adacore.com> * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for E_Discriminant. (Find_Role): remove support for E_Discriminant. 2017-09-06 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Expand_Simple_Function_Return): Add missing implicit type conversion to force displacement of the "this" pointer. From-SVN: r251807
2017-09-06[multiple changes]Arnaud Charlet1-1/+20
2017-09-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting. 2017-09-06 Yannick Moy <moy@adacore.com> * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once. 2017-09-06 Bob Duff <duff@adacore.com> * sem_ch8.adb: Change Assert to be consistent with other similar ones. 2017-09-06 Bob Duff <duff@adacore.com> * binde.adb (Find_Elab_Order): Do not run Elab_Old unless requested. Previously, the -do switch meant "run Elab_New and Elab_Old and use the order chosen by Elab_Old, possibly with debugging printouts comparing the two orders." Now it means "do not run Elab_New." This is of use if there are bugs that cause Elab_New to crash. (Elab_Position, Num_Chosen): Change type to Nat, to avoid various type conversions. * ali.ads (Elab_Position): Change type to Nat, to avoid various type conversions. 2017-09-06 Arnaud Charlet <charlet@adacore.com> * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix reference to SPARK RM. 2017-09-06 Eric Botcazou <ebotcazou@adacore.com> * layout.adb: Use SSU short hand consistently throughout the file. 2017-09-06 Eric Botcazou <ebotcazou@adacore.com> * freeze.adb (Freeze_Record_Type) <Sized_Component_Total_Round_RM_Size>: New local variable to accumulate the rounded RM_Size of components. Update it for every component whose RM_Size is statically known. Add missing guard to check that bit packing is really required before issuing the error about packing. Swap condition for clarity's sake. * sem_prag.adb (Usage_Error): fix reference to SPARK RM in comment 2017-09-06 Fedor Rybin <frybin@adacore.com> * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb, mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads, mlib-tgt-specific.adb, mlib-tgt-specific.ads, mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb, mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb, mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb, mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb, mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads, prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb, prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads, prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb, prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads, prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb, prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads, prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete project manager sources. 2017-09-06 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an entity of a mutable type and the right-hand side is a conditional expression, resolve the alternatives of the conditional using the base type of the target entity, because the alternatives may have distinct subtypes. This is particularly relevant if the alternatives are aggregates. From-SVN: r251797
2017-09-06[multiple changes]Arnaud Charlet1-6/+3
2017-09-06 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram): Do not warn on conditions that are not obeyed for Inline_Always subprograms, when assertions are not enabled. 2017-09-06 Arnaud Charlet <charlet@adacore.com> * sem_util.adb (Unique_Entity): For abstract states return their non-limited view. 2017-09-06 Bob Duff <duff@adacore.com> * sem_ch12.adb (Copy_Generic_Node): When we copy a node that is a proper body corresponding to a stub, we defer the adjustment of the sloc until after the correct adjustment has been computed. Otherwise, Adjust_Instantiation_Sloc will ignore the adjustment, because it will be outside the range in (the old, incorrect) S_Adjustment. * inline.adb: Use named notation for readability and uniformity. * sinput-l.adb: Minor improvements to debugging output printed for Debug_Flag_L. * sinput-l.ads (Create_Instantiation_Source): Minor comment correction. 2017-09-06 Vincent Celier <celier@adacore.com> * make.adb: Do not invoke gprbuild for -bargs -P. 2017-09-06 Sylvain Dailler <dailler@adacore.com> * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a case when Op is of kind N_Qualified_Expression. In this case, the function is called recursively on the subexpression like in other cases. * make.adb: Minor reformatting 2017-09-06 Justin Squirek <squirek@adacore.com> * einfo.adb (Set_Linker_Section_Pragma): Modify Set_Linker_Section_Pragma to be consistant with the "getter" Linker_Section_Pragma. * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error checking for container loops so that the index cursor is not directly changable by the user with the use of E_Loop_Parameter. * sem_ch5.adb (Analyze_Block_Statement): Revert previous change. * sem_warn.adb (Check_References): Revert previous change. From-SVN: r251789
2017-09-06[multiple changes]Arnaud Charlet1-1/+4
2017-09-06 Bob Duff <duff@adacore.com> * exp_util.adb (Is_Displace_Call): Make sure it works for indirect calls and the like. 2017-09-06 Yannick Moy <moy@adacore.com> * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object declarations to only consider valid uses of Global/Depends those on single concurrent objects. 2017-09-06 Eric Botcazou <ebotcazou@adacore.com> * sem_ch13.adb (Check_Record_Representation_Clause): Give an error as soon as one of the specified components overlaps the parent field. 2017-09-06 Arnaud Charlet <charlet@adacore.com> * sem_prag.ads: minor fix typo in comment. 2017-09-06 Justin Squirek <squirek@adacore.com> * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes from source before checking source references. * sem_warn.adb (Check_References): Add check for internal block before recursing. 2017-09-06 Vincent Celier <celier@adacore.com> * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb, make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb, gnatname.adb: Remove the Project Manager from the GNAT tools. 2017-09-06 Bob Duff <duff@adacore.com> * sem_util.ads: Minor comment fix. 2017-09-06 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Associations, case of Formal_Package): Generate a freeze node for the actual of a formal package, if the actual is declared in the same unit and has a corresponding body, to prevent the current instance from being frozen before the actual is. From-SVN: r251786
2017-04-28[multiple changes]Arnaud Charlet1-3/+3
2017-04-28 Bob Duff <duff@adacore.com> * sem_util.ads, sem_util.adb (Might_Raise): New function that replaces Is_Exception_Safe, but has the opposite sense. Is_Exception_Safe was missing various cases -- calls inside a pragma Debug, calls inside an 'if' or assignment statement, etc. Might_Raise now walks the entire subtree looking for things that can raise. * exp_ch9.adb (Is_Exception_Safe): Remove. (Build_Protected_Subprogram_Body): Replace call to Is_Exception_Safe with "not Might_Raise". Misc cleanup (use constants where possible). * exp_ch7.adb: Rename Is_Protected_Body --> Is_Protected_Subp_Body. A protected_body is something different in the grammar. 2017-04-28 Eric Botcazou <ebotcazou@adacore.com> * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable. * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable. (P_Discrete_Choice_List): Initialize Expr_Node variable. * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable. (P_Protected): Likewise. * sem_case.adb (Check_Duplicates): Add pragma Warnings on variable. * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable. * sem_ch4.adb (List_Operand_Interps): Add pragma Warnings on variable. * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis. (Analyze_Exit_Statement): Initialize Scope_Id variable. (Analyze_Iterator_Specification): Initialize Bas variable. * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize Error_Count (Satisfies_Lock_Free_Requirements): Likewise. (Analyze_Accept_Statement): Initialize Task_Nam. 2017-04-28 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Install_Primitive_Elaboration_Check): Do not generate an elaboration check if all checks have been suppressed. 2017-04-28 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications, case Interrupt_Handler and Attach_Handler): Generate reference to protected operation to prevent spurious warnings about unreferenced entities. Previous scheme failed with style checks enabled. 2017-04-28 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings that follows an expression function must not be relocated to the generated body, because it applies to the code that follows. From-SVN: r247387
2017-04-25contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract): Add a warning ↵Hristian Kirtchev1-4/+5
about SPARK mode management. 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. (Analyze_Entry_Or_Subprogram_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. (Analyze_Object_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. (Analyze_Package_Body_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. (Analyze_Package_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. (Analyze_Task_Contract): Add a warning about SPARK mode management. The routine now saves and restores both the mode and associated pragma. * expander.adb (Expand): Change the way the Ghost mode is saved and restored. * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is saved and restored. * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved and restored. * exp_util.adb (Build_DIC_Procedure_Body): Change the way the Ghost mode is saved and restored. (Build_DIC_Procedure_Declaration): Change the way the Ghost mode is saved and restored. (Build_Invariant_Procedure_Body): Change the way the Ghost mode is saved and restored. (Build_Invariant_Procedure_Declaration): Change the way the Ghost mode is saved and restored. (Make_Predicate_Call): Change the way the Ghost mode is saved and restored. * freeze.adb (Freeze_Entity): Change the way the Ghost mode is saved and restored. * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode and its assignment. (Mark_And_Set_Ghost_Body): Remove parameter Mode and its assignment. (Mark_And_Set_Ghost_Completion): Remove parameter Mode and its assignment. (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its assignment. (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and its assignment. (Mark_And_Set_Ghost_Procedure_Call): Remove parameter Mode and its assignment. (Set_Ghost_Mode): Remove parameter Mode and its assignment. * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode and update the comment on usage. (Mark_And_Set_Ghost_Body): Remove parameter Mode and update the comment on usage. (Mark_And_Set_Ghost_Completion): Remove parameter Mode and update the comment on usage. (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and update the comment on usage. (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and update the comment on usage. (Mark_And_Set_Ghost_Procedure_Call): Remove parameter Mode and update the comment on usage. (Set_Ghost_Mode): Remove parameter Mode and update the comment on usage. * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various types. * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma. (Load_Main_Source): Remove the assignment of obsolete field SPARK_Mode_Pragma. (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma. * lib-writ.adb (Add_Preprocessing_Dependency): Remove the assignment of obsolete field SPARK_Mode_Pragma. (Ensure_System_Dependency): Remove the assignment of obsolete field SPARK_Mode_Pragma. * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK mode management. Change the way Ghost and SPARK modes are saved and restored. * sem.adb (Analyze): Change the way the Ghost mode is saved and restored. * sem_ch3.adb (Analyze_Object_Declaration): Change the way the Ghost mode is saved and restored. (Process_Full_View): Change the way the Ghost mode is saved and restored. * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost mode is saved and restored. * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost mode is saved and restored. (Analyze_Subprogram_Body_Helper): Change the way the Ghost mode is saved and restored. * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the Ghost mode is saved and restored. * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode management. Save the SPARK mode-related data prior to any changes to the scope stack and contexts. The mode is then reinstalled before the subunit is analyzed in order to restore the original view of the subunit. * sem_ch12.adb (Analyze_Package_Instantiation): Update the warning on region management. Change the way the Ghost and SPARK modes are saved and restored. (Inline_Instance_Body): Add a warning about SPARK mode management. Code clean up. (Analyze_Subprogram_Instantiation): Update the warning on region management. Change the way the Ghost and SPARK modes are saved and restored. (Instantiate_Package_Body): Update the warning on region management. Change the way the Ghost and SPARK modes are saved and restored. (Instantiate_Subprogram_Body): Update the warning on region management. Change the way the Ghost and SPARK modes are saved and restored. (Set_Instance_Env): Add a warning about SPARK mode management. Change the way SPARK mode is saved and restored. * sem_ch13.adb (Build_Predicate_Functions): Change the way the Ghost mode is saved and restored. (Build_Predicate_Function_Declaration): Change the way the Ghost mode is saved and restored. * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK mode management. Change the way SPARK mode is saved and restored. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Change the way the Ghost mode is saved and restored. (Analyze_Initial_Condition_In_Decl_Part): Change the way the Ghost mode is saved and restored. (Analyze_Pragma): Change the way the Ghost mode is saved and restored. (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the Ghost mode is saved and restored. * sem_util.adb (Install_SPARK_Mode): New routine. (Restore_SPARK_Mode): New routine. (Save_SPARK_Mode_And_Set): Removed. (Set_SPARK_Mode): New routine. * sem_util.ads (Install_SPARK_Mode): New routine. (Restore_SPARK_Mode): New routine. (Save_SPARK_Mode_And_Set): Removed. (Set_SPARK_Mode): New routine. From-SVN: r247230
2017-04-25[multiple changes]Arnaud Charlet1-2/+1
2017-04-25 Arnaud Charlet <charlet@adacore.com> * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract. 2017-04-25 Justin Squirek <squirek@adacore.com> * sem_ch3.adb (Analyze_Declarations): Minor correction to comments, move out large conditional and scope traversal into a predicate. (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted logic. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Refine analysis of prefix whose type is a current instance of a synchronized type. If the prefix is an object this is an external call (or requeue) that can only access public operations of the object. The previous predicate was too restrictive, and did not allow public protected operations, only task entries. 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch5.adb, fname.adb: Minor reformatting. 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Is_Anonymous_Access_Type): New routine. * einfo.ads Update the placement of E_Anonymous_Access_Subprogram_Type along with all subtypes that mention the ekind. (Is_Anonymous_Access_Type): New routine. * exp_ch7.adb (Allows_Finalization_Master): Do not generate a master for an access type subject to pragma No_Heap_Finalization. * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being allocated or deallocated does not finalization actions if the associated access type is subject to pragma No_Heap_Finalization. * opt.ads Add new global variable No_Heap_Finalization_Pragma. * par-prag.adb Pragma No_Heap_Finalization does not need special processing from the parser. * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient ??? comments. Use the new predicate Is_Anonymous_Access_Type. * sem_prag.adb Add an entry in table Sig_Flags for pragma No_Heap_Finalization. (Analyze_Pragma): Add processing for pragma No_Heap_Finalization. Update various error messages to use Duplication_Error. * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine. * snames.ads-tmpl: Add new predefined name No_Heap_Finalization and corresponding pragma id. From-SVN: r247156
2017-04-25[multiple changes]Arnaud Charlet1-0/+19
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-04-25[multiple changes]Arnaud Charlet1-10/+13
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb, sem_ch5.adb: Minor reformatting. 2017-04-25 Bob Duff <duff@adacore.com> * types.ads: Minor: Fix '???' comment. * sem_ch8.adb: Minor comment fix. 2017-04-25 Bob Duff <duff@adacore.com> * sem_prag.adb: Remove suspicious uses of Name_Buf. * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove Add_String_To_Name_Buffer, to avoid using the global Name_Buf. Add String_To_Name with no side effects. 2017-04-25 Justin Squirek <squirek@adacore.com> * sem_ch3.adb (Analyze_Declarations): Add additional condition for edge case. 2017-04-25 Bob Duff <duff@adacore.com> * par-ch2.adb, scans.ads, scn.adb: Do not give an error for reserved words inside pragmas. This is necessary to allow the pragma name Interface to be used in pragma Ignore_Pragma. * par.adb: Minor comment fix. 2017-04-25 Javier Miranda <miranda@adacore.com> * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract. * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract. * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update occurrences of RE_Type_Is_Abstract 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Chain): Account for ancestor subtypes while traversing the derivation chain. From-SVN: r247150
2017-04-25[multiple changes]Arnaud Charlet1-21/+21
2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb: minor reformatting. 2017-04-25 Doug Rupp <rupp@adacore.com> * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on the first pass over an assignment statement with target names, to prevent the generation of subtypes (such as discriminated record components)that may carry the target name outside of the tree for the assignment. The subtypes will be generated when the assignment is reanalyzed in full. (Analyze_Target_Name): Handle properly class-wide types. From-SVN: r247149
2017-04-25[multiple changes]Arnaud Charlet1-9/+4
2017-04-25 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Build_Initialization_Call): Handle subtypes of private types when searching for the underlying full view of a private type. 2017-04-25 Javier Miranda <miranda@adacore.com> * sem_res.adb (Set_Mixed_Mode_Operand): A universal real conditional expression can appear in a fixed-type context and must be resolved with that context to facilitate the code generation to the backend. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag, to indicate whether during inline processing, when some unit U1 appears in the context of a unit U2 compiled for instantiation or inlining purposes, the body of U1 needs to be compiled as well. * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if context is a package declaration. * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration, Analyze_Generic_Package_Declaration): ditto. * inline.adb (Analyze_Inlined_Bodies): Check Body_Needed_For_Inlining. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * par.adb (Current_Assign_Node): Global variable use to record the presence of a target_name in the right hand side of the assignment being parsed. * par-ch4.adb (P_Name): If the name is a target_name, mark the enclosing assignment node accordingly. * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node appropriately. * sem_ch5.adb (Analyze_Assignment): Disable expansion before analyzing RHS if the statement has target_names. * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle properly choices that are subtype marks. * exp_ch5.adb: Code cleanup. 2017-04-25 Bob Duff <duff@adacore.com> * s-memory.adb: Add a comment regarding efficiency. * atree.adb: Fix the assertion, and combine 2 assertions into one, "the source has an extension if and only if the destination does." * sem_ch3.adb, sem_ch13.adb: Address ??? comments. 2017-04-25 Arnaud Charlet <charlet@adacore.com trojanek> * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits conversion. 2017-04-25 Doug Rupp <rupp@adacore.com> * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp handling for ppc64-vx7. * sigtramp-vxworks-target.inc [SIGTRAMP_BODY]: Add section for ppc64-vx7. From-SVN: r247146
2017-04-25[multiple changes]Arnaud Charlet1-9/+9
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb: Minor reformatting. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * scng.adb (Scan): Handle '@' appropriately. * sem_ch5.adb: Code cleanup. From-SVN: r247142
2017-01-23[multiple changes]Arnaud Charlet1-4/+4
2017-01-23 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor reformatting. * exp_ch9.adb: minor style fix in comment. 2017-01-23 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived for a limited record extension with unknown discriminants whose full view has no discriminants. 2017-01-23 Yannick Moy <moy@adacore.com> * exp_spark.adb: Alphabetize with clauses. From-SVN: r244788
2017-01-23scans.ads: New token At_Sign.Ed Schonberg1-0/+45
2017-01-23 Ed Schonberg <schonberg@adacore.com> * scans.ads: New token At_Sign. Remove '@' from list of illegal characters for future version of the language. '@' is legal name. * scng.ads, scng.adb (Scan): Handle '@' appropriately. * scn.adb (Scan_Reserved_Identifier): An occurrence of '@' denotes a Target_Name. * par-ch4.adb (P_Name, P_Primary): Handle Target_Name. * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node. (Has_Target_Names): New flag on N_Assignment_Statement, to indicate that RHS has occurrences of N_Target_Name. * sem.adb: Call Analyze_Target_Name. * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram. (urrent_LHS): Global variable that denotes LHS of assignment, used in the analysis of Target_Name nodes. * sem_res.adb (Resolve_Target_Name): New procedure. * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125): N is an assignment statement whose RHS contains occurences of @ that designate the value of the LHS of the assignment. If the LHS is side-effect free the target names can be replaced with a copy of the LHS; otherwise the semantics of the assignment is described in terms of a procedure with an in-out parameter, and expanded as such. (Expand_N_Assignment_Statement): Call Expand_Assign_With_Target_Names when needed. * exp_util.adb (Insert_Actions): Take into account N_Target_Name. * sprint.adb: Handle N_Target_Name. From-SVN: r244783
2017-01-20[multiple changes]Arnaud Charlet1-0/+8
2017-01-20 Yannick Moy <moy@adacore.com> * inline.adb (Expand_Inlined_Call): Keep more precise type of actual for inlining whenever possible. In particular, do not switch to the formal type in GNATprove mode in some case where the GNAT backend might require it for visibility. 2017-01-20 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited aspect Implicit_Dereference can be inherited by a full view if the partial view has no discriminants, because there is no way to apply the aspect to the partial view. (Build_Derived_Record_Type): If derived type renames discriminants of the parent, the new discriminant inherits the aspect from the old one. * sem_ch4.adb (Analyze_Call): Handle properly a parameterless call through an access discriminant designating a subprogram. * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle properly a parameterless call through an access discriminant on the left-hand side of an assignment. * sem_res.adb (resolve): If an interpreation involves a discriminant with an implicit dereference and the expression is an entity, resolution takes place later in the appropriate routine. * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize access discriminants that designate a subprogram type. 2017-01-20 Pascal Obry <obry@adacore.com> * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016 From-SVN: r244698
2017-01-19[multiple changes]Arnaud Charlet1-1/+4
2017-01-19 Pierre-Marie de Rodat <derodat@adacore.com> * exp_dbug.adb (Debug_Renaming_Declaration): Process underlying types. Emit GNAT encodings for object renamings involving record components whose normalized bit offset is not null. * uintp.h (UI_No_Uint): Declare. 2017-01-19 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the statements within an element iterator loop are only analyzed agter the loop is rewritten. Within a generic the analysis must be performed in any case to complete name capture. 2017-01-19 Bob Duff <duff@adacore.com> * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first, before checking for unrecognized pragmas. Initialize Pname on its declarations; that's always good style. From-SVN: r244630
2017-01-13[multiple changes]Arnaud Charlet1-0/+4
2017-01-13 Hristian Kirtchev <kirtchev@adacore.com> * expander.adb (Expand): Add a warning about using return statements in Ghost management code. * exp_ch3.adb (Freeze_Type): Add a warning about using return statements in Ghost management code. * exp_ch7.adb (Build_Invariant_Procedure_Body, Build_Invariant_Procedure_Declaration): Add a warning about using return statements in Ghost management code. * exp_disp.adb (Make_DT): Add a warning about using return statements in Ghost management code. * exp_util.adb (Build_DIC_Procedure_Body, Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a warning about using return statements in Ghost management code. * freeze.adb (Freeze_Entity): Add a warning about using return statements in Ghost management code. * sem.adb (Analyze, Do_Analyze): Add a warning about using return statements in Ghost management code. * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add a warning about using return statements in Ghost management code. * sem_ch5.adb (Analyze_Assignment): Add a warning about using return statements in Ghost management code. * sem_ch6.adb (Analyze_Procedure_Call, Analyze_Subprogram_Body_Helper): Add a warning about using return statements in Ghost management code. * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about using return statements in Ghost management code. * sem_ch12.adb (Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation, Instantiate_Package_Body, Instantiate_Subprogram_Body): Add a warning about using return statements in Ghost management code. * sem_ch13.adb (Build_Predicate_Functions, Build_Predicate_Function_Declarations): Add a warning about using return statements in Ghost management code. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part, Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma, Analyze_Pre_Post_Condition_In_Decl_Part): Add a warning about using return statements in Ghost management code. 2017-01-13 Tristan Gingold <gingold@adacore.com> * s-mmosin-mingw.adb: Fix pragma import. 2017-01-13 Arnaud Charlet <charlet@adacore.com> * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in codepeer mode. From-SVN: r244396
2017-01-13atree.adb (Allocate_Initialize_Node): A newly created node is no longer ↵Hristian Kirtchev1-31/+23
marked as Ghost at this level. 2017-01-13 Hristian Kirtchev <kirtchev@adacore.com> * atree.adb (Allocate_Initialize_Node): A newly created node is no longer marked as Ghost at this level. (Mark_New_Ghost_Node): New routine. (New_Copy): Mark the copy as Ghost. (New_Entity): Mark the entity as Ghost. (New_Node): Mark the node as Ghost. * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now apply to unanalyzed entities. (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed entities. (Set_Is_Checked_Ghost_Entity): This attribute now applies to all entities as well as unanalyzed entities. (Set_Is_Ignored_Ghost_Entity): This attribute now applies to all entities as well as unanalyzed entities. * expander.adb Add with and use clauses for Ghost. (Expand): Install and revert the Ghost region associated with the node being expanded. * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code. (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code. (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code. (Expand_Freeze_Record_Type): Remove all Ghost-related code. (Freeze_Type): Install and revert the Ghost region associated with the type being frozen. * exp_ch5.adb Remove with and use clauses for Ghost. (Expand_N_Assignment_Statement): Remove all Ghost-related code. * exp_ch6.adb Remove with and use clauses for Ghost. (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code. (Expand_N_Subprogram_Body): Remove all Ghost-related code. * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the Ghost region of the working type. (Build_Invariant_Procedure_Declaration): Install and revert the Ghost region of the working type. (Expand_N_Package_Body): Remove all Ghost-related code. * exp_ch8.adb Remove with and use clauses for Ghost. (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code. (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related code. * exp_ch13.adb Remove with and use clauses for Ghost. (Expand_N_Freeze_Entity): Remove all Ghost-related code. * exp_disp.adb (Make_DT): Install and revert the Ghost region of the tagged type. Move the generation of various entities within the Ghost region of the type. * exp_prag.adb Remove with and use clauses for Ghost. (Expand_Pragma_Check): Remove all Ghost-related code. (Expand_Pragma_Contract_Cases): Remove all Ghost-related code. (Expand_Pragma_Initial_Condition): Remove all Ghost-related code. (Expand_Pragma_Loop_Variant): Remove all Ghost-related code. * exp_util.adb (Build_DIC_Procedure_Body): Install and revert the Ghost region of the working types. (Build_DIC_Procedure_Declaration): Install and revert the Ghost region of the working type. (Make_Invariant_Call): Install and revert the Ghost region of the associated type. (Make_Predicate_Call): Reimplemented. Install and revert the Ghost region of the associated type. * freeze.adb (Freeze_Entity): Install and revert the Ghost region of the entity being frozen. (New_Freeze_Node): Removed. * ghost.adb Remove with and use clauses for Opt. (Check_Ghost_Completion): Update the parameter profile and all references to formal parameters. (Ghost_Entity): Update the comment on usage. (Install_Ghost_Mode): New routines. (Is_Ghost_Assignment): New routine. (Is_Ghost_Declaration): New routine. (Is_Ghost_Pragma): New routine. (Is_Ghost_Procedure_Call): New routine. (Is_Ghost_Renaming): Removed. (Is_OK_Declaration): Reimplemented. (Is_OK_Pragma): Reimplemented. (Is_OK_Statement): Reimplemented. (Is_Subject_To_Ghost): Update the comment on usage. (Mark_And_Set_Ghost_Assignment): New routine. (Mark_And_Set_Ghost_Body): New routine. (Mark_And_Set_Ghost_Completion): New routine. (Mark_And_Set_Ghost_Declaration): New routine. (Mark_And_Set_Ghost_Instantiation): New routine. (Mark_And_Set_Ghost_Procedure_Call): New routine. (Mark_Full_View_As_Ghost): Removed. (Mark_Ghost_Declaration_Or_Body): New routine. (Mark_Ghost_Pragma): New routine. (Mark_Ghost_Renaming): New routine. (Mark_Pragma_As_Ghost): Removed. (Mark_Renaming_As_Ghost): Removed. (Propagate_Ignored_Ghost_Code): Update the comment on usage. (Prune_Node): Freeze nodes no longer need special pruning, they are processed by the general ignored Ghost code mechanism. (Restore_Ghost_Mode): New routine. (Set_Ghost_Mode): Reimplemented. (Set_Ghost_Mode_From_Entity): Removed. * ghost.ads Add with and use clauses for Ghost. (Check_Ghost_Completion): Update the parameter profile along with the comment on usage. (Install_Ghost_Mode): New routine. (Is_Ghost_Assignment): New routine. (Is_Ghost_Declaration): New routine. (Is_Ghost_Pragma): New routine. (Is_Ghost_Procedure_Call): New routine. (Mark_And_Set_Ghost_Assignment): New routine. (Mark_And_Set_Ghost_Body): New routine. (Mark_And_Set_Ghost_Completion): New routine. (Mark_And_Set_Ghost_Declaration): New routine. (Mark_And_Set_Ghost_Instantiation): New routine. (Mark_And_Set_Ghost_Procedure_Call): New routine. (Mark_Full_View_As_Ghost): Removed. (Mark_Ghost_Pragma): New routine. (Mark_Ghost_Renaming): New routine. (Mark_Pragma_As_Ghost): Removed. (Mark_Renaming_As_Ghost): Removed. (Restore_Ghost_Mode): New routine. (Set_Ghost_Mode): Redefined. (Set_Ghost_Mode_From_Entity): Removed. * sem.adb (Analyze): Install and revert the Ghost region of the node being analyzed. (Do_Analyze): Change the way a clean Ghost region is installed and reverted. * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove all Ghost-related code. (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code. (Analyze_Number_Declaration): Remove all Ghost-related code. (Analyze_Object_Declaration): Install and revert the Ghost region of a deferred object declaration's completion. (Array_Type_Declaration): Remove all Ghost-related code. (Build_Derived_Type): Update the comment on the propagation of Ghost attributes from a parent to a derived type. (Derive_Subprogram): Remove all Ghost-related code. (Make_Class_Wide_Type): Remove all Ghost-related code. (Make_Implicit_Base): Remove all Ghost-related code. (Process_Full_View): Install and revert the Ghost region of the partial view. There is no longer need to check the Ghost completion here. * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost region of the left hand side. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove all Ghost-related code. (Analyze_Expression_Function): Remove all Ghost-related code. (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code. (Analyze_Procedure_Call): Install and revert the Ghost region of the procedure being called. (Analyze_Subprogram_Body_Helper): Install and revert the Ghost region of the spec or body. (Analyze_Subprogram_Declaration): Remove all Ghost-related code. (Build_Subprogram_Declaration): Remove all Ghost-related code. (Find_Corresponding_Spec): Remove all Ghost-related code. (Process_Formals): Remove all Ghost-related code. * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert the Ghost region of the spec. (Analyze_Package_Declaration): Remove all Ghost-related code. * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Object_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it aliases a Ghost entity. * sem_ch11.adb Remove with and use clauses for Ghost. (Analyze_Exception_Declaration): Remove all Ghost-related code. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all Ghost-related code. (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related code. (Analyze_Package_Instantiation): Install and revert the Ghost region of the package instantiation. (Analyze_Subprogram_Instantiation): Install and revert the Ghost region of the subprogram instantiation. (Instantiate_Package_Body): Code clean up. Install and revert the Ghost region of the package body. (Instantiate_Subprogram_Body): Code clean up. Install and revert the Ghost region of the subprogram body. * sem_ch13.adb (Build_Predicate_Functions): Install and revert the Ghost region of the related type. (Build_Predicate_Function_Declaration): Code clean up. Install and rever the Ghost region of the related type. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Install and revert the Ghost region of the pragma. (Analyze_Initial_Condition_In_Decl_Part): Install and revert the Ghost region of the pragma. (Analyze_Pragma): Install and revert the Ghost region of various pragmas. Mark a pragma as Ghost when it is related to a Ghost entity or encloses a Ghost entity. (Analyze_Pre_Post_Condition): Install and revert the Ghost region of the pragma. (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the Ghost region of the pragma. * sem_res.adb (Resolve): Remove all Ghost-related code. * sem_util.adb (Is_Declaration): Reimplemented. (Is_Declaration_Other_Than_Renaming): New routine. * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine. * sinfo.adb (Is_Checked_Ghost_Pragma): New routine. (Is_Ghost_Pragma): Removed. (Is_Ignored_Ghost_Pragma): New routine. (Set_Is_Checked_Ghost_Pragma): New routine. (Set_Is_Ghost_Pragma): Removed. (Set_Is_Ignored_Ghost_Pragma): New routine. * sinfo.ads: Update the documentation on Ghost mode and Ghost regions. New attributes Is_Checked_Ghost_Pragma and Is_Ignored_Ghost_Pragma along with usages in nodes. Remove attribute Is_Ghost_Pragma along with usages in nodes. (Is_Checked_Ghost_Pragma): New routine along with pragma Inline. (Is_Ghost_Pragma): Removed along with pragma Inline. (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline. (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline. (Set_Is_Ghost_Pragma): Removed along with pragma Inline. (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline. From-SVN: r244395
2017-01-06[multiple changes]Arnaud Charlet1-0/+13
2017-01-06 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an iterator specification with a serious syntactic error, transform construct into an infinite loop in order to continue analysis and prevent a compiler abort. 2017-01-06 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate max_queue_lengths_array if unused. 2017-01-06 Bob Duff <duff@adacore.com> * errout.adb (Set_Msg_Text): Protect against out-of-bounds array access, in case "\" is at the end of Text. * stylesw.adb (Set_Style_Check_Options): Don't include input characters in the error message template, because they could be control characters such as "\", which Errout will try to interpret. 2017-01-06 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations): For a private type examine the visible declarations that follow the partial view, not just the private declarations that follow the full view. 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and code cleanup. From-SVN: r244133
2016-10-13[multiple changes]Arnaud Charlet1-6/+4
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-14[multiple changes]Arnaud Charlet1-0/+14
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-05-02get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when they are ↵Arnaud Charlet1-1/+1
declared... 2016-05-02 Arnaud Charlet <charlet@adacore.com> * get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when they are declared; refine type of a counter from Integer to Natural. * sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb, prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb, exp_ch3.adb: Minor editing. From-SVN: r235729
2016-05-02[multiple changes]Arnaud Charlet1-1/+3
2016-05-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch4.adb (Find_Indexing_Operations): Use the underlying type of the container base type in case the container is a subtype. * sem_ch5.adb (Analyze_Iterator_Specification): Ensure that the selector has an entity when checking for a component of a mutable object. 2016-05-02 Arnaud Charlet <charlet@adacore.com> Remove dead code. * opt.ads (Latest_Ada_Only): New flag. * sem_prag.adb, par-prag.adb: Ignore pragma Ada_xx under this flag. * usage.adb, switch-c.adb: Disable support for -gnatxx under this flag. * einfo.ads (Has_Predicates, Predicate_Function): Clarify that Has_Predicates does not imply that Predicate_Function will return a non-empty entity. 2016-05-02 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Qualified_Expression): Generate a predicate check if type requires it. * checks.adb (Apply_Predicate_Check): Disable checks in the object declaration created for an expression with side-effects that requires a predicate check to prevent infinite recursion during expansion. 2016-05-02 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_Formals): Check properly the type of a formal to determine whether a given convention applies to it. 2016-05-02 Doug Rupp <rupp@adacore.com> * tracebak.c: Add incantations for arm-vxworks[67] traceback. 2016-05-02 Thomas Quinot <quinot@adacore.com> * freeze.adb (Check_Component_Storage_Order): Make it a warning, not an error, to have a component with implicit SSO within a composite type that has explicit SSO. 2016-05-02 Bob Duff <duff@adacore.com> * s-stposu.adb (Allocate_Any_Controlled): Don't lock/unlock twice. 2016-05-02 Ed Schonberg <schonberg@adacore.com> * repinfo.adb (List_Entities): Make procedure recursive, to provide representation information for subprograms declared within subprogram bodies. From-SVN: r235713
2016-04-27[multiple changes]Arnaud Charlet1-1/+0
2016-04-27 Arnaud Charlet <charlet@adacore.com> * s-rident.ads: Make No_Implicit_Loops non partition wide. 2016-04-27 Arnaud Charlet <charlet@adacore.com> * sem_ch11.adb (Analyze_Handled_Statements): check useless assignments also in entries and task bodies, not only in procedures and declaration blocks. * sem_ch5.adb (Analyze_Block_Statement): check useless assignements in declaration blocks as part of processing their handled statement sequence, just like it was done for procedures and now is also done for entries and task bodies. * sem_warn.adb (Warn_On_Useless_Assignment): detect boundries of entries and task bodies just like of procedures. 2016-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (Is_Volatile_Function): Recognize a function declared within a protected type as well as the protected/unprotected version of a function. From-SVN: r235491
2016-04-21[multiple changes]Arnaud Charlet1-3/+5
2016-04-21 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch5.adb: Minor reformatting. 2016-04-21 Eric Botcazou <ebotcazou@adacore.com> * exp_ch2.adb (Expand_Current_Value): Make an appropriate character literal if the entity is of a character type. 2016-04-21 Arnaud Charlet <charlet@adacore.com> * exp_aggr.adb (Backend_Processing_Possible): Return False when generating C and aggregate contains function calls. 2016-04-21 Tristan Gingold <gingold@adacore.com> * krunch.adb (Krunch): Only partially krunch children of Interfaces that aren't known. 2016-04-21 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Make_Inline): Handle properly the instantiation of a generic subpprogram that carries an Inline aspect. Place inline info on the anonymous subprogram that is constructed in the wrapper package. (Analyze_Pragma, case Pure): Do not check placement if pragma appears within an instantiation, which can be nested at any level. * sem_ch12.adb (Analyze_Instance_And_Renamings): Do not copy Freeze node from anonymous subprogram to its visible renaming. The freeze node will be constructed if the subprogram carries delayed aspects. (Set_Global): Preserve dimension information if present (from code reading). 2016-04-21 Vasiliy Fofanov <fofanov@adacore.com> * gnatlink.adb: Change wording of the warning message on problematic filenames to be more neutral. Add a new substring "patch" introduced on Windows 10. From-SVN: r235313
2016-04-21[multiple changes]Arnaud Charlet1-15/+25
2016-04-21 Philippe Gil <gil@adacore.com> * tracebak.c (__gnat_backtrace): handle bad RIP values (win64 only) 2016-04-21 Javier Miranda <miranda@adacore.com> * exp_aggr.adb (Component_Not_OK_For_Backend): Return true for string literals. 2016-04-21 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Has_Non_Null_Abstract_State): New routine. * einfo.ads New synthesized attribute Has_Non_Null_Abstract_State along with occurrences in entities. (Has_Non_Null_Abstract_State): New routine. * sem_ch7.adb (Unit_Requires_Body): Add local variable Requires_Body. A package declaring an abstract state requires a body only when the state is non-null and the package contains at least one other construct that requires completion in a body. * sem_util.adb (Mode_Is_Off): Removed. (Requires_State_Refinement): Remove an obsolete check. Code cleanup. 2016-04-21 Bob Duff <duff@adacore.com> * sem_attr.adb (Analyze_Attribute): In processing the 'Old attribute, a warning is given for infinite recursion. Fix the code to not crash when the prefix of 'Old denotes a protected function. * sem_ch5.adb (Analyze_Iterator_Specification): Avoid calling Is_Dependent_Component_Of_Mutable_Object in cases where the parameter would not be an object. 2016-04-21 Eric Botcazou <ebotcazou@adacore.com> * sem_eval.adb (Compile_Time_Compare): Be prepared for an empty Etype or Underlying_Type of the operands. 2016-04-21 Eric Botcazou <ebotcazou@adacore.com> * atree.adb (Print_Statistics): Protect against overflows and print the memory consumption in bytes. * table.adb (Reallocate): Do the intermediate calculation of the new size using the Memory.size_t type. From-SVN: r235312
2016-04-20sem_util.ads, [...] (Is_Expanded_Priority_Attribute): New predicate to ↵Ed Schonberg1-6/+1
determine that in a context with full run-time... 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute): New predicate to determine that in a context with full run-time, a function call is an expansion of a reference to attribute Priority. * sem_ch5.adb (Analyze_Function_Call): use it. * exp_ch5.adb (Expand_N_Subprogram_Call): use it. From-SVN: r235265
2016-04-20[multiple changes]Arnaud Charlet1-12/+2
2016-04-20 Javier Miranda <miranda@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Remove transient scope associated with the renaming object declaration. * exp_util.adb (Insert_Actions): Remove handling of iterator loop marked as requiring the secondary stack. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Image): Implement AI12-0124, which extends the functionality of the attribute so it reflects the semantics of GNAT 'Img when applied to scalar types. * lib-xref.adb: minor whitespace layout fix. From-SVN: r235242
2016-04-20[multiple changes]Arnaud Charlet1-10/+12
2016-04-20 Vincent Celier <celier@adacore.com> * clean.adb (Gnatclean): Fail if project file specified and gprclean is not available. * gnatname.adb: Fail is -P is used and gprname is not available. * make.adb (Initialize): Fail if project file specified and gprbuild is not available. 2016-04-20 Bob Duff <duff@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary stack when possible. From-SVN: r235241
2016-04-20[multiple changes]Arnaud Charlet1-6/+9
2016-04-20 Gary Dismukes <dismukes@adacore.com> * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and reformatting. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool): If the pragma comes from an aspect specification, verify that the aspect applies to an entity with a declarative part. * exp_ch5.adb: Code cleanup. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_If_Expression): If first expression is universal, resolve subsequent ones with the corresponding class type (Any_Integer or Any_Real). 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is disabled, complete the analysis of the iterator name to ensure that reference for entities within are properly generated. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * a-dispat.ads (Yield): add Global contract. * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time. * a-taside.adb: Added Initializes => Tasking_State. From-SVN: r235240
2016-04-18[multiple changes]Arnaud Charlet1-1/+1
2016-04-18 Arnaud Charlet <charlet@adacore.com> * einfo.adb (Overridden_Operation): assert that function is called for valid arguments. * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb, s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads, sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb, sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb, s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb: No space after closing parenthesis except where required for layout. * sem_res.adb: Minor reformatting. 2016-04-18 Arnaud Charlet <charlet@adacore.com> * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case statement when relevant. 2016-04-18 Bob Duff <duff@adacore.com> * a-cuprqu.adb (Enqueue): Properly handle the case where the new element has a unique priority. 2016-04-18 Tristan Gingold <gingold@adacore.com> * adaint.h: Define stat structures and functions for iOS simulator. From-SVN: r235146
2016-04-18[multiple changes]Arnaud Charlet1-16/+0
2016-04-18 Arnaud Charlet <charlet@adacore.com> * exp_ch4.adb, gnat1drv.adb, opt.ads, sem_res.adb (Minimize_Expression_With_Actions): New flag. (Adjust_Global_Switches): Set Minimize_Expression_With_Actions when generating C. (Resolve_Short_Circuit): Redo previous change using Minimize_Expression_With_Actions. (Expand_N_If_Expression, Expand_Short_Circuit_Operator): Restore old code to avoid Expression_With_Actions when Minimize_Expression_With_Actions is set. 2016-04-18 Vincent Celier <celier@adacore.com> * s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File and Stderr_File): Close local file descriptors when no longer needed. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Remove SPARK mode check that the type of the cursor in an iteration over a formal container is not volatile. The proper check on the element type is done elsewhere. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_Formals): Do not set a delay freeze on a subprogram that returns a class-wide type, if the subprogram is a compilation unit, because otherwise gigi will treat the subprogram as external, leading to link errors. From-SVN: r235141
2016-04-18[multiple changes]Arnaud Charlet1-8/+25
2016-04-18 Yannick Moy <moy@adacore.com> * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate raise node in GNATprove mode. 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com> * s-fileio.adb: Minor reformatting. * sem_prag.adb (Analyze_Input_Item): Add local variable Input_OK. Do not consider mappings of generic formal parameters to actuals. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived type, the cursor is declared in the scope of the parent type. (Analyze_Parameter_Specification): A qualified expression with an iterator type indicates an iteration over a container (explicit or implicit). From-SVN: r235139
2015-11-18[multiple changes]Arnaud Charlet1-0/+9
2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): Diagnose assignment where left-hand side has a limited view of a class-wide type. * sem_ch6.adb (Detected_And_Exchange): Do not install a non-limited view if the scope of the type of the formal is visible through a limited_with_clause, even if the non-limited view is available. 2015-11-18 Emmanuel Briot <briot@adacore.com> * s-pooglo.ads: Make Global_Pool_Object aliased. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Access): If the prefix is an expression function, do not analyze the generated body if the current scope is not the scope of the expression function, as may happen if the attribute is an actual in an instantiation. * sem_ch10.adb, sem_ch12.adb, a-stzmap.adb, s-soflin.adb, a-stwima.adb: Fix typos. 2015-11-18 Arnaud Charlet <charlet@adacore.com> * exp_ch11.adb (Expand_N_Exception_Declaration): No-op when generating C code. 2015-11-18 Vincent Celier <celier@adacore.com> * g-comlin.adb (Find_Longest_Matching_Switch): Do not take into account a switch ending with '=' when the actual command line switch is not followed with a space or '='. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Explicit_Dereference): Do not add an access check if the type of the prefix is known to exclude null. * a-coinve.adb (Get_Element_Access): The function returns an access type that excludes null, so add an explicit check for a null element pointer, which is created when Insert_Spaces is called on an indefinite vector container. From-SVN: r230533
2015-11-13[multiple changes]Arnaud Charlet1-6/+7
2015-11-13 Eric Botcazou <ebotcazou@adacore.com> * sigtramp-ios.c, init.c: Minor cosmetic tweaks. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * s-gloloc.adb, g-debpoo.adb: Minor reformatting. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Improve error message for the case the iterable name (array or container) is a component that depends on a discriminant. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Indicate_Name_And_Type): If the analysis of one interpretation succeeds, set type of name in call, for completeness. (Try_Container_Indexing): If there are multiple indexing functions, collect possible interpretations that are compatible with given parameters, and add implicit dereference types when present. * sem_util.adb (Build_Explicit_Dereference): If the expression is an overloaded function call use the given discriminant to resolve the call, and set properly the type of the call and of the resulting dereference. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Pragma Constant_After_Elaboration can now apply to a variable without an initialization expression. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch9.adb (Add_Matching_Formals): Parameter Actuals is now of mode IN OUT. Create a new list when list Actuals is not present. (Build_Contract_Wrapper): Create the wrapper only when the entry has at least on checked contract case or pre/postcondition. Ensure that the call to the original entry lacks an actual parameter list when the entry appears without formal parameters. (Expand_Entry_Declaration): Code cleanup. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Continue the analysis after encountering an illegal aspect Part_Of. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case Overlaps_Storage): Add copies for nodes that represent the integer addresses of the two actuals, to prevent identical nodes in the tree, which the backend cannot handle properly. From-SVN: r230316
2015-10-26[multiple changes]Arnaud Charlet1-3/+4
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb, sem_aux.adb, exp_attr.adb, sem_eval.adb: Minor reformatting. * sem_util.adb, sem_ch5.adb: Minor reformatting. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * exp_unst.adb (Unnest_Subprogram): Add guard to prevent compiler abort when handling a reference to a formal in an aspect of a nested subprogram declaration as an uplevel reference. From-SVN: r229359
2015-10-26[multiple changes]Arnaud Charlet1-1/+12
2015-10-26 Bob Duff <duff@adacore.com> * snames.ads-tmpl, aspects.adb, aspects.ads: Add the aspect and pragma names and enter into relevant tables. * sem_ch13.adb (Analyze_Aspect_Specifications): Analyze aspect Predicate_Failure. * sem_prag.adb (Predicate_Failure): Analyze pragma Predicate_Failure. * exp_util.adb (Make_Predicate_Check): When building the Check pragma, if Predicate_Failure has been specified, add the relevant String argument to the pragma. * par-prag.adb (Prag): Add Predicate_Failure to list of pragmas handled during semantic analysis. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): If the left-hand side is an indexed component with generalized indexing, discard interpretation that yields a reference type, which is not assignable. This prevent spurious ambiguities when the right-hand side is an aggregate which does not provide a target type. From-SVN: r229358
2015-10-26[multiple changes]Arnaud Charlet1-1/+7
2015-10-26 Bob Duff <duff@adacore.com> * s-fileio.adb (Fopen_Mode): Use "r+" for Out_File/Stream_IO, so the file won't be truncated on 'fopen', as required by AI95-00283-1. 2015-10-26 Bob Duff <duff@adacore.com> * gnat1drv.adb, prj.adb, sem_ch6.adb, s-regpat.adb, sem_prag.adb: Fix typos. * einfo.ads, restrict.ads: Minor comment fixes. * err_vars.ads, sem_util.adb, errout.ads: Code clean up. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): Do not check that the Left-hand side is legal in an inlined body, check is done on the original template. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * exp_util.ads, exp_util.adb (Find_Primitive_Operations): New subprogram to retrieve by name the possibly overloaded set of primitive operations of a type. * sem_ch4.adb (Try_Container_Indexing): Use Find_Primitive_Operations to handle overloaded indexing operations of a derived type. From-SVN: r229343