aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/atree.ads
AgeCommit message (Collapse)AuthorFilesLines
2018-01-11[Ada] Bump copyright notices to 2018Arnaud Charlet1-1/+1
2018-01-11 Arnaud Charlet <charlet@adacore.com> gcc/ada/ Bump copyright notices to 2018. From-SVN: r256519
2017-11-16[multiple changes]Pierre-Marie de Rodat1-0/+27
2017-11-16 Hristian Kirtchev <kirtchev@adacore.com> * atree.ads (Nkind_In): Add 10 and 11 parameter versions. * checks.adb (Install_Primitive_Elaboration_Check): Mark the setting of the elaboration flag as elaboration code. * einfo.adb (Contract): Update the comments. (Ignore_SPARK_Mode_Pragmas): Update the comments. (SPARK_Aux_Pragma): Update the comments. (SPARK_Aux_Pragma_Inherited): Update the comments. (SPARK_Pragma): Update the comments. The attribute now applies to all types and abstract states. (SPARK_Pragma_Inherited): Update the comments. The attribute now applies to all types and abstract states. (Set_Contract): Update the comments. (Set_Ignore_SPARK_Mode_Pragmas): Update the comments. (Set_SPARK_Aux_Pragma): Update the comments. (Set_SPARK_Aux_Pragma_Inherited): Update the comments. (Set_SPARK_Pragma): Update the comments. The attribute now applies to all types and abstract states. (Set_SPARK_Pragma_Inherited): Update the comments. The attribute now applies to all types and abstract states. (Write_Field40_Name): Add output for SPARK_Pragma when it appears on a type and abstract states. * einfo.ads: Update the documentation of attributes SPARK_Pragma and SPARK_Pragma_Inherited. Both of them now apply to all types and abstract states. * exp_util.adb (Set_Elaboration_Flag): Mark the setting of the elaboration flag as elaboration code. * sem_ch3.adb: Add with and use clauses for Sem_Elab. (Analyze_Full_Type_Declaration): Set the SPARK_Mode of the type. Record a derived type for later processing by the ABE mechanism. (Analyze_Incomplete_Type_Decl): Set the SPARK_Mode of the type. (Analyze_Private_Extension_Declaration): Set the SPARK_Mode of the type. * sem_ch7.adb (Analyze_Private_Type_Declaration): Set the SPARK_Mode of the type. * sem_elab.adb: Define the term "early call region". Update the terminology for "scenario" and "target". Update the architecture of the ABE mechanism. Update the steps which must be taken when adding a new scenario. Update the section on debugging ABE issues. Add new hash tables Early_Call_Regions and Recorded_SPARK_Scenarios. Add new table SPARK_Scenarios. Hash table Elaboration_Context is now Elaboration_Statuses. The majority of Process_xxx routines have been updated to better reflect their role. (Add_Unit): Reimplemented. (Check_Elaboration_Constituent): New routine. (Check_Elaboration_Scenarios): Verify previously recorded scenarios for conditional ABE issues. Verify previously recorded SPARK scenarios. (Check_SPARK_Derived_Type): New routine. (Check_SPARK_Instantiation): New routine. (Check_SPARK_Scenario): New routine. (Check_SPARK_Refined_State_Pragma): New routine. (Early_Call_Region): New routine. (Elaboration_Status): New routine. (Ensure_Prior_Elaboration): Add new formal parameter Prag_Nam. The implicit Elabotate[_All] pragma is now specified via Prag_Nam. (Find_Early_Call_Region): New routine. (Info_Scenario): Add output for refinement constituents. (Is_Recorded_SPARK_Scenario): New routine. (Is_Suitable_SPARK_Derived_Type): New routine. (Is_Suitable_SPARK_Instantiation): New routine. (Is_Suitable_SPARK_Refined_State_Pragma): New routine. (Is_Visited_Body): New routine. (Kill_Elaboration_Scenario): Reimplemented. (Output_Active_Scenarios): Add output for pragma Refined_State. (Output_SPARK_Refined_State_Pragma): New routine. (Process_Conditional_ABE_Call): Remove the use of -gnatd.v. The effect is now achieved by different means. (Process_Conditional_ABE_Call_SPARK): Verify that a call which precedes the subprogram body appears within the early call region of the body. Either ensure the prior elaboration of external subprograms or verify that the context meets the suitable elaboration requirement. (Process_Conditional_ABE_Instantiation_SPARK): New routine. (Record_Elaboration_Scenario): Reimplement the portion which enforces the level restrictions of the static model. Add support for SPARK scenarios. (Record_SPARK_Elaboration_Scenario): New routine. (Reset_Visited_Bodies): New routine. (Set_Early_Call_Region): New routine. (Set_Elaboration_Status): New routine. (Set_Is_Recorded_SPARK_Scenario): New routine. (Update_Elaboration_Scenario): Reimplemented. * sem_elab.ads: Add new subtype Library_Or_Instantiation_Level. * sem_prag.adb (Analyze_Refined_State_In_Decl_Part): Save the pragma for examination by the ABE Processing phase. (Create_Abstract_State): Save the SPARK_Mode from the context. * sem_util.adb (Is_Non_Preelaborable_Construct): New routine. * sem_util.ads (Is_Non_Preelaborable_Construct): New routine. * sinfo.adb (Is_Elaboration_Code): New routine. (Set_Is_Elaboration_Code): New routine. (Nkind_In): Add 10 and 11 parameter versions. * sinfo.ads: Add new attribute Is_Elaboration_Code along with occurrences in nodes. (Is_Elaboration_Code): New routine along with pragma Inline. (Set_Is_Elaboration_Code): New routine along with pragma Inline. (Nkind_In): Add 10 and 11 parameter versions. 2017-11-16 Justin Squirek <squirek@adacore.com> * sem.adb (Analyze): Remove requirement that the original node of N be an operator in the case that analysis on the node yields the relevant operator - so prefer it instead. From-SVN: r254802
2017-10-09[multiple changes]Pierre-Marie de Rodat1-11/+17
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-04-28[multiple changes]Arnaud Charlet1-3/+9
2017-04-28 Javier Miranda <miranda@adacore.com> * atree.ads (Info_Messages): Removed. (Warning_Info_Messages): New counter. (Report_Info_Messages): New counter. * err_vars.ads Update documentation. * errout.adb (Delete_Warning_And_Continuations): Update Info_Message occurrences. (Error_Msg_Internal): Update Info_Message occurrences. (Delete_Warning): Update Info_Message occurrences. (Write_Error_Summary): Update Info_Message occurrences. (Output_Messages): Update Info_Message occurrences. (To_Be_Removed): Update Info_Message occurrences. (Reset_Warnings): Update Info_Message occurrences. * errutil.adb (Error_Msg): Update Info_Message occurrences. (Finalize): Update Info_Message occurrences. (Initialize): Update Info_Message occurrences. * erroutc.adb (Delete_Msg): Update Info_Message occurrences. (Compilation_Errors): Update Info_Message_Occurences. 2017-04-28 Eric Botcazou <ebotcazou@adacore.com> * exp_ch3.adb (Build_Init_Statements): Likewise on Nam. * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned. * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node. * sem_attr.adb (Loop_Entry): Initialize Encl_Loop. * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr. * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and Y_Size. * sem_eval.adb (Why_Not_Static): Initialize Typ. * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str. From-SVN: r247390
2017-04-27[multiple changes]Arnaud Charlet1-6/+6
2017-04-27 Gary Dismukes <dismukes@adacore.com> * sem_ch4.adb: Minor reformatting. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Associations): minor reformatting. (Check_Fixed_Point_Actual): Do not emit a warning on a fixed point type actual that has user-defined arithmetic primitives, when there is a previous actual for a formal package that defines a fixed-point type with the parent user-defined operator. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Generate_Range_Check): Reinstate part of previous change. * sem_attr.adb (Resolve_Attribute): Generate a range check when the component type allows range checks. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_aux.adb (Is_Generic_Formal): Use original node to locate corresponding declaration, because formal derived types are rewritten as private extensions. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check dimensions of operands if node has been analyzed already, because previous analysis and dimension checking will have removed the dimension information from the operands. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * debug.adb: Document the use of switch -gnatd.s. * einfo.ads Update the documentation on attribute Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove the uses of these attributes from certain entities. * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry which determines whether the block should continue to manage the secondary stack. (Manages_Sec_Stack): New routine. 2017-04-27 Bob Duff <duff@adacore.com> * atree.ads: Minor edit. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sinfo.ads: Update the section on Ghost mode. Add a section on SPARK mode. Update the placement of section on expression functions. 2017-04-27 Bob Duff <duff@adacore.com> * sinput.adb (Get_Source_File_Index): Don't assert that S is in the right range in the case where this is a .dg file under construction. 2017-04-27 Yannick Moy <moy@adacore.com> * sem_util.adb (Check_Result_And_Post_State): Handle more precisely each conjunct in expressions formed by and'ing sub-expressions. From-SVN: r247295
2017-01-20[multiple changes]Arnaud Charlet1-0/+9
2017-01-20 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check for illegal inherited Implicit_Dereference aspects with renamed discriminants. 2017-01-20 Javier Miranda <miranda@adacore.com> * debug.adb (switch d.6): do not avoid declaring unreferenced itypes. * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms. * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms. (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent, Set_Prev, Tree_Read): Adding assertion. * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms. * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms. (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source, Set_Ekind, Set_Error_Posted, Set_Has_Aspects, Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count, Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN, Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN, Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent, Set_ListN_With_Parent): Adding assertion. 2017-01-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Process_Convention): Diagnose properly a pragma import that applies to several homograph subprograms. when one of them is declared by a subprogram body. 2017-01-20 Justin Squirek <squirek@adacore.com> * exp_ch6.adb (Expand_Call): Remove optimization that nulls out calls to null procedures. From-SVN: r244699
2017-01-13[multiple changes]Arnaud Charlet1-4/+4
2017-01-13 Javier Miranda <miranda@adacore.com> * sem_ch6.adb (Cloned_Expression): New subprogram. (Freeze_Expr_Types): Complete previous patch since the expression of an expression-function may have iterators and loops with defining identifiers which, as part of the preanalysis of the expression, may be left decorated with itypes that will not be available in the tree passed to the backend. 2017-01-13 Ed Schonberg <schonberg@adacore.com> * checks.adb (Apply_Type_Conversion_Checks): Optimize a type conversion to Integer of an expression that is an attribute reference 'Pos on an enumeration type. 2017-01-13 Bob Duff <duff@adacore.com> * atree.ads: Minor comment fix. From-SVN: r244423
2016-10-13[multiple changes]Arnaud Charlet1-0/+2
2016-10-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Remove the aspects of the original expression function has been rewritten into a subprogram declaration or a body. Reinsert the aspects once they have been analyzed. 2016-10-13 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Expand_N_Asynchronous_Select): Return immediately on restricted profile. 2016-10-13 Javier Miranda <miranda@adacore.com> * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Register the pragma for its validation after the backend has been called only if its expression has some occurrence of attributes 'size or 'alignment * table.ads (Release_Threshold): New formal. (Release): Adding documentation of its new functionality. * table.adb (Release): Extend its functionality with a Release_Threshold. * nlists.adb (Next_Node table): Set its Release_Threshold. * atree.adb (Orig_Nodes table): Set its Release_Threshold. * atree.ads (Nodes table): Set its Release_Threshold. (Flags table): Set its Release_Threshold. * alloc.ads (Nodes_Release_Threshold): New constant declaration. (Orig_Nodes_Release_Threshold): New constant declaration. * debug.adb (switch d.9): Left free. * gnat1drv.adb (Post_Compilation_Validation_Checks): Enable validation of pragmas Compile_Time_Error and Compile_Time_Warning. From-SVN: r241117
2016-06-20[multiple changes]Arnaud Charlet1-1/+7
2016-06-16 Hristian Kirtchev <kirtchev@adacore.com> * atree.ads, atree.adb (Elist29): New routine. (Set_Elist29): New routine. * atree.h New definition for Elist29. * einfo.adb Subprograms_For_Type is now an Elist rather than a node. Has_Invariants is now a synthesized attribute and does not require a flag. Has_Own_Invariants is now Flag232. Has_Inherited_Invariants is Flag291. Is_Partial_Invariant_Procedure is Flag292. (Default_Init_Cond_Procedure): Reimplemented. (Has_Inherited_Invariants): New routine. (Has_Invariants): Reimplemented. (Has_Own_Invariants): New routine. (Invariant_Procedure): Reimplemented. (Is_Partial_Invariant_Procedure): New routine. (Partial_Invariant_Procedure): Reimplemented. (Predicate_Function): Reimplemented. (Predicate_Function_M): Reimplemented. (Set_Default_Init_Cond_Procedure): Reimplemented. (Set_Has_Inherited_Invariants): New routine. (Set_Has_Invariants): Removed. (Set_Has_Own_Invariants): New routine. (Set_Invariant_Procedure): Reimplemented. (Set_Is_Partial_Invariant_Procedure): New routine. (Set_Partial_Invariant_Procedure): Reimplemented. (Set_Predicate_Function): Reimplemented. (Set_Predicate_Function_M): Reimplemented. (Set_Subprograms_For_Type): Reimplemented. (Subprograms_For_Type): Reimplemented. (Write_Entity_Flags): Output Flag232 and Flag291. * einfo.ads Add new attributes Has_Inherited_Invariants Has_Own_Invariants Is_Partial_Invariant_Procedure Partial_Invariant_Procedure Change the documentation of attributes Has_Inheritable_Invariants Has_Invariants Invariant_Procedure Is_Invariant_Procedure Subprograms_For_Type (Has_Inherited_Invariants): New routine along with pragma Inline. (Has_Own_Invariants): New routine along with pragma Inline. (Is_Partial_Invariant_Procedure): New routine along with pragma Inline. (Partial_Invariant_Procedure): New routine. (Set_Has_Inherited_Invariants): New routine along with pragma Inline. (Set_Has_Invariants): Removed along with pragma Inline. (Set_Has_Own_Invariants): New routine along with pragma Inline. (Set_Is_Partial_Invariant_Procedure): New routine along with pragma Inline. (Set_Partial_Invariant_Procedure): New routine. (Set_Subprograms_For_Type): Update the signature. (Subprograms_For_Type): Update the signature. * exp_ch3.adb Remove with and use clauses for Sem_Ch13. (Build_Array_Invariant_Proc): Removed. (Build_Record_Invariant_Proc): Removed. (Freeze_Type): Build the body of the invariant procedure. (Insert_Component_Invariant_Checks): Removed. * exp_ch7.adb Add with and use clauses for Sem_Ch6, Sem_Ch13, and Stringt. (Build_Invariant_Procedure_Body): New routine. (Build_Invariant_Procedure_Declaration): New routine. * exp_ch7.ads (Build_Invariant_Procedure_Body): New routine. (Build_Invariant_Procedure_Declaration): New routine. * exp_ch9.adb (Build_Corresponding_Record): Do not propagate attributes related to invariants to the corresponding record when building the corresponding record. This is done by Build_Invariant_Procedure_Declaration. * exp_util.adb (Make_Invariant_Call): Reimplemented. * freeze.adb (Freeze_Array_Type): An array type requires an invariant procedure when its component type has invariants. (Freeze_Record_Type): A record type requires an invariant procedure when at least one of its components has an invariant. * sem_ch3.adb (Analyze_Private_Extension_Declaration): Inherit invariant-related attributes. (Analyze_Subtype_Declaration): Inherit invariant-related attributes. (Build_Derived_Record_Type): Inherit invariant-related attributes. (Check_Duplicate_Aspects): Reimplemented. (Get_Partial_View_Aspect): New routine. (Process_Full_View): Inherit invariant-related attributes. Reimplement the check on hidden inheritance of class-wide invariants. (Remove_Default_Init_Cond_Procedure): Reimplemented. * sem_ch6.adb (Analyze_Subprogram_Specification): Do not modify the controlling type for an invariant procedure declaration or body. (Is_Invariant_Procedure_Or_Body): New routine. * sem_ch7.adb (Analyze_Package_Specification): Build the partial invariant body in order to preanalyze and resolve all invariants of a private type at the end of the visible declarations. Build the full invariant body in order to preanalyze and resolve all invariants of a private type's full view at the end of the private declarations. (Preserve_Full_Attributes): Inherit invariant-related attributes. * sem_ch9.adb (Analyze_Protected_Type_Declaration): Ensure that aspects are analyzed with the proper view when the protected type is a completion of a private type. Inherit invariant-related attributes. (Analyze_Task_Type_Declaration): Ensure that aspects are analyzed with the proper view when the task type is a completion of a private type. Inherit invariant-related attributes. * sem_ch13.adb Remove with and use clauses for Stringt. (Build_Invariant_Procedure_Declaration): Removed. (Build_Invariant_Procedure): Removed. (Freeze_Entity_Checks): Do not build the body of the invariant procedure here. The body is built when the type is frozen in Freeze_Type. (Inherit_Aspects_At_Freeze_Point): Do not inherit any attributes related to invariants here because this leads to erroneous inheritance. (Replace_Node): Rename to Replace_Type_Ref. * sem_ch13.ads (Build_Invariant_Procedure_Declaration): Removed. (Build_Invariant_Procedure): Removed. * sem_prag.adb Add with and use clauses for Exp_Ch7. (Analyze_Pragma): Reimplement the analysis of pragma Invariant. * sem_res.adb (Resolve_Actuals): Emit a specialized error when the context is an invariant. * sem_util.adb (Get_Views): New routine. (Incomplete_Or_Partial_View): Consider generic packages when examining declarations. (Inspect_Decls): Consider full type declarations because they may denote a derivation from a private type. (Propagate_Invariant_Attributes): New routine. * sem_util.ads (Get_Views): New routine. (Propagate_Invariant_Attributes): New routine. 2016-06-16 Arnaud Charlet <charlet@adacore.com> * pprint.adb (Expression_Image): Add better handling of UCs, we don't want to strip them all for clarity. From-SVN: r237596
2016-04-18[multiple changes]Arnaud Charlet1-0/+4
2016-04-18 Arnaud Charlet <charlet@adacore.com> * a-intsig.ads, a-intsig.adb: Removed, no longer used. * Makefile.rtl: update accordingly. 2016-04-18 Eric Botcazou <ebotcazou@adacore.com> * sem_type.adb (Disambiguate): Call Covers only when necessary for standard operators. 2016-04-18 Eric Botcazou <ebotcazou@adacore.com> * atree.ads (Num_Extension_Nodes): Add couple of figures to comment. * atree.adb: Add GNAT.Heap_Sort_G dependency. (Print_Statistics): New exported procedure to print statistics. 2016-04-18 Eric Botcazou <ebotcazou@adacore.com> * exp_ch3.adb (Build_Record_Init_Proc): Do not mark the procedure as to be inlined if the type needs finalization. From-SVN: r235106
2016-04-18[multiple changes]Arnaud Charlet1-8/+8
2016-04-18 Arnaud Charlet <charlet@adacore.com> * sem_prag.adb (Process_Convention): Relax rule on exporting Intrinsic types if Relaxed_RM_Semantics is True. 2016-04-18 Vincent Celier <celier@adacore.com> * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads, checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads, sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads, sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb, exp_ch3.ads, exp_unst.adb: Change "descendent" to "descendant" in comments, error messages and identifiers. 2016-04-18 Eric Botcazou <ebotcazou@adacore.com> * sem_type.adb (Operator_Matches_Spec): Call First_Formal on New_S only once at the beginning of the function. From-SVN: r235100
2015-11-18[multiple changes]Arnaud Charlet1-0/+6
2015-11-18 Hristian Kirtchev <kirtchev@adacore.com> * atree.adb (Elist11): New routine. (Set_Elist11): New routine. * atree.ads (Elist11): New routine. (Set_Elist11): New routine. * atree.h: Define Elist11. * contracts.adb (Analyze_Object_Contract): Verify the legality of all references to a variable given that the variable is a constituent of a single protected/task type. * einfo.adb: Part_Of_References now utilizes Elist11. (Part_Of_References): New routine. (Set_Part_Of_References): New routine. (Write_Field11_Name): Add output for Part_Of_References. * einfo.ads New attribute Part_Of_References along with usage in entities. (Part_Of_References): New routine along with pragma Inline. (Set_Part_Of_References): New routine along with pragma Inline. * sem_prag.adb (Analyze_Constituent): Record a possible reference to a concurrent constituent. (Analyze_Global_Item): Record a possible reference to a concurrent constituent. (Analyze_Input_Output): Record a possible reference to a concurrent constituent. * sem_res.adb (Resolve_Entity_Name): Record a possible reference to a concurrent constituent. * sem_util.adb (Check_Part_Of_Reference): New routine. (Record_Possible_Part_Of_Reference): New routine. * sem_util.ads (Check_Part_Of_Reference): New routine. (Record_Possible_Part_Of_Reference): New routine. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated): An if_expression is the proper place to apply the overflow minimization procedure if its context is not an enclosing arithmetic expression. From-SVN: r230540
2015-11-12[multiple changes]Arnaud Charlet1-1/+1
2015-11-12 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Find_Selected_Component): In a synchronized body, a reference to an operation of an object of the same synchronized type was always interpreted as a reference to the current instance. This is not always the case, as the prefix of the reference may designate an object of the same type declared in the enclosing context prior to the body. 2015-11-12 Arnaud Charlet <charlet@adacore.com> * impunit.ads, impunit.adb (Get_Kind_Of_File): New. Cleaned up implementation from previous Get_Kind_Of_Unit. (Get_Kind_Of_Unit): Reimplemented using Get_Kind_Of_File. * debug.adb: Remove d.4 switch, no longer used. * opt.ads: Update doc on Debugger_Level. * gnat1drv.adb: Code clean ups. * sinput.ads: minor fix in comment 2015-11-12 Bob Duff <duff@adacore.com> * sinfo.adb, sinfo.ads, sem_ch6.adb, atree.ads: Add Was_Expression_Function flag, which is set in sem_ch6.adb when converting an Expression_Function into a Subprogram_Body. 2015-11-12 Pascal Obry <obry@adacore.com> * usage.adb: Update overflow checking documentation. From-SVN: r230243
2015-10-26[multiple changes]Arnaud Charlet1-0/+54
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * atree.ads, atree.adb (Ekind_In): New 10 and 11 parameter versions. * contracts.ads, contracts.adb (Analyze_Initial_Declaration_Contract): New routine. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Analyze the contract of the initial declaration. (Analyze_Subprogram_Body_Helper): Analyze the contract of the initial declaration. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the contract of the initial declaration. * sem_ch9.adb (Analyze_Entry_Body): Analyze the contract of the initial declaration. (Analyze_Protected_Body): Analyze the contract of the initial declaration. (Analyze_Task_Body): Analyze the contract of the initial declaration. * sem_prag.adb (Add_Entity_To_Name_Buffer): Use "type" rather than "unit" as it makes the error messages sound better. (Add_Item_To_Name_Buffer): Update comment on usage. The routine now supports discriminants and current instances of concurrent types. (Analyze_Depends_In_Decl_Part): Install the discriminants of a task type. (Analyze_Global_In_Decl_Part): Install the discriminants of a task type. (Analyze_Global_Item): Add processing for current instances of concurrent types and include discriminants as valid global items. (Analyze_Input_Output): Discriminants and current instances of concurrent types are now valid items. Update various error messages. (Check_Usage): Current instances of protected and task types behaves as formal parameters. (Collect_Subprogram_Inputs_Outputs): There is no longer need to manually analyze [Refined_]Global thanks to freezing of initial declaration contracts. Add processing for the current instance of a concurrent type. (Find_Role): Add categorizations for discriminants, protected and task types. (Is_CCT_Instance): New routine. (Match_Items): Update the comment on usage. Update internal comments. * sem_prag.ads (Collect_Subprogram_Inputs_Outputs): Update the comment on usage. * sem_util.adb (Entity_Of): Ensure that the entity is an object when traversing a potential renaming chain. (Fix_Msg): Use "type" rather than "unit" as it makes the error messages sound better. * sem_util.ads (Fix_Msg): Update the comment on usage. 2015-10-26 Arnaud Charlet <charlet@adacore.com> * par.adb (Par): Do not generate an error when generating SCIL for predefined units or new children of system and co. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * einfo.adb: Access_Disp_Table applies to a private extension. From-SVN: r229373
2015-10-26[multiple changes]Arnaud Charlet1-0/+6
2015-10-26 Bob Duff <duff@adacore.com> * exp_ch7.adb, exp_ch6.adb: Minor comment fix. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb (Move_Or_Merge_Aspects): Move all aspects related to a single concurrent type declaration to the declaration of the anonymous object if they qualify. (Relocate_Aspect): Update comment on usage. * aspects.ads Add new sectioon on aspect specifications on single concurrent types. Add new table Aspect_On_Anonymous_Object_OK. (Move_Or_Merge_Aspects): Udate the comment on usage. * atree.adb (Elist36): New routine. (Set_Elist36): New routine. * atree.ads (Elist36): New routine along with pragma Inline. (Set_Elist36): New routine along with pragma Inline. * atree.h: Elist36 is now an alias for Field36. * contracts.adb (Add_Contract_Item): Add processing for protected units and extra processing for variables. (Analyze_Object_Contract): Code cleanup. The processing of Part_Of now depends on wherer the object is a constant or a variable. Add processing for pragmas Depends and Global when they apply to a single concurrent object. Verify that a variable which is part of a single concurrent type has full default initialization. Set/restore the SPARK_Mode of a single concurrent object. (Analyze_Protected_Contract): New routine. * contracts.ads (Add_Contract_Item): Update the comment on usage. (Analyze_Object_Contract): Update the comment on usage. (Analyze_Protected_Contract): New routine. (Analyze_Task_Contract): Update the comment on usage. * einfo.adb Part_Of_Constituents now uses Elist10. (Anonymous_Object): New routine. (Contract): Code cleanup. (Has_Option): Remove the assumption that the only simple option is External. (Is_Synchronized_State): New routine. (Part_Of_Constituents): This attribute applies to variables and uses Elist10. (Set_Anonymous_Object): New routine. (Set_Contract): Code cleanup. (Set_Part_Of_Constituents): This attribute applies to variables and uses Elist10. (Set_SPARK_Aux_Pragma): Code cleanup. (Set_SPARK_Aux_Pragma_Inherited): Code cleanup. (Set_SPARK_Pragma): Code cleanup. This attribute applies to variables. (Set_SPARK_Pragma_Inherited): Code cleanup. This attribute applies to variables. (SPARK_Aux_Pragma): Code cleanup. (SPARK_Aux_Pragma_Inherited): Code cleanup. (SPARK_Pragma): Code cleanup. This attribute applies to variables. (SPARK_Pragma_Inherited): Code cleanup. This attribute applies to variables. (Write_Field9_Name): Remove the output for Part_Of_Constituents. (Write_Field10_Name): Add output for Part_Of_Constituents. (Write_Field30_Name): Add output for Anonymous_Object. (Write_Field34_Name): Output SPARK_Pragma for protected types and variables. * einfo.ads: New attributes Anonymous_Object and Is_Synchronized_State along with usage in entities. Update the documentation of attributes Contract Encapsulating_State Part_Of_Constituents SPARK_Aux_Pragma SPARK_Aux_Pragma_Inherited SPARK_Pragma SPARK_Pragma_Inherited (Anonymous_Object): New routine along with pragma Inline. (Is_Synchronized_State): New routine. (Set_Anonymous_Object): New routine along with pragma Inline. * freeze.adb (Freeze_Record_Type): Ensure that a non-synchronized record does not have synchronized components. * sem_ch3.adb (Analyze_Declarations): Code cleanup. Analyze the contract of protected units. * sem_ch9.adb Add with and use clauses for Sem_Prag. Code cleanup. (Analyze_Single_Protected_Declaration): Reimplemented. (Analyze_Single_Task_Declaration): Reimplemented. * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Part_Of can now apply to a single concurrent type declaration. Rely on Insert_Pragma to place the pragma. Update the error message on usage to reflect the new context. (Insert_Pragma): When inserting pragmas for a protected or task type, create a definition if the type lacks one. * sem_elab.adb (Check_A_Call): Code cleanup. Issue error message related to elaboration issues for SPARK when SPARK_Mode is "on" and the offending entity comes from source. * sem_prag.adb (Analyze_Abstract_State): Add new flag Synchronous_Seen. Update the analysis of simple options Externa, Ghost and Synchronous. Update various error messages to reflect the use of single concurrent types. (Analyze_Depends_Global): Pragmas Depends and Global can now apply to a single task type or a single concurrent object created for a task type. (Analyze_Depends_In_Decl_Part): Do not push a scope when the context is a single concurrent object. (Analyze_Part_Of): Moved out of Analyze_Pragma. The routine has a new profile and comment on usage. (Analyze_Part_Of_In_Decl_Part): New routine. (Analyze_Part_Of_Option): Update the call to Analyze_Part_Of. (Analyze_Pragma): Pragma Abstract_State can now carry simple option Synchronous. Pragma Part_Of can now apply to a single concurrent type declaration. The analysis of pragma Part_Of is delayed when the context is a single concurrent object. (Analyze_Refined_Depends_In_Decl_Part): Use the anonymous object when the context is a single concurren type. (Analyze_Refined_Global_In_Decl_Part): Use the anonymous object when the context is a single concurren type. (Check_Ghost_Constituent): Removed. (Check_Matching_Constituent): Renamed to Match_Constituent. (Check_Matching_State): Renamed to Match_State. (Collect_Constituent): Update the comment on usage. Verify various legality rules related to ghost and synchronized entities. (Find_Related_Declaration_Or_Body): A single task declaration is no longer a valid context for a pragma. (Fix_Msg): Moved to Sem_Util. (Process_Overloadable): Add processing for single task objects. (Process_Visible_Part): Add processing for single concurrent types. (Relocate_Pragmas_To_Anonymous_Object): New routine. * sem_prag.ads Add new table Pragma_On_Anonymous_Object_OK. (Analyze_Part_Of_In_Decl_Part): New routine. (Relocate_Pragmas_To_Anonymous_Object): New routine. * sem_util.adb (Defining_Entity): Code cleanup. (Fix_Msg): Moved from Sem_Prag and augmented to handle mode replacements. (Has_Full_Default_Initialization): New routine. (Is_Descendant_Of_Suspension_Object): Moved out of Is_Effectively_Volatile. (Is_Single_Concurrent_Object): New routine. (Is_Single_Concurrent_Type): New routine. (Is_Single_Concurrent_Type_Declaration): New routine. (Is_Synchronized_Object): New routine. (Yields_Synchronized_Object): New routine. * sem_util.ads (Fix_Msg): Moved form Sem_Prag. Update the comment on usage. (Has_Full_Default_Initialization): New routine. (Is_Single_Concurrent_Object): New routine. (Is_Single_Concurrent_Type): New routine. (Is_Single_Concurrent_Type_Declaration): New routine. (Is_Synchronized_Object): New routine. (Yields_Synchronized_Object): New routine. * snames.ads-tmpl: Add name Synchronous. From-SVN: r229357
2015-10-20[multiple changes]Arnaud Charlet1-0/+12
2015-10-20 Yannick Moy <moy@adacore.com> * a-sytaco.ads (Ada.Synchronous_Task_Control): Package now withs System.Task_Identification. The visible part of the spec has SPARK_Mode. The private part has pragma SPARK_Mode (Off). (Set_True): Added Global and Depends aspects (Set_False): Added Global and Depends aspects (Current_State): Added Volatile_Function aspect and added external state Ada.Task_Identification.Tasking_State as a Global input. (Suspend_Until_True): Added Global and Depends aspects * a-sytaco.adb (Ada.Synchronous_Task_Control): Package body has SPARK_Mode => Off * a-extiin.ads (Ada.Execution_Time.Interrupts): Package now withs Ada.Real_Time and has SPARK_Mode. (Clock): Added Volatile_Function aspect and added external state Ada.Real_Time.Clock_Time as a Global input. * a-reatim.ads (Ada.Real_Time): The visible part of the spec has SPARK_Mode. The private part has pragma SPARK_Mode (Off). The package declares external state Clock_Time with properties Async_Readers and Async_Writers. (Clock): Added Volatile_Function aspect and added external state Clock_Time as a Global input. * a-reatim.adb (Ada.Real_Time): Package body has SPARK_Mode => Off * a-exetim-default.ads, a-exetim-mingw.ads (Ada.Execution_Time): The visible part of the spec has SPARK_Mode. The private part has pragma SPARK_Mode (Off). (Clock): Added Volatile_Function aspect and added external state Clock_Time as a Global input. (Clock_For_Interrupts): Added Volatile_Function aspect and added external state Ada.Real_Time.Clock_Time as a Global input. * a-exetim-mingw.adb (Ada.Execution_Time): Package body has SPARK_Mode => Off * a-interr.ads (Ada.Interrupts): Package now withs Ada.Task_Identification (Is_Reserved): Added SPARK_Mode, Volatile_Function and external state Ada.Task_Identification.Tasking_State as a Global input. (Is_Attached): Added SPARK_Mode, Volatile_Function and external state Ada.Task_Identification.Tasking_State as a Global input. (Attach_Handler): Added SPARK_Mode => Off (Exchange_Handler): Added SPARK_Mode => Off (Detach_Handler): Added SPARK_Mode and external state Ada.Task_Identification.Tasking_State as a Global In_Out. (Reference): Added SPARK_Mode => Off * a-disedf.ads (Get_Deadline): Added SPARK_Mode, Volatile_Function and external state Ada.Task_Identification.Tasking_State as a Global input. * a-taside.ads (Ada.Task_Identification): The visible part of the spec has SPARK_Mode. The private part has pragma SPARK_Mode (Off). The package declares external state Tasking_State with properties Async_Readers and Async_Writers. (Current_Task): Added Volatile_Function aspect and added external state Tasking_State as a Global input. (Environment_Task): Added SPARK_Mode => Off (Is_Terminated): Added Volatile_Function aspect and added external state Tasking_State as a Global input. (Is_Callable): Added Volatile_Function aspect and added external state Tasking_State as a Global input. (Activation_Is_Complete): Added Volatile_Function aspect and added external state Tasking_State as a Global input. * a-taside.adb (Ada.Task_Identification): Package body has SPARK_Mode => Off. 2015-10-20 Ed Schonberg <schonberg@adacore.com> * atree.ads, atree.adb: Enable List38 and List39 on entities. * einfo.ads, einfo.adb (Class_Wide_Preconds) new attribute defined on subprograms. Holds the list of class-wide precondition functions inherited from ancestors. Each such function is an instantiation of the generic function generated from an explicit aspect specification for a class-wide precondition. A type is an ancestor of itself, and therefore a root type has such an instance on its own list. (Class_Wide_Postconds): ditto for postconditions. 2015-10-20 Vincent Celier <celier@adacore.com> * prj-attr.adb: Add packages Prove and GnatTest. 2015-10-20 Steve Baird <baird@adacore.com> * a-conhel.adb: Add an Annotate pragma to help suppress CodePeer's analysis of internals of container generic instances. This pragma has no other effect. * a-conhel.adb (Generic_Implementation) Add "pragma Annotate (CodePeer, Skip_Analysis);". From-SVN: r229070
2015-05-26[multiple changes]Arnaud Charlet1-1/+1
2015-05-26 Ed Schonberg <schonberg@adacore.com> * sem_ch7.adb (Install_Private_Declarations, Swap_Private_Dependents): Ensure that both views of the dependent subtype are immediately visible if we are within their scope. This may be needed when a procedure body is both the parent of an instantiated child unit, and is itself used to inline a local function. 2015-05-26 Gary Dismukes <dismukes@adacore.com> * exp_prag.adb, gnat1drv.adb: Minor reformatting. 2015-05-26 Eric Botcazou <ebotcazou@adacore.com> * exp_ch4.adb (Expand_N_Indexed_Component): In the circuit detecting exceptions to the rewriting, deal with implicit dereferences in the selected component case. 2015-05-26 Bob Duff <duff@adacore.com> * sem_ch13.adb (Analyze_One_Aspect): Do not require the expression of the Disable_Controlled aspect to be static in a generic template, because 'Enabled is not known until the instance. 2015-05-26 Doug Rupp <rupp@adacore.com> * init-vxsim.c: New file for vxsim ZCX * sigtramp-vxworks-vxsim.c: Likewise. * sigtramp-vxworks.c: Factor out target dependent bits into ... * sigtramp-vxworks-target.inc: ... here. * sigtramp.h: Add vxsim zcx protos. * init.c [vxworks...] (sysLib.h): Include. (__gnat_map_signal): Make global. [...i386] (__gnat_error_handler): Call __gnat_vxsim_error_handler if on vxsim. [...i386] (__gnat_install_handler): Test if on vxsim. 2015-05-26 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): For an element iterator over an array, if the component is aliased, the loop variable is aliased as well. 2015-05-26 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Expand_Actuals): For a function call with in-out parameters that is rewritten as an expression_with_actions, we preserve the original function call node for further use by the caller (typically Expand_Call). In the presence of validity checks, that function call, though it is labelled Analyzed to prevent an infinite recursion, may be rewritten as a temporary by Remove_Side_Effects. Ensure that the caller has access to the original function call to continue expansion. * atree.ads: Minor typo in comment. 2015-05-26 Javier Miranda <miranda@adacore.com> * sem_util.adb (Check_Function_Writable_Actuals): Add missing support to check the violation of writable actuals in array aggregates that have a nonstatic range. From-SVN: r223672
2015-05-22debug.adb: Update documentation.Robert Dewar1-1/+1
2015-05-22 Robert Dewar <dewar@adacore.com> * debug.adb: Update documentation. * einfo.ads, einfo.adb (Needs_Typedef): New flag * exp_unst.adb (Unnest_Subprogram): Mark AREC types as needing typedef's in C. * frontend.adb: Update comments. * gnat1drv.adb (Adjust_Global_Switches): Set all needed flags for -gnatd.V * opt.ads (Generate_C_Code): New switch. * osint-c.adb (Write_C_File_Info): Removed, not used (Write_H_File_Info): Removed, not used * osint-c.ads (Write_C_File_Info): Removed, not used (Write_H_File_Info): Removed, not used * osint.ads (Write_Info): Minor comment updates. (Output_FD): Moved from private part to public part of spec. * sem.adb (Semantics): Force expansion on if in Generate_C_Code mode. * atree.ads: minor typo in comment. * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Do not allow VFA on composite object with aliased component. From-SVN: r223546
2015-05-22atree.adb, [...]: Change name Needs_Actuals_Check to Check_Actuals.Robert Dewar1-7/+7
2015-05-22 Robert Dewar <dewar@adacore.com> * atree.adb, atree.ads, treepr.adb: Change name Needs_Actuals_Check to Check_Actuals. * exp_ch4.adb (Expand_N_Op_Expon): Optimize 2**x in modular and overflow cases. From-SVN: r223538
2015-05-22atree.adb, atree.ads (Needs_Actuals_Check): New flag.Robert Dewar1-21/+35
2015-05-22 Robert Dewar <dewar@adacore.com> * atree.adb, atree.ads (Needs_Actuals_Check): New flag. From-SVN: r223536
2015-03-13[multiple changes]Arnaud Charlet1-15/+97
2015-03-13 Robert Dewar <dewar@adacore.com> * exp_unst.adb (Note_Uplevel_Reference): Eliminate duplicate references. (Actual_Ref): New function. (AREC_String): Minor reformatting. (Unnest_Subprogram): Use Actual_Ref. * frontend.adb (Frontend): Turn off Unnest_Subprogram_Mode before call to Instantiate_Bodies. 2015-03-13 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Profile): If the return type of a function being frozen is an untagged limited view and the function is abstract, mark the type as frozen because there is no later point at which the profile of the subprogram will be elaborated. 2015-03-13 Robert Dewar <dewar@adacore.com> * einfo.adb, einfo.ads, atree.adb, atree.ads, atree.h: Add seventh component to entities. Add new fields Field36-41 and Node36-41. 2015-03-13 Claire Dross <dross@adacore.com> * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Rewrite after review. 2015-03-13 Robert Dewar <dewar@adacore.com> * exp_util.adb (Is_Volatile_Reference): Compile time known value is never considered to be a volatile reference. 2015-03-13 Robert Dewar <dewar@adacore.com> * sem_ch3.adb (Analyze_Object_Contract): Suppress "constant cannot be volatile" for internally generated object (such as FIRST and LAST constants). 2015-03-13 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Validate_Access_Subprogram_Instance): If a convention is specified for the formal parameter, verify that the actual has the same convention. * sem_prag.adb (Set_Convention_From_Pragma): Allow convention pragma to be set on a generic formal type. * sem_util.adb (Set_Convention): Ignore within an instance, as it has already been verified in the generic unit. From-SVN: r221422
2015-03-02[multiple changes]Arnaud Charlet1-1/+7
2015-03-02 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb (Uint24): New function (Set_Uint24): New procedure. * atree.h (Uint24): New macro for field access. * back_end.adb (Call_Back_End): For now, don't call back end if unnesting subprogs. * einfo.adb (Activation_Record_Component): New field (Subps_Index): New field. * einfo.ads (Activation_Record_Component): New field (Subps_Index): New field Minor reordering of comments into alpha order. * exp_unst.ads, exp_unst.adb: Continued development. 2015-03-02 Gary Dismukes <dismukes@adacore.com> * exp_disp.ads: Minor reformatting. 2015-03-02 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Chain_Use_Clause): Do not chain use clause from ancestor to list of use clauses active in descendant unit if we are within the private part of an intervening parent, to prevent circularities in use clause list. From-SVN: r221114
2015-01-072015-01-07 Hristian Kirtchev <kirtchev@adacore.com>Hristian Kirtchev1-34/+70
* alloc.ads Alphabetize several declarations. Add constants Ignored_Ghost_Units_Initial and Ignored_Ghost_Units_Increment. * atree.adb Add with and use clauses for Opt. (Allocate_Initialize_Node): Mark a node as ignored Ghost if it is created in an ignored Ghost region. (Ekind_In): New variant. (Is_Ignored_Ghost_Node): New routine. (Set_Is_Ignored_Ghost_Node): New routine. * atree.adb Aplhabetize several subprograms declarations. Flag Spare0 is now known as Is_Ignored_Ghost_Node. (Ekind_In): New variant. (Is_Ignored_Ghost_Node): New routine. (Set_Is_Ignored_Ghost_Node): New routine. * einfo.adb: Flag 279 is now known as Contains_Ignored_Ghost_Code. (Contains_Ignored_Ghost_Code): New routine. (Set_Contains_Ignored_Ghost_Code): New routine. (Set_Is_Checked_Ghost_Entity, Set_Is_Ignored_Ghost_Entity): It is now possible to set this property on an unanalyzed entity. (Write_Entity_Flags): Output the status of flag Contains_Ignored_Ghost_Code. * einfo.ads New attribute Contains_Ignored_Ghost_Code along with usage in nodes. (Contains_Ignored_Ghost_Code): New routine along with pragma Inline. (Set_Contains_Ignored_Ghost_Code): New routine along with pragma Inline. * exp_ch3.adb Add with and use clauses for Ghost. (Freeze_Type): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * exp_ch7.adb (Process_Declarations): Do not process a context that invoves an ignored Ghost entity. * exp_dbug.adb (Qualify_All_Entity_Names): Skip an ignored Ghost construct that has been rewritten as a null statement. * exp_disp.adb Add with and use clauses for Ghost. (Make_DT): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * exp_util.adb (Requires_Cleanup_Actions): An ignored Ghost entity does not require any clean up. Add two missing cases that deal with block statements. * freeze.adb Add with and use clauses for Ghost. (Freeze_Entity): Capture/restore the value of Ghost_Mode on entry/exit. Set the Ghost_Mode in effect. (Restore_Globals): New routine. * frontend.adb Add with and use clauses for Ghost. Remove any ignored Ghost code from all units that qualify. * ghost.adb New unit. * ghost.ads New unit. * gnat1drv.adb Add with clause for Ghost. Initialize and lock the table in package Ghost. * lib.ads: Alphabetize several subprogram declarations. * lib-xref.adb (Output_References): Do not generate reference information for ignored Ghost entities. * opt.ads Add new type Ghost_Mode_Type and new global variable Ghost_Mode. * rtsfind.adb (Load_RTU): Provide a clean environment when loading a runtime unit. * sem.adb (Analyze): Capture/restore the value of Ghost_Mode on entry/exit as the node may set a different mode. (Do_Analyze): Capture/restore the value of Ghost_Mode on entry/exit as the unit may be withed from a unit with a different Ghost mode. * sem_ch3.adb Add with and use clauses for Ghost. (Analyze_Full_Type_Declaration, Analyze_Incomplete_Type_Decl, Analyze_Number_Declaration, Analyze_Private_Extension_Declaration, Analyze_Subtype_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. (Array_Type_Declaration): The implicit base type inherits the "ghostness" from the array type. (Derive_Subprogram): The alias inherits the "ghostness" from the parent subprogram. (Make_Implicit_Base): The implicit base type inherits the "ghostness" from the parent type. * sem_ch5.adb Add with and use clauses for Ghost. (Analyze_Assignment): Set the Ghost_Mode in effect. * sem_ch6.adb Add with and use clauses for Ghost. (Analyze_Abstract_Subprogram_Declaration, Analyze_Procedure_Call, Analyze_Subprogram_Body_Helper, Analyze_Subprogram_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch7.adb Add with and use clauses for Ghost. (Analyze_Package_Body_Helper, Analyze_Package_Declaration, Analyze_Private_Type_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch8.adb Add with and use clauses for Ghost. (Analyze_Exception_Renaming, Analyze_Generic_Renaming, Analyze_Object_Renaming, Analyze_Package_Renaming, Analyze_Subprogram_Renaming): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. (Find_Type): Check the Ghost context of a type. * sem_ch11.adb Add with and use clauses for Ghost. (Analyze_Exception_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_ch12.adb Add with and use clauses for Ghost. (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration): Set the Ghost_Mode in effect. Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_prag.adb Add with and use clauses for Ghost. (Analyze_Pragma): Ghost-related checks are triggered when there is a Ghost mode in effect. (Create_Abstract_State): Mark the entity as Ghost when there is a Ghost_Mode in effect. * sem_res.adb Add with and use clauses for Ghost. (Check_Ghost_Context): Removed. * sem_util.adb (Check_Ghost_Completion): Removed. (Check_Ghost_Derivation): Removed. (Incomplete_Or_Partial_View): Add a guard in case the entity has not been analyzed yet and does carry a scope. (Is_Declaration): New routine. (Is_Ghost_Entity): Removed. (Is_Ghost_Statement_Or_Pragma): Removed. (Is_Subject_To_Ghost): Removed. (Set_Is_Ghost_Entity): Removed. (Within_Ghost_Scope): Removed. * sem_util.adb (Check_Ghost_Completion): Removed. (Check_Ghost_Derivation): Removed. (Is_Declaration): New routine. (Is_Ghost_Entity): Removed. (Is_Ghost_Statement_Or_Pragma): Removed. (Is_Subject_To_Ghost): Removed. (Set_Is_Ghost_Entity): Removed. (Within_Ghost_Scope): Removed. * sinfo.ads Add a section on Ghost mode. * treepr.adb (Print_Header_Flag): New routine. (Print_Node_Header): Factor out code. Output flag Is_Ignored_Ghost_Node. * gcc-interface/Make-lang.in: Add dependency for unit Ghost. From-SVN: r219280
2014-10-23[multiple changes]Arnaud Charlet1-0/+4
2014-10-23 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Expression_Function): Simplify analysis in generic context, and generate body in this case as well, to simplify ASIS traversals on the construct. 2014-10-23 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Complete_Object_Operation): Indicate that the scope of the operation (s) is referenced, to prevent spurious warnings about unused units. 2014-10-23 Johannes Kanig <kanig@adacore.com> * errout.adb (Error_Msg_Internal): Copy check flag, increment check msg count. * erroutc.adb (Delete_Msg) adjust check msg count. (Output_Msg_Text) handle check msg case (do nothing). (Prescan_Message) recognize check messages with severity prefixes. * errutil.adb (Error_Msg) handle check flag, adjust counter. 2014-10-23 Ed Schonberg <schonberg@adacore.com> * sem_eval.adb (Subtypes_Statically_Match): For a generic actual type, check for the presence of discriminants in its parent type, against the presence of discriminants in the context type. 2014-10-23 Tristan Gingold <gingold@adacore.com> * adaint.c: __gnat_get_file_names_case_sensitive: Default is true on arm-darwin. 2014-10-23 Arnaud Charlet <charlet@adacore.com> * pprint.adb (Expression_Image): Add handling of quantifiers. 2014-10-23 Ed Schonberg <schonberg@adacore.com> * exp_pakd.adb (Expand_Packed_Element_Reference): If the prefix is a source entity, generate a reference to it before transformation, because rewritten node might not generate a proper reference, leading to spurious warnings. 2014-10-23 Tristan Gingold <gingold@adacore.com> * init.c: Fix thinko in previous patch. 2014-10-23 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb (Decimal_Fixed_Point_Type_Declaration): Inherit the rep chain of the implicit base type. (Floating_Point_Type_Declaration): Inherit the rep chain of the implicit base type. (Ordinary_Fixed_Point_Type_Declaration): Inherit the rep chain of the implicit base type. (Signed_Integer_Type_Declaration): Inherit the rep chain of the implicit base type. * sem_util.ads, sem_util.adb (Inherit_Rep_Item_Chain): New routine. 2014-10-23 Pascal Obry <obry@adacore.com> * g-regist.adb, g-regist.ads: Add support for reading 32bit or 64bit view of the registry. 2014-10-23 Ed Schonberg <schonberg@adacore.com> * exp_ch3.adb (Expand_N_Object_Declaration): If type is abstract, return without expanding expression, to prevent subsequent crash. * freeze.adb: better error message for illegal declaration. From-SVN: r216587
2014-08-01[multiple changes]Arnaud Charlet1-1/+6
2014-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Loop_Parameter_Specification): a) An attribute_reference to Loop_Entry denotes an iterator specification: its prefix is an object, as is the case for 'Old. b) If the domain of iteration is an expression whose type has the Iterable aspect defined, this is an iterator specification. 2014-08-01 Robert Dewar <dewar@adacore.com> * gnatcmd.adb: Minor reformatting. 2014-08-01 Robert Dewar <dewar@adacore.com> * atree.ads (Info_Messages): New counter. * err_vars.ads: Minor comment update. * errout.adb (Delete_Warning_And_Continuations): Deal with new Info_Messages counter. (Error_Msg_Internal): ditto. (Delete_Warning): ditto. (Initialize): ditto. (Write_Error_Summary): ditto. (Output_Messages): ditto. (To_Be_Removed): ditto. * erroutc.adb (Delete_Msg): Deal with Info_Messages counter. (Compilation_Errors): ditto. * errutil.adb (Error_Msg): Deal with Info_Messages counter. (Finalize): ditto. (Initialize): ditto. * sem_prag.adb (Analyze_Pragma): Minor comment addition. * gnat_ugn.texi: Document that -gnatwe does not affect info messages. From-SVN: r213457
2014-07-18[multiple changes]Arnaud Charlet1-2/+2
2014-07-18 Robert Dewar <dewar@adacore.com> * sem_ch13.adb (Build_Discrete_Static_Predicate): New name for Build_Static_Predicate (Build_Predicate_Functions): Don't try to build discrete predicate for real type. (Build_Predicate_Functions): Report attempt to use Static_Predicate function on real type as unimplemented. * sem_util.adb (Check_Expression_Against_Static_Predicate): Add guard to prevent blow up on predicate for real type. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * einfo.adb (Set_Static_Predicate): Simplify assertion to handle properly static predicate on enumeration types and modular types (not subtypes). 2014-07-18 Pierre-Marie Derodat <derodat@adacore.com> * scos.ads (SCO_Unit_Table_Entry): Add a field to keep track of the corresponding source file index. * get_scos.ads (Get_SCOs): Add a default value for it. * par_sco.adb (SCO_Record): Fill the corresponding value. * scos.h: New. 2014-07-18 Vincent Celier <celier@adacore.com> * a-strunb-shared.adb, s-auxdec.ads, s-rannum.adb, atree.ads, urealp.adb, vms_data.ads, lib.ads, s-auxdec-vms_64.ads: Minor reformatting. * gnat_ugn.texi: Add documentation for new gnatmem switch -t. 2014-07-18 Thomas Quinot <quinot@adacore.com> * g-sercom.ads (Set): document possible data loss. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, cases Input, Output, Read, Write): If the restriction No_Streams is active, replace each occurrence of a stream attribute by an explicit Raise statement. From-SVN: r212782
2014-02-25[multiple changes]Arnaud Charlet1-0/+4
2014-02-25 Robert Dewar <dewar@adacore.com> * sem_ch3.adb (Array_Type_Declaration): Check for case of using type name as index. * lib.ads: Minor reformatting. * einfo.ads: Minor reformatting. 2014-02-25 Doug Rupp <rupp@adacore.com> * sem_mech.adb (Set_Mechanisms): For convention Fortran on VMS use Short_Descriptor(S) as the argument passing mechanism. 2014-02-25 Eric Botcazou <ebotcazou@adacore.com> * sigtramp-ppcvxw.c (CFI_COMMON_REGS): Also include r0. 2014-02-25 Robert Dewar <dewar@adacore.com> * atree.ads (Warnings_Treated_As_Errors): New variable. * errout.adb (Error_Msg_Internal): Set Warn_Err flag in error object (Initialize): Initialize Warnings_As_Errors_Count (Write_Error_Summary): Include count of warnings treated as errors. * erroutc.adb (Warning_Treated_As_Error): New function. (Matches): Function moved to outer level of package. * erroutc.ads (Error_Msg_Object): Add Warn_Err flag. (Warning_Treated_As_Error): New function. * gnat_rm.texi: Document pragma Treat_Warning_As_Error. * opt.adb: Add handling of Warnings_As_Errors_Count[_Config]. * opt.ads (Config_Switches_Type): Add entry for Warnings_As_Errors_Count. (Warnings_As_Errors_Count): New variable. (Warnings_As_Errors): New array. * par-prag.adb: Add dummy entry for Warning_As_Error. * sem_prag.adb (Analyze_Pragma): Implement new pragma Warning_As_Error. * snames.ads-tmpl: Add entries for Warning_As_Error pragma. From-SVN: r208145
2014-02-24g-sercom-mingw.adb, [...]: Minor reformatting.Robert Dewar1-7/+10
2014-02-24 Robert Dewar <dewar@adacore.com> * g-sercom-mingw.adb, g-sercom-linux.adb, sem_prag.adb, freeze.adb, atree.adb, atree.ads: Minor reformatting. From-SVN: r208088
2014-02-24[multiple changes]Arnaud Charlet1-31/+6
2014-02-24 Robert Dewar <dewar@adacore.com> * a-tags.adb, s-os_lib.adb: Minor reformatting. 2014-02-24 Thomas Quinot <quinot@adacore.com> * g-sercom-mingw.adb, g-sercom-linux.adb (Raise_Error): Include strerror message, not just numeric errno value. 2014-02-24 Doug Rupp <rupp@adacore.com> * raise-gcc.c (exception_class_eq): Make endian neutral. 2014-02-24 Ed Schonberg <schonberg@adacore.com> * atree.ads, atree,adb (Copy_Separate_Tree): Remove Syntax_Only flag, and reset Etype and Analyzed attributes unconditionally when copying a tree that may be partly analyzed. * freeze.adb: Change calls to Copy_Separate_Tree accordingly. * sem_ch6.adb (Check_Inline_Pragma): If the Inline pragma appears within a subprogram body and applies to it, remove it from the body before making a copy of it, to prevent spurious errors when analyzing the copied body. From-SVN: r208086
2014-02-24[multiple changes]Arnaud Charlet1-1/+30
2014-02-24 Thomas Quinot <quinot@adacore.com> * s-os_lib.adb (Errno_Message): Do not depend on Integer'Image. * s-oscons-tmplt.c: On VxWorks, include adaint.h only after vxWorks.h has been included. Also ensure that file attributes related definitions are output even in cases where socket support is not enabled. * a-tags.adb: Code clean up. * Make-generated.in (OSCONS_CPP, OSCONS_EXTRACT): Use -iquote instead of -I to add the main ada source directory to the header search path, in order to avoid conflict between our own "types.h" and VxWork's <types.h>. 2014-02-24 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb (Copy_Separate_Tree): Add Syntax_Only parameter. * debug.adb: Remove documentation of -gnatd.X, no longer used. * freeze.adb (Wrap_Imported_Subprogram): Fixed and activated. 2014-02-24 Bob Duff <duff@adacore.com> * gnat_ugn.texi: Improve documentation of gnatpp. From-SVN: r208083
2014-02-24[multiple changes]Arnaud Charlet1-0/+6
2014-02-24 Robert Dewar <dewar@adacore.com> * sinfo.ads, sem_ch12.adb, sem_res.adb, sem_ch4.adb, par-ch12.adb: Minor reformatting. * atree.ads, atree.adb (Node35): New function. (Set_Node35): New procedure. * debug.adb: Define new debug flag -gnatd.X. * einfo.ads, einfo.adb (Import_Pragma): New field. * freeze.adb (Wrap_Imported_Procedure): New procedure (not really active yet, has to be activated with -gnatd.X. * sem_prag.adb (Set_Imported): Set new Import_Pragma field (Set_Imported): Don't set Is_Public (see Freeze.Wrap_Imported_Subprogram) * par-ch3.adb (P_Component_List): Handle unexpected null component. 2014-02-24 Yannick Moy <moy@adacore.com> * sem_ch3.adb: Correct reference to SPARK RM in error messages. * gnat_rm.texi: Correct documentation of attribute Update. 2014-02-24 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Reject container iterator in older versions of Ada. From-SVN: r208076
2014-02-19[multiple changes]Arnaud Charlet1-10/+9
2014-02-19 Yannick Moy <moy@adacore.com> * sinfo.ads: Minor comment update. 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com> * atree.ads: Minor reformatting (change Entity_Info to Einfo). 2014-02-19 Thomas Quinot <quinot@adacore.com> * exp_ch7.adb (Find_Node_To_Be_Wrapped): An assignment statement that has the No_Ctrl_Actions flag is a suitable node to be wrapped if the assigned expression has no finalization actions. * sem_eval.adb (Eval_Entity_Name): For a compile time known boolean value, mark the corresponding condition SCO as constant. 2014-02-19 Robert Dewar <dewar@adacore.com> * exp_util.adb: Minor reformatting. * exp_util.ads (Matching_Standard_Type): New function. * exp_ch7.adb: Minor reformatting. 2014-02-19 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Get_Cursor_Type): Use scope of iterable type to find declaration for Cursor, to handle properly the case of a discriminated iterable type. 2014-02-19 Vincent Celier <celier@adacore.com> * gnatcmd.adb (GNATCmd): Always replace the object dirs of imported library projects with the library ALI dirs, when setting the object paths. * prj-env.ads (Ada_Objects_Path): Correct comments about argument Including_Libraries. From-SVN: r207888
2014-01-29a-except-2005.adb, [...]: Minor reformatting.Robert Dewar1-1/+1
2014-01-29 Robert Dewar <dewar@adacore.com> * a-except-2005.adb, a-except.adb, a-excpol-abort.adb, a-exstat.adb, ali.adb, a-numaux.ads, a-numaux-darwin.ads, a-numaux-libc-x86.ads, a-numaux-vms.ads, a-numaux-vxworks.ads, a-numaux-x86.ads, aspects.ads, a-taside.adb, a-teioed.adb, a-textio.adb, a-textio.ads, atree.adb, atree.ads, a-witeio.adb, a-witeio.ads, a-wtedit.adb, a-ztedit.adb, a-ztexio.adb, bcheck.adb, binde.adb, checks.adb, comperr.adb, cstand.adb, debug_a.adb, einfo.ads, errout.adb, erroutc.adb, eval_fat.adb, exp_aggr.adb, exp_attr.adb, exp_ch11.adb, exp_ch3.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch9.adb, exp_dbug.adb, exp_disp.adb, exp_fixd.adb, exp_imgv.adb, exp_intr.adb, exp_util.adb, freeze.adb, frontend.adb, g-comlin.ads, g-mbdira.adb, gnat1drv.adb, gprep.adb, g-spipat.adb, i-cpp.ads, i-vxwork.ads, i-vxwork-x86.ads, krunch.ads, layout.adb, lib-load.adb, lib-writ.adb, lib-writ.ads, live.adb, namet.ads, osint.adb, osint-c.adb, output.ads, par.adb, par-ch10.adb, par-ch13.adb, par-ch3.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-prag.adb, par-sync.adb, par-tchk.adb, par-util.adb, prj.adb, repinfo.adb, rtsfind.adb, s-arit64.adb, s-asthan-vms-alpha.adb, s-asthan-vms-ia64.adb, s-bignum.adb, scans.adb, scng.adb, s-dimmks.ads, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch8.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb, sem_eval.adb, sem_intr.adb, sem_prag.adb, sem_res.adb, sem_type.adb, sem_util.adb, sem_warn.adb, set_targ.adb, s-fatgen.adb, s-fatgen.ads, s-fileio.adb, s-imgcha.adb, s-imgrea.adb, sinfo.ads, sinput-c.adb, snames.ads-tmpl, s-os_lib.adb, sprint.adb, s-regpat.adb, s-secsta.adb, s-stalib.ads, s-stchop.adb, s-stoele.ads, stand.ads, s-taprop-solaris.adb, s-tasdeb-vms.adb, s-tasini.adb, s-tassta.adb, s-valdec.adb, s-valuti.adb, s-wchjis.adb, s-wchwts.adb, system.ads, system-vms_64.ads, system-vms-ia64.ads, treepr.adb, types.ads, uintp.adb, uname.adb, urealp.adb, usage.adb, vxaddr2line.adb: Minor reformatting. From-SVN: r207260
2014-01-292014-01-29 Hristian Kirtchev <kirtchev@adacore.com>Hristian Kirtchev1-0/+6
* aspects.adb Add an entry for aspect Part_Of in table Canonical_Aspect. * aspects.ads Add an entry for aspect Part_Of in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay. * atree.h Define Elist9. * atree.adb (Elist9): New routine. (Set_Elist9): New routine. * atree.ads (Elist9): New routine. (Set_Elist9): New routine. * einfo.adb Add Part_Of_Constituents and Encapsulating_State to the list of node usage. Remove Refined_State from the list of node usage. (Encapsulating_State): New routine. (Get_Pragma): Handle pragma Part_Of; (Part_Of_Constituents): New routine. (Refined_State): Removed. (Set_Encapsulating_State): New routine. (Set_Part_Of_Constituents): New routine. (Set_Refined_State): Removed. (Write_Field9_Name): Add an entry for Part_Of_Constituents (Write_Field10_Name): Add an entry for Encapsulating_State. Remove the entry for Refined_State. * einfo.ads Add new attributes Encapsulating_State and Part_Of_Constituents alond with their usage in entities. Remove attribute Refined_State along with its usage in entities. (Encapsulating_State): New routine and pragma Inline. (Get_Pragma): Update the comment on usage. (Part_Of_Constituents): New routine and pragma Inline. (Refined_State): Removed along with pragma Inline. (Set_Encapsulating_State): New routine and pragma Inline. (Set_Part_Of_Constituents): New routine and pragma Inline. (Set_Refined_State): Removed along with pragma Inline. * par-prag.adb Pragma Part_Of does not need any special processing by the parser. * sem_ch3.adb (Analyze_Declarations): Remove local variables Body_Id and Prag. Call separate routines to analyze the contract of a package [body]. (Analyze_Object_Contract): Update the comment on usage. Remove local variables Items and Nam. Use Get_Pragma rather than traversing the classification list. Verify whether the lack of indicator Part_Of agrees with the placement of the variable in state space. (Analyze_Object_Declaration): Initialize the encapsulating state of a variable. (Requires_State_Refinement): Moved to sem_util. * sem_ch7.adb (Analyze_Package_Body_Contract): New routine. (Analyze_Package_Contract): New routine. * sem_ch7.ads (Analyze_Package_Body_Contract): New routine. (Analyze_Package_Contract): New routine. * sem_ch10.adb (Decorate_State): Initialize the encapsulating state and Part_Of constituents. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Part_Of. Update all calls to Decorate_Delayed_Aspect_And_Pragma. (Check_Aspect_At_Freeze_Point): Aspect Part_Of does not need any special processing at freeze time. (Decorate_Delayed_Aspect_And_Pragma): Renamed to Decorate_Aspect_And_Pragma. Add formal parameter Delayed and update the associated comment. * sem_prag.adb Add an entry for pragma Part_Of in table Sig_Flags. (Analyze_Abstract_State): Add new global variable State_Id. Remove local constants Errors and Loc. Remove local variables Is_Null and State_Nam. Create the entity of the abstract state on the spot, before all remaining checks are performed. Verify that a missing Part_Of option agrees with the placement of the abstract state within the state space. (Analyze_Depends_In_Decl_Part): Add new global variables Constits_Seen and States_Seen. Check that a state and a corresponding constituent do not appear in pragma [Refined_]Depends. (Analyze_Global_In_Decl_Part): Add new global variables Constits_Seen and States_Seen. Check that a state and a corresponding constituent do not appear in pragma [Refined_]Global. (Analyze_Global_Item): Remove the now obsolete code that deals with Part_Of. Add the entity of the global item to the list of processed items. (Analyze_Initializes_In_Decl_Part): Add new global variables Constits_Seen and States_Seen. Check that a state and a corresponding constituent do not appear in pragma Initializes. (Analyze_Initialization_Item): Add the entity of the initialization item to the list of processed items. (Analyze_Input_Item): Add the entity of the initialization item to the list of processed items. (Analyze_Input_Output): Remove the now obsolete code that deals with Part_Of. Add the entity of the input/output to the list of processed items. (Analyze_Part_Of): New routine. (Analyze_Part_Of_Option): Remove local constant Par_State. Add local constant Encaps and local variables Encaps_Id and Legal. Use Analyze_Part of to analyze the option. Turn the related state into a Part_Of constituent if the option is legal. (Analyze_Pragma): Add processing for pragma Part_Of. (Analyze_Refined_State_In_Decl_Part): Remove global constants Pack_Body and Spec_Id. Remove global variables Abstr_States and Hidden_States. Add new global variables Available_States, Body_Id, Body_States and Spec_Id. Add new local constant Body_Decl. Reimplement the logic that extracts the states available for refinement from the related package and the body hidden states of the said package. (Analyze_Refinement_Clause): Add local variable Part_Of_Constits. (Check_Applicable_Policy): Alphabetize body. (Check_Dependency_Clause): Replace Refined_State with Encapsulating_State. (Check_Matching_Constituent): Reimplement the logic that determines whether an item is a valid / invalid constituent of the current refined state. Return when a construct does not denote a valid abstract state. Extract the list of Part_Of constituents for further analysis. Check that all Part_Of constituents of a state have been used in its refinement. (Check_Matching_State): Update the comment on usage. Operate on the list of available states. (Check_Missing_Part_Of): New routine. (Check_Refined_Global_Item): Replace Refined_State with Encapsulating_State. (Check_State_And_Constituent_Use): New routine. (Create_Abstract_State): New routine. (Is_Matching_Input): Replace Refined_State with Encapsulating_State. (Is_Part_Of): Removed. (Collect_Body_States): New routine. (Collect_Constituent): Replace Refined_State with Encapsulating_State. (Collect_Hidden_States): Removed. (Report_Unrefined_States): Change the profile of the procedure along with the comment on usage. (Report_Unused_Constituents): New routine. (Report_Unused_Hidden_States): Removed. (Report_Unused_States): New routine. * sem_prag.ads (Check_Missing_Part_Of): New routine. * sem_util.adb (Add_Contract_Item): Pragma Part_Of can now appear in the classification pragmas of a package instantiation or a variable. (Find_Placement_In_State_Space): New routine. (Is_Child): Removed. (Is_Child_Or_Sibling): Remove formal parameter Private_Child. Remove the private child checks. (Requires_State_Refinement): Moved from sem_ch3. * sem_util.ads Add new type State_Space_Kind along with comment on its usage and values. (Add_Contract_Item): Update the comment on usage. (Find_Body_Discriminal): Alphabetize spec. (Find_Placement_In_State_Space): New routine. (Is_Child_Or_Sibling): Remove formal parameter Private_Child and update the comment on usage. (Requires_State_Refinement): Moved from sem_ch3. * sinfo.ads: Update the documentation of N_Contract. * snames.ads-tmpl The predefined name for Part_Of is now used to denote a pragma. Add Pragma_Id for Part_Of. From-SVN: r207251
2014-01-21[multiple changes]Arnaud Charlet1-0/+28
2014-01-21 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb Add entries for Async_Readers, Async_Writers, Effective_Reads and Effective_Writes in table Canonical_Aspect. * aspects.ads Add entries for Async_Readers, Async_Writers, Effective_Reads and Effective_Writes in tables Aspect_Id, Aspect_Names, Aspect_Delay and Implementation_Defined_Aspect. * atree.adb (Ekind_In): New version with 8 parameters. (Node34): New routine. (Set_Node34): New routine. * atree.ads (Ekind_In): New version with 8 parameters. (Node34): New routine. (Set_Node34): New routine. * einfo.adb Contract is now Node34. (Contract): Update the assertion and node usage. (Get_Pragma): Include pragmas Async_Readers, Async_Writers, Effective_Reads and Effective_Writes. (Set_Contract): Update the assertion and node usage. (Write_Field24_Name): Remove the output for a contract. (Write_Field34_Name): Add output for a contract. * einfo.ads Contract is now Node34. Update the comment on attribute usage and related node structures. (Get_Pragma): Update the comment on usage. * par-prag.adb (Prag): Pragmas Async_Readers, Async_Writers, Effective_Reads and Effective_Writes do not require special processing by the parser. * sem_ch3.adb (Analyze_Variable_Contract): New routine. (Analyze_Declarations): Analyze the contract of a variable at the end of the declarative region. (Analyze_Object_Declaration): Create a contract for a variable. * sem_ch6.adb (Analyze_Subprogram_Contract): Update the retrieval of classification pragmas. (Process_Formals): Detect an illegal use of a volatile object as a formal in a function. * sem_ch12.adb (Instantiate_Object): Detect an illegal use of a volatile object as an actual in generic instantiation. * sem_prag.adb Add entries for Async_Readers, Async_Writers, Effective_Reads and Effective_Writes in table Sig_Flags. (Analyze_External_State_In_Decl_Part): New routine. (Analyze_Global_Item): Detect an illegal use of a volatile object as a global item of a function. (Analyze_Pragma): Reimplement pragma Abstract_State. Add support for pragmas Async_Readers, Async_Writers, Effective_Reads and Effective_Writes. (Check_External_Properties): New routine. * sem_prag.ads (Analyze_External_State_In_Decl_Part): New routine. (Check_External_Properties): New routine. * sem_res.adb (Resolve_Actuals): Detect an illegal use of a volatile object as an actual in a call. (Resolve_Entity_Name): Add local variables Par, Prev and Usage_OK. Detect illegal contexts of volatile objects. * sem_util.adb (Add_Contract_Item): Add support for pragmas associated with the contract of a variable. (Async_Readers_Enabled): New routine. (Async_Writers_Enabled): New routine. (Effective_Reads_Enabled): New routine. (Effective_Writes_Enabled): New routine. (Has_Enabled_Property): New routine. (Is_Unchecked_Conversion_Instance): New routine. (Is_Volatile_Object): Add support for entities that may denote a volatile object. * sem_util.ads (Add_Contract_Item): Update the comment on usage. (Async_Readers_Enabled): New routine. (Async_Writers_Enabled): New routine. (Effective_Reads_Enabled): New routine. (Effective_Writes_Enabled): New routine. (Is_Unchecked_Conversion_Instance): New routine. * sinfo.ads Update the comment on the structure of N_Contract. * snames.ads-tmpl Add predefined names for Async_Readers, Async_Writers, Effective_Reads and Effective_Writes. Add pragma ids for Async_Readers, Async_Writers, Effective_Reads and Effective_Writes. 2014-01-21 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Eval_Op_Expon): Use CRT_Safe_Compile_Time_Known_Value * sem_eval.adb (Compile_Time_Known_Value): Remove special handling of CRT mode (CRT_Safe_Compile_Time_Known_Value): New function (Eval_Op_Expon): Add CRT_Safe in call to Test_Foldable (Test_Foldable): Add CRT_Safe parameter * sem_eval.ads (Compile_Time_Known_Value): Remove special handling of CRT mode. (CRT_Safe_Compile_Time_Known_Value): New function. From-SVN: r206886
2014-01-21[multiple changes]Arnaud Charlet1-0/+6
2014-01-21 Robert Dewar <dewar@adacore.com> * exp_aggr.adb: Minor reformatting. 2014-01-21 Johannes Kanig <kanig@adacore.com> * gnat1drv.adb (Gnat1drv) remove obsolete reference to -gnatd.H. 2014-01-21 Bob Duff <duff@adacore.com> * gnat_ugn.texi: Document the "checks" attribute in gnat2xml. 2014-01-21 Steve Baird <baird@adacore.com> * gnat_rm.texi: Improve description of SPARK_Mode pragma. 2014-01-21 Vincent Celier <celier@adacore.com> * prj-part.adb (Parse_Single_Project): Accept to extend a project if it has only be imported by an project being extended. When a project that has only been imported by a project being extended is imported by another project that is not being extended, reset the previous indication, so that it will be an error if this project is extended later. * prj-tree.adb (Create_Project): Include component From_Extended in table Projects_HT * prj-tree.ads (Project_Name_And_Node): New Boolean component From_Extended 2014-01-21 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb: Add Node33 and Set_Node33. * einfo.ads, einfo.adb (SPARK_Pragma): New field (SPARK_Aux_Pragma): New field (SPARK_Pragma_Inherited): New flag (SPARK_Aux_Pragma_Inherited): New flag (SPARK_Mode_Pragmas): Removed. * lib.ads, lib.adb: Remove SPARK_Mode_Pragma, no longer used. * opt.ads (SPARK_Mode_Pragma): New global variable. * sem.ads: Add Save_SPARK_Mode_Pragma field to Scope_Stack_Entry. * sem_ch3.adb: Use new SPARK_Mode data structures. * sem_ch6.adb: Set SPARK_Mode fields in subprogram specs and bodies. * sem_ch7.adb: Set SPARK_Mode fields in package spec and body entities. * sem_ch8.adb (Push_Scope): Save SPARK_Mode_Pragma. (Pop_Scope): Restore SPARK_Mode_Pragma. * sem_prag.adb (Analyze_Pragma, case SPARK_Mode): Rewrite for new data structures. 2014-01-21 Arnaud Charlet <charlet@adacore.com> * back_end.adb: Undo previous change, not needed. Minor reformatting. From-SVN: r206879
2014-01-21switch-c.adb, [...]: Minor reformatting.Robert Dewar1-1/+2
2014-01-21 Robert Dewar <dewar@adacore.com> * switch-c.adb, usage.adb, atree.adb, atree.ads: Minor reformatting. From-SVN: r206872
2014-01-21[multiple changes]Arnaud Charlet1-1/+1
2014-01-21 Thomas Quinot <quinot@adacore.com> * atree.adb, atree.ads (Num_Extension_Nodes): Switch to Node_Id, since this is value is used in Node_Id arithmetic operations. (Copy_Node, Exchange_Entities): Use loops indexed by Num_Extension_Nodes instead of hard-coded unrolled code. 2014-01-21 Yannick Moy <moy@adacore.com> * gnat1drv.adb: Minor code cleanup, removing useless code. 2014-01-21 Arnaud Charlet <charlet@adacore.com> * opt.ads (SPARK_Switches_File_Name): New. * switch-c.adb (Scan_Front_End_Switches): Add handling of -gnates=xxx * * usage.adb (Usage): Document -gnates, in gnatprove mode only. * gnat_ugn.texi: Document -gnates. 2014-01-21 Yannick Moy <moy@adacore.com> * errout.adb (Special_Msg_Delete): Update comment. Remove special case for GNATprove which should not ignore mismatch in sizes for representation clauses. * sem_prag.adb (Analyze_Pragma): Remove special case for GNATprove which should not ignore pragma Pack. 2014-01-21 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb: Code clean up. 2014-01-21 Steve Baird <baird@adacore.com> * gnat_rm.texi: Improve GNAT RM description of SPARK_Mode pragma. From-SVN: r206871
2014-01-21[multiple changes]Arnaud Charlet1-15/+78
2014-01-21 Robert Dewar <dewar@adacore.com> * gcc-interface/gigi.h: Get Flags array address. * gcc-interface/trans.c: Acquire Flags array address. * atree.adb: Add support for Flags array and Flag0,1,2,3. * atree.ads: Add support for Flags array and Flag0,1,2,3. * atree.h: Add support for Flags array and Flag0,1,2,3. * back_end.adb: Pass Flags array address to gigi. 2014-01-21 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Attribute_Renaming): Transfer original attribute reference to generated body so that legality checks on stream attributes are properly applied. If type is tagged and already frozen, insert generated body at the point of the renaming declaration. 2014-01-21 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb: Code clean up. * sem_ch8.adb: Minor reformatting From-SVN: r206870
2013-10-15[multiple changes]Arnaud Charlet1-14/+15
2013-10-15 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Constituent): When a state acts as a constituent of another state, ensure that the said state has a Part_Of dependency in its corresponding aspect/pragma Abstract_State. 2013-10-15 Robert Dewar <dewar@adacore.com> * par-ch4.adb (P_If_expression): Handle redundant ELSE cleanly. 2013-10-15 Thomas Quinot <quinot@adacore.com> * atree.ads (New_Copy, Relocate_Node): Improve documentation (note that these subprograms reset Is_Overloaded). 2013-10-15 Thomas Quinot <quinot@adacore.com> * checks.adb (Check_Needed): Handle the case where the test in the left operand of the short circuit is wrapped in a qualified expression, type conversion, or expression with actions. 2013-10-15 Thomas Quinot <quinot@adacore.com> * sem_type.adb, sem_type.ads (Save_Interps): Also propagate Is_Overloaded to New_N, for consistency. 2013-10-15 Ed Schonberg <schonberg@adacore.com> * a-tienau.adb (Put): Use file parameter to query values of current column and line length. From-SVN: r203595
2013-10-14aspects.adb: Add an entry in table Canonical_Aspect for Initializes.Hristian Kirtchev1-0/+20
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry in table Canonical_Aspect for Initializes. * aspects.ads: Add entries in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay for Initializes. * atree.ads, atree.adb (Ekind_In): New seven argument versions of the routines. * einfo.adb: Remove Refined_State_Pragma from the list of node usage. Finalizer is now at position 28. (Contract): Package and package bodies now have a contract. (Finalizer): Update the assertion and node usage. (Get_Pragma): Update the Is_CDG flag to include Abstract_State, Initializes and Refined_State. (Refined_State_Pragma): Removed. (Set_Contract): Package and package bodies now have a contract. (Set_Finalizer): Update the assertion and node usage. (Set_Refined_State_Pragma): Removed. (Write_Field8_Name): Remove the output for Refined_State_Pragma. (Write_Field24_Name): Remove the output for Finalizer. Package and package bodies now have a contract. (Write_Field28_Name): Add output for Finalizer. * einfo.ads: Update the documentation and usage in entities of attribute Contract. Update the node position and usage in entities of attribute Finalizer. Remove the documentation and usage in entities for attribute Refined_State_Pragma. (Refined_State_Pragma): Removed along with pragma Inline. (Set_Refined_State_Pragma): Removed along with pragma Inline. * par-prag.adb: Add Initializes to the pragmas that do not require special processing by the parser. * sem_ch3.adb (Analyze_Declarations): Add local variable Prag. Update the retrieval of pragma Refined_State. Analyze aspect/pragma Initializes at the end of the visible declarations of the related package. * sem_ch6.adb (Analyze_Subprogram_Body_Contract): Add local variables Ref_Depends and Ref_Global. Analyze pragmas Refined_Global and Refined_Depends in that order. (Analyze_Subprogram_Contract): Add local variables Depends and Global. Analyze pragmas Global and Depends in that order. * sem_ch7.adb (Analyze_Package_Body_Helper): Package bodies now have a contract. Move the analysis of the aspect specifications after the defining entity has been decorated. (Analyze_Package_Declaration): Packages now have a contract. Move the analysis of the aspect specifications after the defining entity has been decorated. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Packages now have contracts. * sem_ch13.adb (Analyze_Pragma): Code cleanup for aspect Abstract_State. Add processing for aspect Initializes. (Check_Aspect_At_Freeze_Point): Add an entry for Initializes. * sem_prag.adb: Use Get_Pragma_Arg to extract the expression of a pragma argument. Add an entry in table Sig_Flags for Initializes. (Analyze_Initializes_In_Decl_Part): New routine. (Analyze_Pragma): Check the declaration order of pragmas Abstract_State and Initializes. Abstract_State is now part of the package contract. Analyze pragma Initializes. Check for duplicate Refined_State pragma. Refined_State is now part of the package contract. (Check_Declaration_Order): New routine. (Check_Test_Case): Alphabetized. * sem_prag.ads (Analyze_Initializes_In_Decl_Part): New routine. * sem_util.adb (Add_Contract_Item): Rename formal Subp_Id to Id. This routine can now support contracts on packages and package bodies. * sem_util.ads (Add_Contract_Item): Rename formal Subp_Id to Id. Update comment on usage. * sinfo.ads: Update the usage of N_Contract nodes. * snames.ads-tmpl: Add predefined name Initializes. Add new pragma id for Initializes. From-SVN: r203522
2013-09-10switch-c.adb: Minor reformatting.Robert Dewar1-3/+6
2013-09-10 Robert Dewar <dewar@adacore.com> * switch-c.adb: Minor reformatting. * atree.ads (Original_Nodes): Add documentation on ASIS usage. * sinfo.ads: Add section on ASIS mode (documentation only). From-SVN: r202464
2013-07-05aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect.Hristian Kirtchev1-0/+6
2013-07-05 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect. * aspects.ads: Add an entry for SPARK_Mode in tables Aspect_Id, Aspect_Argument, Aspect_Names. * atree.adb (Node32): New routine. (Set_Node32): New routine. * atree.ads (Node32): New routine. (Set_Node32): New routine. * einfo.adb: Node32 is now used as SPARK_Mode_Pragmas. (Set_SPARK_Mode_Pragmas): New routine. (SPARK_Mode_Pragmas): New routine. (Write_Field32_Name): Add and entry for SPARK_Modes. * einfo.ads: Add attribute SPARK_Mode_Pragmas along with usage in various entities. (Set_SPARK_Mode_Pragmas): New routine and pragma Inline. (SPARK_Mode_Pragmas): New routine and pragma Inline. * gnat_rm.texi: Add sections explaining the syntax and semantics of aspect/pragma SPARK_Mode. * gnat_ugn.texi: Add pragma SPARK_Mode to the list of configuration pragmas. * lib.adb (Set_SPARK_Mode_Pragma): New routine. (SPARK_Mode_Pragma): New routine. * lib.ads: Alphabetize the comments on fields of record Unit_Record. Add new field SPARK_Mode_Pragma along with comment on its usage. Update the layout of record Unit_Record. (Set_SPARK_Mode_Pragma): New routine and pragma Inline. (SPARK_Mode_Pragma): New routine and pragma Inline. * lib-load.adb (Create_Dummy_Package_Unit): Initialize field SPARK_Mode_Pragma. (Load_Main_Source): Initialize field SPARK_Mode_Pragma. (Load_Unit): Initialize field SPARK_Mode_Pragma. * lib-writ.adb (Add_Preprocessing_Dependency): Initialize field SPARK_Mode_Pragma. (Ensure_System_Dependency): Initialize field SPARK_Mode_Pragma. * opt.ads: Alphabetize verification flags. Store the compilation-wide SPARK mode in variable Global_SPARK_Mode. * par-prag.adb: Pragma SPARK_Mode does not need special processing by the parser. * sem_ch13.adb (Analyze_Aspect_Specifications): Convert aspect SPARK_Mode into a pragma. (Check_Aspect_At_Freeze_Point): Aspect SPARK_Mode does not need delayed processing. * sem_prag.adb: Add an entry for SPARK_Mode in table Sig_Flags. (Analyze_Pragma): Add processing for pragma SPARK_Mode. (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sem_prag.ads (Get_SPARK_Mode_Id): New routine. (Is_Elaboration_SPARK_Mode): New routine. (Is_Private_SPARK_Mode): New routine. * sinfo.ads: Update the comment on the usage of field Next_Pragma. * snames.ads-tmpl: Add new predefined name for SPARK_Mode and Auto. Add new pragma Id for SPARK_Mode. * types.ads: Add new type SPARK_Mode_Id. From-SVN: r200711
2013-04-11[multiple changes]Arnaud Charlet1-1/+7
2013-04-11 Robert Dewar <dewar@adacore.com> * exp_attr.adb, sem_res.adb, sem_attr.adb: Minor reformatting. 2013-04-11 Robert Dewar <dewar@adacore.com> * atree.adb, atree.ads (Node31): New function. (Set_Node31): New procedure. 2013-04-11 Robert Dewar <dewar@adacore.com> * errout.ads: Minor typo correction. 2013-04-11 Javier Miranda <miranda@adacore.com> * einfo.ad[sb] (Thunk_Entity/Set_Thunk_Entity): New attribute. From-SVN: r197792
2013-01-29[multiple changes]Arnaud Charlet1-3/+10
2013-01-29 Robert Dewar <dewar@adacore.com> * atree.ads, atree.adb (Node30): New function. (Set_Node30): New procedure. (Num_Extension_Nodes): Change to 5 (activate new fields/flags). * atree.h: Add macros for Field30 and Node30. * einfo.ads, einfo.adb: Move some fields to avoid duplexing. * treepr.adb (Print_Entity_Information): Print fields 30-35. 2013-01-29 Robert Dewar <dewar@adacore.com> * sem_prag.adb (Analyze_Pragma, case Interface): Consider to be a violation of No_Obsolescent_Features even in Ada 95. Also generates a warning in -gnatwj mode. (Analyze_Pragma, case Interface_Name): Generates a warning in -gnatwj mode. * gnat_ugn.texi: Additional documentation on -gnatwj and pragma Interface[_Name]. 2013-01-29 Vincent Celier <celier@adacore.com> * snames.ads-tmpl: Add new standard name Trailing_Switches. 2013-01-29 Ed Schonberg <schonberg@adacore.com> * sem_disp.adb (Check_Controlling_Type): If a designated type T of an anonymous access type is a limited view of a tagged type, it can be a controlling type only if the subprogram is in the same scope as T. 2013-01-29 Vincent Celier <celier@adacore.com> * gnatcmd.adb: Use the project where the config pragmas file is declared to get its path. 2013-01-29 Vincent Celier <celier@adacore.com> * prj-attr.adb: New attribute Linker'Trailing_Switches. From-SVN: r195535
2013-01-04[multiple changes]Arnaud Charlet1-42/+463
2013-01-04 Robert Dewar <dewar@adacore.com> * warnsw.adb: Minor fixes to -gnatw.d handling. 2013-01-04 Robert Dewar <dewar@adacore.com> * einfo.adb, atree.adb: Enlarge entities to make 63 more flags, 6 more fields. 2013-01-04 Joel Brobecker <brobecker@adacore.com brobecker> * gnat_ugn.texi: Fix typo. 2013-01-04 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Document alignment choice for subtypes. 2013-01-04 Robert Dewar <dewar@adacore.com> * validsw.ads: Minor fix to comment. 2013-01-04 Doug Rupp <rupp@adacore.com> * Makefile.rtl (GNATRTL_NONTASKING_OBJS, GNATRTL_ALTIVEC_OBJS): Factor g-al* objects. * gcc-interface/Makefile.in (ADA_EXCLUDE_SRCS): Add g-al* sources. (GNATRTL_ALTIVEC_OBJS): Override to null for VMS. Rename leon vxworks toolchain as leon-wrs-vxworks. * gcc-interface/Make-lang.in: Update dependencies 2013-01-04 Pascal Obry <obry@adacore.com> * prj.ads (For_Each_Source): Add Locally_Removed parameter. (Source_Iterator): Add Locally_Removed field. * prj.adb (For_Each_Source): Ignore Locally_Removed files if needed. (Next): Likewise. 2013-01-04 Robert Dewar <dewar@adacore.com> * exp_attr.adb: Minor reformatting. 2013-01-04 Robert Dewar <dewar@adacore.com> * checks.adb (Insert_Valid_Check): Fix handling of renamed packed array element. * exp_ch4.adb (Expand_Concatenate): Fix some missing parent fields in generated code. * exp_util.adb (Side_Effect_Free): Improve detection of cases needing renaming. 2013-01-04 Robert Dewar <dewar@adacore.com> * sinfo.ads: Clean up order of N_xxx subtypes 2013-01-04 Vincent Celier <celier@adacore.com> * prj-conf.adb (Check_Target): Allow --autoconf= with no target. From-SVN: r194896
2013-01-03[multiple changes]Arnaud Charlet1-1/+3
2013-01-03 Thomas Quinot <quinot@adacore.com> * sem_ch7.adb, sem_ch10.adb, einfo.adb, einfo.ads, sem_ch12.adb, rtsfind.adb, sem_elab.adb, sem_ch4.adb, sem_ch8.adb (Einfo.Is_Visible_Child_Unit, Einfo.Set_Is_Visible_Child_Unit): Rename to Is_Visible_Lib_Unit, Set_Is_Visible_Lib_Unit, and update spec accordingly (now also applies to root library units). (Sem_Ch10.Analyze_Subunit.Analyze_Subunit_Context): Toggle above flag on root library units, not only child units. (Sem_Ch10.Install[_Limited]_Withed_Unit): Same. (Sem_Ch10.Remove_Unit_From_Visibility): Reset Is_Visible_Lib_Unit even for root library units. (Sem_Ch8.Find_Expanded_Name): A selected component form whose prefix is Standard is an expanded name for a root library unit. 2013-01-03 Thomas Quinot <quinot@adacore.com> * exp_ch3.adb: Minor reformatting. 2013-01-03 Olivier Hainque <hainque@adacore.com> * tracebak.c: Reinstate changes to support ppc-lynx178. 2013-01-03 Ed Schonberg <schonberg@adacore.com> * atree.ads: Minor reformatting and documentation enhancement. From-SVN: r194845
2012-12-05[multiple changes]Arnaud Charlet1-1/+1
2012-12-05 Thomas Quinot <quinot@adacore.com> * par_sco.adb, scos.ads, put_scos.adb, put_scos.ads, get_scos.adb: Generation of SCOs for aspects. 2012-12-05 Thomas Quinot <quinot@adacore.com> * sem_prag.adb (Check_Precondition_Postcondition): Remove redundant call to Set_SCO_Pragma_Enabled (the pragma will be rewritten into a pragma Check later on, and the call will be made when processing the rewritten pragma). (Analyze_Pragma, case Pragma_Check): Omit call to Set_SCO_Pragma_Enabled if Split_PPC is set. 2012-12-05 Olivier Hainque <hainque@adacore.com> * tracebak.c: Add partial support for Lynx178. 2012-12-05 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Improve the error message related to loop assertions. 2012-12-05 Gary Dismukes <dismukes@adacore.com> * atree.ads: Minor reformatting. From-SVN: r194211
2012-12-05[multiple changes]Arnaud Charlet1-1/+6
2012-12-05 Robert Dewar <dewar@adacore.com> * atree.ads, par-ch4.adb, sem_attr.adb, sem_ch13.adb: Minor reformatting. 2012-12-05 Eric Botcazou <ebotcazou@adacore.com> * gnat_ugn.texi (Switches for gcc): Document -flto and reorder. 2012-12-05 Ed Schonberg <schonberg@adacore.com> * par-ch5.adb (P_Condition): Handle properly Ada 2012 expressions that must be parenthesized before checking for redundant parentheses when that check is enabled. From-SVN: r194210
2012-12-05[multiple changes]Arnaud Charlet1-3/+11
2012-12-05 Thomas Quinot <quinot@adacore.com> * exp_dist.adb: Minor reformatting. 2012-12-05 Tristan Gingold <gingold@adacore.com> * Make-generated.in: Remove the VMS host specific part, as VMS compilers aren't built anymore on VMS. 2012-12-05 Thomas Quinot <quinot@adacore.com> * sem.adb, errout.ads, atree.adb, atree.ads (Check_Error_Detected): Only return quietly if a serious error of configurable run time violation has been found. 2012-12-05 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Type_Conversion): In Alfa_Mode, do not apply conversion checks. From-SVN: r194205