aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/aspects.ads
AgeCommit message (Collapse)AuthorFilesLines
2017-04-25[multiple changes]Arnaud Charlet1-1/+4
2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_aux.adb (Nearest_Ancestor): Use original node of type declaration to locate nearest ancestor, because derived type declarations for record types are rewritten as record declarations. * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle properly derivations that are completions of private types. (Add_Predicates): If type is private, examine rep. items of full view, which may include inherited predicates. (Build_Predicate_Functions): Ditto. 2017-04-25 Javier Miranda <miranda@adacore.com> * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change to generate new entities for subtype declarations located in Expression_With_Action nodes. 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * sem_elab.adb (Check_A_Call): Remove local variables Is_DIC_Proc and Issue_In_SPARK. Verify the need for Elaborate_All when SPARK elaboration checks are required. Update the checks for instances, variables, and calls to Default_Initial_Condition procedures. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline into a boolean aspect, in analogy with the Ada aspect No_Return. From-SVN: r247219
2017-01-12[multiple changes]Arnaud Charlet1-0/+5
2017-01-12 Arnaud Charlet <charlet@adacore.com> * sem_util.adb (Unique_Entity): For concurrent bodies that are defined with stubs and complete a declaration of a single concurrent object return the entity of an implicit concurrent type, not the entity of the anonymous concurrent object. * debug.adb: -gnatd.J is no longer used. * make.adb (Globalize): Removed, no longer used. * sem_ch9.adb: minor typo in comment for entry index 2017-01-12 Patrick Bernardi <bernardi@adacore.com> * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size. * exp_ch3.adb (Build_Init_Statements): As part of initialising the value record of a task, set its _Secondary_Stack_Size field if present. * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create a _Secondary_Stack_Size field in the value record of the task if a Secondary_Stack_Size rep item is present. (Make_Task_Create_Call): Include secondary stack size parameter. If No_Secondary_Stack restriction is in place, passes stack size of 0. * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma Secondary_Stack_Size. * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New function to define the overhead of the secondary stack. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Functions now include Secondary_Stack_Size parameter to pass to Initialize_ATCB. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New Secondary_Stack_Size component. * s-tassta.adb, s-tassta.ads (Create_Restricted_Task, Create_Restricted_Task_Sequential): Function now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call to include Secondary_Stack_Size parameter. * sem_ch13.adb (Analyze_Aspect_Specification): Add support for Secondary_Stack_Size aspect, turning the aspect into its corresponding internal attribute. (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute. * snames.adb-tmpl, snames.ads-tmpl: Added names Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size, Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size. From-SVN: r244358
2017-01-06aspects.adb, [...]: Reverted previous change for now.Patrick Bernardi1-5/+0
2017-01-06 Patrick Bernardi <bernardi@adacore.com> * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb, sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl, snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb, s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads: Reverted previous change for now. From-SVN: r244148
2017-01-06aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.Patrick Bernardi1-0/+5
2017-01-06 Patrick Bernardi <bernardi@adacore.com> * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size. * exp_ch3.adb (Build_Init_Statements): As part of initialising the value record of a task, set its _Secondary_Stack_Size field if present. * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create a _Secondary_Stack_Size field in the value record of the task if a Secondary_Stack_Size rep item is present. (Make_Task_Create_Call): Include secondary stack size parameter. If No_Secondary_Stack restriction is in place, passes stack size of 0. * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma Secondary_Stack_Size. * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New function to define the overhead of the secondary stack. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Functions now include Secondary_Stack_Size parameter to pass to Initialize_ATCB. * s-tarest.adb (Create_Restricted_Task, Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New Secondary_Stack_Size component. * s-tassta.adb, s-tassta.ads (Create_Restricted_Task, Create_Restricted_Task_Sequential): Function now include Secondary_Stack_Size parameter. (Task_Wrapper): Secondary stack now allocated to the size specified by the Secondary_Stack_Size parameter in the task's ATCB. * sem_ch13.adb (Analyze_Aspect_Specification): Add support for Secondary_Stack_Size aspect, turning the aspect into its corresponding internal attribute. (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute. * snames.adb-tmpl, snames.ads-tmpl: Added names Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size, Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size. From-SVN: r244146
2017-01-06[multiple changes]Arnaud Charlet1-0/+5
2017-01-06 Tristan Gingold <gingold@adacore.com> * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All. 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_case.adb: Minor reformatting. 2017-01-06 Thomas Quinot <quinot@adacore.com> * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause 2017-01-06 Justin Squirek <squirek@adacore.com> * aspects.adb: Register aspect in Canonical_Aspect. * aspects.ads: Associate qualities of Aspect_Max_Queue_Length into respective tables. * einfo.ads, einfo.adb: Add a new attribute for handling the parameters for Pragma_Max_Entry_Queue (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms for accessing and setting were added as well. * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue. * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit declaration for pramga arguments and store them in the protected type node. (Make_Initialize_Protection): Pass a reference to the Entry_Max_Queue_Lengths_Array in the protected type node to the runtime. * rtsfind.adb: Minor grammar fix. * rtsfind.ads: Register new types taken from the runtime libraries RE_Protected_Entry_Queue_Max and RE_Protected_Entry_Queue_Max_Array * s-tposen.adb, s-tpoben.adb (Initialize_Protection_Entry/Initialize_Protection_Entries): Add extra parameter and add assignment to local object. * s-tposen.ads, s-tpoben.ads: Add new types to store entry queue maximums and a field to the entry object record. * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement for Aspect_Max_Queue_Length. (Check_Aspect_At_Freeze_Point): Add aspect to list of aspects that don't require delayed analysis. * sem_prag.adb (Analyze_Pragma): Add case statement for Pragma_Max_Queue_Length, check semantics, and register arugments in the respective entry nodes. * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length and Has_Max_Queue_Length * snames.ads-tmpl: Add constant for the new aspect-name Name_Max_Queue_Length and corrasponding pragma. 2017-01-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Is_Controlled_Function_Call): Reimplemented. Consider any node which has an entity as the function call may appear in various ways. From-SVN: r244126
2016-04-27[multiple changes]Arnaud Charlet1-3/+3
2016-04-27 Hristian Kirtchev <kirtchev@adacore.com> * aspects.ads Aspects Export and Import do not require delay. They were classified as delayed aspects, but treated as non-delayed by the analysis of aspects. * freeze.adb (Copy_Import_Pragma): New routine. (Wrap_Imported_Subprogram): Copy the import pragma by first resetting all semantic fields to avoid an infinite loop when performing the copy. * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add comment on the processing of aspects Export and Import at the freeze point. (Analyze_Aspect_Convention: New routine. (Analyze_Aspect_Export_Import): New routine. (Analyze_Aspect_External_Link_Name): New routine. (Analyze_Aspect_External_Or_Link_Name): Removed. (Analyze_Aspect_Specifications): Factor out the analysis of aspects Convention, Export, External_Name, Import, and Link_Name in their respective routines. Aspects Export and Import should not generate a Boolean pragma because their corresponding pragmas have a very different syntax. (Build_Export_Import_Pragma): New routine. (Get_Interfacing_Aspects): New routine. 2016-04-27 Eric Botcazou <ebotcazou@adacore.com> * inline.adb (Add_Inlined_Body): Overhaul implementation, robustify handling of -gnatn1, add special treatment for expression functions. 2016-04-27 Doug Rupp <rupp@adacore.com> * g-traceb.ads: Update comment. * exp_ch2.adb: minor style fix in object declaration From-SVN: r235483
2015-10-26[multiple changes]Arnaud Charlet1-1/+5
2015-10-26 Bob Duff <duff@adacore.com> * snames.ads-tmpl, aspects.adb, aspects.ads: Add the aspect and pragma names and enter into relevant tables. * sem_ch13.adb (Analyze_Aspect_Specifications): Analyze aspect Predicate_Failure. * sem_prag.adb (Predicate_Failure): Analyze pragma Predicate_Failure. * exp_util.adb (Make_Predicate_Check): When building the Check pragma, if Predicate_Failure has been specified, add the relevant String argument to the pragma. * par-prag.adb (Prag): Add Predicate_Failure to list of pragmas handled during semantic analysis. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): If the left-hand side is an indexed component with generalized indexing, discard interpretation that yields a reference type, which is not assignable. This prevent spurious ambiguities when the right-hand side is an aggregate which does not provide a target type. From-SVN: r229358
2015-10-26[multiple changes]Arnaud Charlet1-5/+29
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-202015-10-20 Hristian Kirtchev <kirtchev@adacore.com>Hristian Kirtchev1-5/+14
* aspects.adb Add aspect Volatile_Function to table Canonical_Aspect. * aspect.ads Add aspect Volatile_Function to tables Aspect_Argument, Aspect_Delay, Aspect_Id, Aspect_Names and Implementation_Defined_Aspect. Aspects Async_Readers, Async_Writers, Effective_Reads and Effective_Writes are no longer Boolean. * einfo.adb (Get_Pragma): Add an entry for pragma Volatile_Function. * par-prag.adb (Prag): Pragma Volatile_Function does not need special processing by the parser. * rtsfind.ads Add an entry for Ada.Synchronous_Task_Control in table RTU_Id. Add an entry for Suspension_Object in table RE_Id. * sem_ch3.adb Fix SPARK RM references. (Analyze_Object_Contract): Update the error guard. * sem_ch5.adb Fix SPARK RM references. * sem_ch6.adb (Analyze_Subprogram_Body_Contract): Ensure that a non-volatile function does not contain an effectively volatile parameter. (Analyze_Subprogram_Contract): Ensure that a non-volatile function does not contain an effectively volatile parameter. * sem_ch12.adb (Instantiate_Object): Remove the reference to the SPARK RM from the error message. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspects Async_Readers, Async_Writers, Effective_Reads, Effective_Writes and Volatile_Function. (Check_Aspect_At_Freeze_Point): Aspects Async_Readers, Async_Writers, Effective_Reads, Effective_Writes and Volatile_Function do not need special processing at the freeze point. * sem_prag.adb Add an entry for pragma Volatile_Function in table Sig_Flags. (Analyze_External_Property_In_Decl_Part): Reimplemented as Async_Readers, Async_Writers, Effective_Reads and Effective_Writes are no longer Boolean pragmas. (Analyze_Global_Item): An external state or effectively volatile object cannot appear as an item in pragma [Refined_]Global. (Analyze_Pragma): Change the implementation of Async_Readers, Async_Writers, Effective_Reads and Effective_Writes as these are no longer Boolean pragmas. Use routine Check_Static_Boolean_Expression to verify the optional Boolean expression of Async_Readers, Async_Writers, Constant_After_Elaboration, Effective_Reads, Effective_Writes, Extensions_Visible and Volatile_Function. Add processing for pragma Volatile_Function. (Check_Static_Boolean_Expression): New routine. (Find_Related_Context): Update the comment on usage. (Is_Enabled_Pragma): New routine. * sem_prag.ads (Is_Enabled_Pragma): New routine. * sem_res.adb Fix SPARK RM references. (Is_OK_Volatile_Context): Add detection for return statements. (Resolve_Actuals): Remove the check concerning an effectively volatile OUT actual parameter as this is now done by the SPARK flow analyzer. (Resolve_Entity_Name): Remove the check concerning an effectively volatile OUT formal parameter as this is now done by the SPARK flow analyzer. (Within_Volatile_Function): New routine. * sem_util.adb (Add_Contract_Item): Add processing for pragma Volatile_Function. (Check_Nonvolatile_Function_Profile): New routine. (Is_Descendant_Of_Suspension_Object): New routine. (Is_Effectively_Volatile): Protected types and descendants of Suspension_Object are now treated as effectively volatile. (Is_Enabled): The optional Boolean expression of pragmas Async_Readers, Async_Writers, Effective_Reads and Effective_Writes now appears as the first argument. (Is_Volatile_Function): New routine. * sem_util.ads Add SPARK RM references. (Add_Contract_Item): Update the comment on usage. (Check_Nonvolatile_Function_Profile): New routine. (Is_Effectively_Volatile): Update the comment on usage. (Is_Volatile_Function): New routine. * snames.ads-tmpl Add a predefined name and pragma id for Volatile_Function. From-SVN: r229047
2015-10-16[multiple changes]Arnaud Charlet1-114/+119
2015-10-16 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb Add an entry for Constant_After_Elaboration in table Canonical_Aspect. * aspects.ads Add entries for Constant_After_Elaboration in tables Aspect_Argument, Aspect_Delay, Aspect_Id, Aspect_Names and Implementation_Defined_Aspect. * par-prag.adb Pragma Constant_After_Elaboration does not require special processing by the parser. * sem_ch13.adb Add an entry for Constant_After_Elaboration in table Sig_Flags. (Analyze_Aspect_Specifications): Add processing for aspect Constant_After_Elaboration. (Check_Aspect_At_Freeze_Point): Aspect Constant_After_Elaboration does not require special processing at freeze time. * sem_prag.adb (Analyze_Pragma): Add processing for pragma Constant_After_Elaboration. Use routine Find_Related_Context to retrieve the context of pragma Part_Of. (Duplication_Error): Update comment on usage. (Find_Related_Context): New routine. * sem_prag.ads Add an entry for Constant_After_Elaboration in table Aspect_Specifying_Pragma. (Analyze_Contract_Cases_In_Decl_Part): Update the comment on usage. * sem_util.adb (Add_Contract_Item): Add processing for pragma Constant_After_Elaboration. * sem_util.ads (Add_Contract_Item): Update the comment on usage. * snames.ads-tmpl Add new predefined name and aspect id for Constant_After_Elaboration. 2015-10-16 Vincent Celier <celier@adacore.com> * prj-pp.adb (Pretty_Print.Print): Correctly display extending packages, instead of making them renamed packages. From-SVN: r228911
2015-05-26[multiple changes]Arnaud Charlet1-0/+3
2015-05-26 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add aspect Disable_Controlled. * einfo.ads, einfo.adb (Disable_Controlled): New flag. (Is_Controlled_Active): New function. * exp_ch3.adb (Expand_Freeze_Record_Type): Use Is_Controlled_Active. * exp_util.adb (Needs_Finalization): Finalization not needed if Disable_Controlled set. * freeze.adb (Freeze_Array_Type): Do not set Has_Controlled_Component if the component has Disable_Controlled. (Freeze_Record_Type): ditto. * sem_ch13.adb (Decorate): Minor reformatting. (Analyze_Aspect_Specifications): Implement Disable_Controlled. * sem_ch3.adb (Analyze_Object_Declaration): Handle Disable_Controlled. (Array_Type_Declaration): ditto. (Build_Derived_Private_Type): ditto. (Build_Derived_Type): ditto. (Record_Type_Definition): ditto. * snames.ads-tmpl: Add Name_Disable_Controlled. 2015-05-26 Eric Botcazou <ebotcazou@adacore.com> * exp_ch6.adb (Expand_Actuals): Use a constant declaration instead of a renaming to capture the return value of a function call. (Expand_Simple_Function_Return): Call Remove_Side_Effects instead of removing side effects manually before the call to _Postconditions. From-SVN: r223667
2015-05-12[multiple changes]Arnaud Charlet1-2/+5
2015-05-12 Pierre-Marie de Rodat <derodat@adacore.com> * sem_ch10.adb (Sem_Ch10.Analyze_Proper_Body): Generate SCOs for subunit in generic units. 2015-05-12 Robert Dewar <dewar@adacore.com> * sem_elab.adb (Check_A_Call): Avoid checking internal call from Valid_Scalars 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_Formals): An untagged incomplete type is legal in the profile of a null procedure. 2015-05-12 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Validate_Derived_Type_Instance): Handle properly the checks on a derived formal whose parent type is a previous formal that is not a derived type. 2015-05-12 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add entries for aspect Volatile_Full_Access * einfo.adb (Has_Volatile_Full_Access): New flag. (Has_Volatile_Full_Access): New flag. * einfo.ads (Has_Volatile_Full_Access): New flag. * par-prag.adb: Add dummy entry for Volatile_Full_Access. * sem_prag.adb (Analyze_Pragma, case Volatile_Full_Access): Implement new pragma. * snames.ads-tmpl: Add entries for pragma Volatile_Full_Access. 2015-05-12 Robert Dewar <dewar@adacore.com> * targparm.ads: Minor reformatting. 2015-05-12 Robert Dewar <dewar@adacore.com> * a-reatim.adb (Time_Of): Properly detect overflow when TS = 0.0. * a-reatim.ads: Minor reformatting. From-SVN: r223074
2015-03-13[multiple changes]Arnaud Charlet1-1/+5
2015-03-13 Claire Dross <dross@adacore.com> * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline subprograms with unconstrained record parameters containing Itype declarations. * sinfo.ads Document GNATprove assumption that type should match in the AST. * sem_ch6.adb (Analyze_Subprogram_Body_Contract): Do not check for Refined_Depends and Refined_Globals contracts as they are optional. 2015-03-13 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Instantiate_Type): For a floating-point type, capture dimension info if any, because the generated subtype declaration does not come from source and will not process dimensions. * sem_dim,adb (Analyze_Dimension_Extension_Or_Record_Aggregate): Do not analyze expressions with an initialization procedure because aggregates will have been checked at the point of record declaration. 2015-03-13 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add entries for aspect Unimplemented. * einfo.ads, einfo.adb (Is_Unimplemented): New flag. * sem_ch13.adb: Add dummy entry for aspect Unimplemented. * snames.ads-tmpl: Add entry for Name_Unimplemented. From-SVN: r221420
2014-10-312014-10-31 Hristian Kirtchev <kirtchev@adacore.com>Arnaud Charlet1-0/+5
* aspects.adb Add an entry for aspect Ghost in table Canonical_Aspect. * aspects.ads Add an entry for aspect Ghost in tables Aspect_Argument, Aspect_Delay, Aspect_Id, Aspect_Names and Implementation_Defined_Aspect. * einfo.adb: Flags 277 and 278 are now in use. (Is_Checked_Ghost_Entity): New routine. (Is_Ghost_Entity): Removed. (Is_Ghost_Subprogram): Removed. (Is_Ignored_Ghost_Entity): New routine. (Set_Is_Checked_Ghost_Entity): New routine. (Set_Is_Ignored_Ghost_Entity): New routine. (Write_Entity_Flags): Output flags Is_Checked_Ghost_Entity and Is_Ignored_Ghost_Entity. * einfo.ads: Add new flags Is_Checked_Ghost_Entity and Is_Ignored_Ghost_Entity along with usage in nodes. (Is_Checked_Ghost_Entity): New routine and pragma Inline. (Is_Ghost_Entity): Removed along with synthesized flag description and usage in nodes. (Is_Ghost_Subprogram): Removed along with synthesized flag description and usage in nodes. (Is_Ignored_Ghost_Entity): New routine and pragma Inline. (Set_Is_Checked_Ghost_Entity): New routine and pragma Inline. (Set_Is_Ignored_Ghost_Entity): New routine and pragma Inline. * freeze.adb (Freeze_Entity): A Ghost type cannot be effectively volatile. * par-prag.adb Pragma Ghost does not need special handling by the parser. * repinfo.adb (List_Mechanisms): Remove the entry for convention Ghost. * sem_attr.adb (Analyze_Access_Attribute): Remove obsolete check. * sem_ch3.adb (Analyze_Full_Type_Declaration): Mark the type as Ghost when its enclosing context is Ghost. (Analyze_Incomplete_Type_Decl): Mark the type as Ghost when its enclosing context is Ghost. (Analyze_Number_Declaration): Mark the number as Ghost when its enclosing context is Ghost. (Analyze_Object_Declaration): Mark the object as Ghost when its enclosing context is Ghost. Verify the Ghost policy between initial declaration and completion of a deferred constant. (Analyze_Object_Contract): A Ghost variable cannot be effectively volatile, imported or exported. (Build_Derived_Record_Type): Mark a type extension as Ghost when it implements a Ghost interface. (Build_Record_Type): Inherit volatility and "ghostness" from the parent type. (Check_Completion): A Ghost entity declared in a non-Ghost package does not require completion in a body. (Implements_Ghost_Interface): New routine. (Process_Full_View): Inherit "ghostness" from the partial view. Verify the Ghost policy between the partial and full views. Verify the completion of a Ghost type extension. * sem_ch4.adb (Check_Ghost_Subprogram_Call): Removed. * sem_ch5.adb (Analyze_Assignment): Analyze the left hand side first. * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Mark the subprogram as Ghost when its enclosing context is Ghost. (Analyze_Generic_Subprogram_Body): Mark the generic body as Ghost when its enclosing context is Ghost. Verify the Ghost policy between the spec and body. (Analyze_Subprogram_Body_Helper): Mark the body as Ghost when its enclosing context is Ghost. Verify the Ghost policy between the spec and body. (Check_Conformance): A Ghost subprogram profile and a non-Ghost subprogram profile are not subtype conformant. (Convention_Of): Removed. * sem_ch7.adb (Analyze_Package_Body_Helper): Inherit the "ghostness" from the spec. Verify the Ghost policy between the spec and body. (Analyze_Private_Type_Declaration): Mark the type as Ghost when its enclosing context is Ghost. (Requires_Completion_In_Body): New routine. (Unit_Requires_Body): Use Requires_Completion_In_Body. (Unit_Requires_Body_Info): Rename formal parameter P to Pack_Id, update comment on usage and all uses of P in the body. Use Requires_Completion_In_Body. * sem_ch7.ads (Unit_Requires_Body): Rename formal parameter P to Pack_Id, update comment on usage and all uses of P in the body. * sem_ch8.adb (Analyze_Exception_Renaming): Inherit the "ghostness" from the renamed excention. (Analyze_Generic_Renaming): Inherit the "ghostness" from the renamed generic subprogram. (Analyze_Object_Renaming): Inherit the "ghostness" from the renamed object. (Analyze_Package_Renaming): Inherit the "ghostness" from the renamed package. (Analyze_Subprogram_Renaming): Inherit the "ghostness" from the renamed subprogram. * sem_ch11.adb (Analyze_Exception_Declaration): Mark an exception as Ghost when its enclosing context is Ghost. * sem_ch12.adb (Analyze_Generic_Package_Declaration, Analyze_Generic_Subprogram_Declaration): Mark an exception as Ghost when its enclosing context is Ghost. (Preanalyze_Actuals): Remove obsolete check. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Ghost. (Check_Aspect_At_Freeze_Point): Aspects Depends and Global do no need special checking at freeze point. (Insert_After_SPARK_Mode): Update comment on usage. * sem_mech.adb (Set_Mechanisms): Remove the entry for convention Ghost. * sem_prag.adb Add an entry for pragma Ghost in table Sig_Flags. (Analyze_Abstract_State): Update the grammar of the pragma. Add formal parameter Pack_Id along with comment on usage. Mark an abstract state as Ghost when its enclosing context is Ghost. Add processing for option Ghost. (Analyze_Constituent): Verify that a Ghost abstract state is refined by Ghost constituents. (Analyze_Pragma): "Ghost" is now a valid policy. Add checks related to the use and placement of Check_Policy Ghost. Add processing for pragma Ghost. (Check_Ghost_Constituent): New routine. (Is_Valid_Assertion_Kind): "Ghost" is now a valid assertion. (Process_Convention): Remove obsolete check. (Set_Convention_From_Pragma): Remove the processing for convention Ghost. * sem_res.adb (Check_Ghost_Context): New routine. (Resolve_Call): Verify that a reference to a Ghost entity appears in a suitable context. Verify the Ghost polity between point of declaration and point of use. (Resolve_Entity_Name): Verify that a reference to a Ghost entity appears in a suitable context. Verify the Ghost polity between point of declaration and point of use. * sem_util.adb (Check_Ghost_Completion): New routine. (Check_Ghost_Derivation): New routine. (Incomplete_Or_Partial_View): New routine. (Incomplete_Or_Private_View): Removed. (Is_Ghost_Entity): New routine. (Is_Ghost_Statement_Or_Pragma): New routine. (Is_Subject_To_Ghost): New routine. (Policy_In_Effect): New routine. (Set_Is_Ghost_Entity): New routine. (Within_Ghost_Scope): New routine. * sem_util.ads (Check_Ghost_Completion): New routine. (Check_Ghost_Derivation): New routine. (Incomplete_Or_Partial_View): New routine. (Incomplete_Or_Private_View): Removed. (Is_Ghost_Entity): New routine. (Is_Ghost_Statement_Or_Pragma): New routine. (Is_Subject_To_Ghost): New routine. (Policy_In_Effect): New routine. (Set_Is_Ghost_Entity): New routine. (Within_Ghost_Scope): New routine. * snames.adb-tmpl (Get_Convention_Id): Remove the entry for convention Ghost. (Get_Convention_Name): Remove the entry for convention Ghost. * snames.ads-tmpl Remove the convention id for Ghost. Add a pragma id for Ghost. 2014-10-31 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: Add description of --RTS option for ASIS tools. From-SVN: r216981
2014-10-31[multiple changes]Arnaud Charlet1-0/+4
2014-10-31 Eric Botcazou <ebotcazou@adacore.com> * inline.adb (Check_And_Split_Unconstrained_Function): Do not test for the presence of nested subprograms. 2014-10-31 Ed Schonberg <schonberg@adacore.com> * aspects.ads, aspects.adb: Add aspect Default_Storage_Pool. * sem_ch13.adb (Analyze_One_Aspect): Generate pragma for aspect Default_Storage_Pool. From-SVN: r216959
2014-10-30[multiple changes]Arnaud Charlet1-2/+7
2014-10-30 Yannick Moy <moy@adacore.com> * inline.adb (Has_Single_Return_In_GNATprove_Mode): Return False when return statement is inside one or more blocks. 2014-10-30 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Is_Subprogram_Call): Account for the case where an object declaration initialized by a function call that returns an unconstrained result may be rewritted as a renaming of the secondary stack result. 2014-10-30 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for aspect Extensions_Visible in table Canonical_Aspect. * aspects.ads: Add entry for aspect Extensions_Visible in tables Aspect_Argument, Aspect_Delay, Aspect_Id, Aspect_Names, Implementation_Defined_Aspect. * einfo.adb (Get_Pragma): Include pragma Extensions_Visible in the list of contract pragmas. * par-prag.adb Pragma Extensions_Visible does not require special processing from the parser. * sem_ch3.adb (Analyze_Object_Declaration): Prevent an implicit class-wide conversion of a formal parameter of a specific tagged type whose related subprogram is subject to pragma Extensions_Visible with value "False". (Check_Abstract_Overriding): Add various overriding checks related to pragma Extensions_Visible. (Derive_Subprogram): A subprogram subject to pragma Extensions_Visible with value False requires overriding if the subprogram has at least one controlling OUT parameter. (Is_EVF_Procedure): New routine. * sem_ch4.adb (Analyze_Type_Conversion): A formal parameter of a specific tagged type whose related subprogram is subject to pragma Extensions_Visible with value "False" cannot appear in a class-wide conversion. * sem_ch6.adb (Analyze_Subprogram_Contract): Remove the assertion to account for pragma Extensions_Visible. (Check_Overriding_Indicator): An overriding subprogram inherits the contact of the overridden subprogram. (New_Overloaded_Entity): An overriding subprogram inherits the contact of the overridden subprogram. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Extensions_Visible. (Check_Aspect_At_Freeze_Point): Aspect Extensions_Visible does not require special processing at the freeze point. * sem_prag.adb Add an entry for pragma Extensions_Visible in table Sig_Flags. (Analyze_Pragma): Ensure that various SPARK pragmas lack identifiers in their arguments. Add processing for pragma Extensions_Visible. (Chain_CTC): Code reformatting. * sem_res.adb (Resolve_Actuals): A formal parameter of a specific tagged type whose related subprogram is subject to pragma Extensions_Visible with value "False" cannot act as an actual in a subprogram with value "True". * sem_util.adb (Add_Classification): New routine. (Add_Contract_Item): Account for pragma Extensions_Visible. Code reformatting. (Add_Contract_Test_Case): New routine. (Add_Pre_Post_Condition): New routine. (Extensions_Visible_Status): New routine. (Inherit_Subprogram_Contract): New routine. (Is_EVF_Expression): New routine. (Is_Specific_Tagged_Type): New routine. * sem_util.ads Add type Extensions_Visible_Mode and document all values. (Add_Contract_Item): Add pragma Extensions_Visible to the comment on usage. (Inherit_Subprogram_Contract): New routine. (Is_EVF_Expression): New routine. (Is_Specific_Tagged_Type): New routine. * sinfo.adb (Is_Inherited): New routine. (Set_Is_Inherited): New routine. * sinfo.ads Add flag Is_Inherited along with its usage in nodes. (Is_Inherited): New routine along with pragma Inline. (Set_Is_Inherited): New routine along with pragma Inline. * snames.ads-tmpl: Add predefined name "Extensions_Visible" and a new Pragma_Id for the pragma. From-SVN: r216919
2014-10-20gnat_rm.texi: Document No_Tagged_Streams pragma and aspect.Robert Dewar1-0/+3
2014-10-20 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Document No_Tagged_Streams pragma and aspect. * snames.ads-tmpl: Add entry for pragma No_Tagged_Streams. * aspects.ads, aspects.adb: Add aspect No_Tagged_Streams. * einfo.adb (No_Tagged_Streams_Pragma): New field. * einfo.ads: Minor reformatting (reorder entries). (No_Tagged_Streams_Pragma): New field. * exp_ch3.adb: Minor comment update. * opt.ads (No_Tagged_Streams): New variable. * par-prag.adb: Add dummy entry for pragma No_Tagged_Streams. * sem.ads (Save_No_Tagged_Streams): New field in scope record. * sem_attr.adb (Check_Stream_Attribute): Check stream ops prohibited by No_Tagged_Streams. * sem_ch3.adb (Analyze_Full_Type_Declaration): Set No_Tagged_Streams_Pragma. (Analyze_Subtype_Declaration): ditto. (Build_Derived_Record_Type): ditto. (Record_Type_Declaration): ditto. * sem_ch8.adb (Pop_Scope): Restore No_Tagged_Streams. (Push_Scope): Save No_Tagged_Streams. * sem_prag.adb (Analyze_Pragma, case No_Tagged_Streams): Implement new pragma. From-SVN: r216476
2014-10-17[multiple changes]Arnaud Charlet1-0/+4
2014-10-17 Robert Dewar <dewar@adacore.com> * sem_attr.adb (Eval_Attribute): Ensure that attribute reference is not marked as being a static expression if the prefix evaluation raises CE. 2014-10-17 Robert Dewar <dewar@adacore.com> * exp_pakd.adb: Move bit packed entity tables to spec. * exp_pakd.ads: Move bit packed entity tables here from body. * freeze.adb (Freeze_Array_Type): Check that packed array type is supported. * rtsfind.adb (PRE_Id_Table): New table (Entity_Not_Defined): Specialize messages using PRE_Id_Table. * uintp.ads, uintp.adb (UI_Image): New functional form. 2014-10-17 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add Suppress_Initialization aspect. * einfo.ads, einfo.adb (Suppress_Initialization): Now applies to E_Variable. * exp_ch3.adb (Default_Initialize_Object): Handle Suppress_Initialization. * exp_prag.adb (Expand_Pragma_Suppress_Initialization): New procedure (Expand_N_Pragma): Handle Suppress_Initialization (Expand_Pragma_Import_Or_Interface): Use Undo_Initialization (Undo_Initialization): New procedure. * sem_prag.adb (Analyze_Pragma, case Suppress_Initialization): This is now allowed for E_Variable case. * gnat_rm.texi: Document new aspect Suppress_Initialization Suppress_Initialization aspect/pragma can apply to variable. * einfo.ads: Minor reformatting. 2014-10-17 Arnaud Charlet <charlet@adacore.com> * spark_xrefs.ads: Add documentation pointer to Flow_Computed_Globals. 2014-10-17 Robert Dewar <dewar@adacore.com> * cstand.adb (Create_Standard): Mark Short_Integer as implementation defined. * sem_util.adb (Set_Entity_With_Checks): Avoid blow up for compiler built with assertions for No_Implementation_Identifiers test. From-SVN: r216379
2014-10-17aspects.ads: Documentation fix, aspect Lock_Free does have a corresponding ↵Robert Dewar1-6/+2
pragma. 2014-10-17 Robert Dewar <dewar@adacore.com> * aspects.ads: Documentation fix, aspect Lock_Free does have a corresponding pragma. * gnat_rm.texi: Document implementation defined boolean aspects as boolean. From-SVN: r216378
2014-08-04aspects.ads, [...]: Add entries for aspect Obsolescent.Robert Dewar1-0/+4
2014-08-04 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add entries for aspect Obsolescent. * gnat_rm.texi: Add documentation for aspect Obsolescent. * sem_ch13.adb (Analyze_Aspect_Specifications): Implement aspect Obsolescent. (Check_Aspect_At_Freeze_Point): Add dummy entry for pragma Obsolescent. * s-osprim-mingw.adb: Minor reformatting. * sem_res.adb (Is_Atomic_Ref_With_Address): New function (Resolve_Indexed_Component): Rework warnings for non-atomic access (Resolve_Selected_Component): Add warnings for non-atomic access. From-SVN: r213588
2014-08-04[multiple changes]Arnaud Charlet1-71/+75
2014-08-04 Robert Dewar <dewar@adacore.com> * prj-strt.adb, prj-strt.ads, sem_attr.adb: Minor reformatting. 2014-08-04 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb Add an entry in table Canonical_Aspect for Default_Initial_Condition. * aspects.ads Add an entry in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay for Default_Initial_Condition. * einfo.adb Flag3 is now Has_Default_Init_Cond. Flag132 is now Is_Default_Init_Cond_ Procedure. Flag133 is now Has_Inherited_Default_Init_Cond. (Default_Init_Cond_Procedure): New routine. (Has_Default_Init_Cond): New routine. (Has_Inherited_Default_Init_Cond): New routine. (Is_Default_Init_Cond_Procedure): New routine. (Set_Default_Init_Cond_Procedure): New routine. (Set_Has_Default_Init_Cond): New routine. (Set_Has_Inherited_Default_Init_Cond): New routine. (Set_Is_Default_Init_Cond_Procedure): New routine. (Write_Entity_Flags): Output all the new flags. * einfo.ads New attributes Default_Init_Cond_Procedure, Has_Inherited_Default_Init_Cond and Is_Default_Init_Cond_Procedure along with usage in nodes. (Default_Init_Cond_Procedure): New routine. (Has_Default_Init_Cond): New routine and pragma Inline. (Has_Inherited_Default_Init_Cond): New routine and pragma Inline. (Is_Default_Init_Cond_Procedure): New routine and pragma Inline. (Set_Default_Init_Cond_Procedure): New routine. (Set_Has_Default_Init_Cond): New routine and pragma Inline. (Set_Has_Inherited_Default_Init_Cond): New routine and pragma Inline. (Set_Is_Default_Init_Cond_Procedure): New routine and pragma Inline. * exp_ch3.adb (Expand_N_Object_Declaration): New constant Next_N. Generate a call to the default initial condition procedure if the object's type is subject to the pragma. (Freeze_Type): Generate the body of the default initial condition procedure or inherit the spec from a parent type. * exp_ch7.adb Add with and use clause for Exp_Prag. (Expand_Pragma_Initial_Condition): Removed. * exp_prag.ads, exp_prag.adb (Expand_Pragma_Initial_Condition): New routine. * par-prag.adb (Prag): Pragma Default_Initial_Condition does not need special treatment by the parser. * sem_ch3.adb (Build_Derived_Record_Type): Propagate the attributes related to pragma Default_Initial_Condition to the derived type. (Process_Full_View): Propagate the attributes related to pragma Default_Initial_Condition to the full view. * sem_ch7.adb (Analyze_Package_Specification): Build the declaration of the default initial condition procedure for all types that qualify or inherit the one from the parent type. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Default_Initial_Condition. (Check_Aspect_At_Freeze_Point): Aspect Default_Initial_Condition does not require delayed analysis. (Replace_Type_References_Generic): Moved to spec. * sem_ch13.ads (Replace_Type_References_Generic): Moved from body. * sem_prag.adb Add an entry in table Sif_Glags for Default_Initial_Condition. (Analyze_Pragma): Pragma Default_Initial_Condition is now part of assertion policy. Add processing for pragma Default_Initial_Condition. (Is_Valid_Assertion_Kind): Pragma Default_Initial_Condition is now recognized as a proper assertion policy. * sem_util.ads, sem_util.adb (Build_Default_Init_Cond_Call): New routine. (Build_Default_Init_Cond_Procedure_Body): New routine. (Build_Default_Init_Cond_Procedure_Declaration): New routine. (Inherit_Default_Init_Cond_Procedure): New routine. * snames.ads-tmpl Add new predefined name and pragma id for Default_Initial_Condition. From-SVN: r213552
2014-08-01[multiple changes]Arnaud Charlet1-0/+3
2014-08-01 Eric Botcazou <ebotcazou@adacore.com> * sem_ch7.adb: Fix minor oversight in condition. 2014-08-01 Bob Duff <duff@adacore.com> * projects.texi: Minor documentation improvements. 2014-08-01 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add aspect No_Elaboration_Code_All. * gnat_rm.texi: Document No_Elaboration_Code_All pragma and aspect. * lib-load.adb: Initialize No_Elab_Code_All field. * lib-writ.adb: Initialize No_Elab_Code_All. * lib.ads, lib.adb: New field No_Elab_Code_All. * par-prag.adb: Add dummy entry for pragma No_Elaboration_Code_All. * restrict.ads, restrict.adb: Restriction No_Elaboration_Code_All no longer exists. * sem_ch10.adb (Analyze_Context): Processing for No_Elaboration_Code_All removed. (Generate_Parent_References): Moved to Sem_Util. * sem_prag.adb: Add processing for pragma No_Elaboration_Code_All. * sem_util.ads, sem_util.adb (Get_Parent_Entity): Moved here from Sem_Ch10. * snames.ads-tmpl: Add entry for pragma No_Elaboration_Code_All. * targparm.adb: Minor comment updates Add comments on ignoring pragma No_Elaboration_Code_All. 2014-08-01 Nicolas Roche <roche@adacore.com> * adaint.c (__gnat_set_close_on_exec): Ensure that we can unset "close_on_exec" flag. 2014-08-01 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Build_Wrapper_Spec, Replicate_Formals): When building the parameter specs of the wrapper program for a primitive operation of a synchronized type that implements an interface, copy the null_exclusion indicator as well. 2014-08-01 Robert Dewar <dewar@adacore.com> * sem_eval.ads: Minor reformatting. From-SVN: r213466
2014-07-30[multiple changes]Arnaud Charlet1-8/+16
2014-07-30 Hristian Kirtchev <kirtchev@adacore.com> * aspects.ads Add a comment explaining why SPARK 2014 aspects are not delayed. Update the delay status of most SPARK 2014 aspects. * sem_ch13.adb (Analyze_Aspect_Specifications): Update all calls to Decorate_Aspect_And_Pragma and Insert_Delayed_Pragma to refert to Decorate and Insert_Pragma. Add various comments concerning the delay status of several SPARK 2014 aspects. The insertion of Refined_State now uses routine Insert_After_SPARK_Mode. (Decorate): New routine. (Decorate_Aspect_And_Pragma): Removed. (Insert_Delayed_Pragma): Removed. (Insert_Pragma): New routine. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * inline.adb (Expand_Inlined_Call): In GNATprove mode, emit only a warning, not an error on an attempt to inline a recursive subprogram. From-SVN: r213243
2014-07-30[multiple changes]Arnaud Charlet1-4/+4
2014-07-30 Hristian Kirtchev <kirtchev@adacore.com> * aspects.ads Aspects Async_Readers, Async_Writers, Effective_Reads and Effective_Writes do not need to be delayed. * sem_ch13.adb (Analyze_Aspect_Specifications): Propagate the optional Boolean expression when generating the corresponding pragma for an external property aspect. * sem_prag.adb (Analyze_External_Property_In_Decl_Part): Remove local constant Obj. Add local constant Obj_Id. Reimplement the check which ensures that the related variable is in fact volatile. (Analyze_Pragma): Reimplement the analysis of external property pragmas. * sem_util.adb (Is_Enabled): New routine. (Variable_Has_Enabled_Property): Reimplement the detection of an enabled external property. 2014-07-30 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi, vms_data.ads: gnatstub: describe generating subunits for body stubs. 2014-07-30 Pascal Obry <obry@adacore.com> * g-forstr.adb, g-forstr.ads: New. * gnat_rm.texi, impunit.adb Makefile.rtl: Add new unit GNAT.Formatted_String. From-SVN: r213241
2014-07-29exp_ch5.adb, [...]: Minor comment additions.Robert Dewar1-1/+1
2014-07-29 Robert Dewar <dewar@adacore.com> * exp_ch5.adb, exp_ch9.adb: Minor comment additions. * gnat_rm.texi: Complete list of implementation aspects. * aspects.ads: Minor comment clarification. From-SVN: r213196
2014-07-18[multiple changes]Arnaud Charlet1-4/+8
2014-07-18 Gary Dismukes <dismukes@adacore.com> * sem_util.adb: Minor typo correction. 2014-07-18 Ben Brosgol <brosgol@adacore.com> * gnat_rm.texi: Complete previous change. 2014-07-18 Pascal Obry <obry@adacore.com> * s-fileio.adb: Minor style fix. 2014-07-18 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Detect improper specification of stream attributes for subtypes that are not first subtypes, to prevent malformed rep_item chains in the case of such illegal specifications for discriminated private subtypes. (Check_Overloaded_Name): Verify that the name is an entity name before other checks. 2014-07-18 Pascal Obry <obry@adacore.com> * adaint.c (__gnat_fputwc) Do not disable on cross-build. From-SVN: r212807
2014-07-17[multiple changes]Arnaud Charlet1-1/+7
2014-07-17 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add entries for aspect Annotate. * gnat_rm.texi: Document Entity argument for pragma Annotate and Annotate aspect. * sem_ch13.adb (Analyze_Aspect_Specification): Add processing for Annotate aspect. * sem_prag.adb (Analyze_Pragma, case Annotate): Allow optional Entity argument at end. * sinfo.ads (N_Aspect_Specification): Add note on Annotate aspect. 2014-07-17 Tristan Gingold <gingold@adacore.com> * s-imguns.ads: Fix minor typo. 2014-07-17 Thomas Quinot <quinot@adacore.com> * sprint.adb: Minor reformatting. From-SVN: r212732
2014-06-13[multiple changes]Arnaud Charlet1-1/+5
2014-06-13 Hristian Kirtchev <kirtchev@adacore.com> * freeze.adb (Freeze_Record_Type): Remove checks related to SPARK volatile types. (Freeze_Type): Volatile types are now illegal in SPARK. 2014-06-13 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Add aspect Thread_Local_Storage. * gnat_rm.texi: Document aspect Thread_Local_Storage. 2014-06-13 Ed Schonberg <schonberg@adacore.com> * sem_cat.adb (Validate_Static_Object_Name): A constant whose value is a temporary that renames an aggregate is legal in a preelaborated unit. Illegalities, if any will be detected in the aggregate components. 2014-06-13 Ed Schonberg <schonberg@adacore.com> * einfo.ads: Minor reformatting an comment expansion. From-SVN: r211613
2014-02-25lib.ads, [...]: Implement pragma Compiler_Unit_Warning...Arnaud Charlet1-4/+0
2014-02-25 Robert Dewar <dewar@adacore.com> * lib.ads, s-bitops.adb, s-bitops.ads, s-conca5.adb, gnat_rm.texi, s-conca5.ads, s-conca7.adb, s-conca7.ads, s-crc32.adb, s-crc32.ads, s-conca9.adb, s-conca9.ads, g-dyntab.adb, s-crtl.ads, g-dyntab.ads, s-excdeb.adb, s-addope.adb, s-addope.ads, s-carun8.adb, s-carun8.ads, g-htable.adb, g-htable.ads, g-hesora.adb, g-hesora.ads, s-conca2.adb, s-conca2.ads, a-comlin.adb, a-chlat1.ads, a-comlin.ads, errout.ads, a-except.adb, s-conca4.adb, a-except.ads, s-conca4.ads, s-conca6.adb, s-conca6.ads, g-spchge.adb, g-spchge.ads, g-u3spch.adb, g-u3spch.ads, a-strhas.ads, restrict.adb, aspects.adb, aspects.ads, s-conca8.adb, s-conca8.ads, back_end.adb, par-prag.adb, g-byorma.adb, g-byorma.ads, a-elchha.adb, a-elchha.ads, g-speche.adb, g-speche.ads, s-casuti.adb, s-assert.adb, s-casuti.ads, s-assert.ads, a-clrefi.adb, a-clrefi.ads, s-conca3.adb, s-conca3.ads, a-ioexce.ads: Implement pragma Compiler_Unit_Warning, change Compiler_Unit everywhere to Compiler_Unit_Warning. 2014-02-25 Sergey Rybin <rybin@adacore.com frybin> * sem_prag.adb (Analyze_Depends_In_Decl_Part): Do not normalize in ASIS mode aggregates that are used as aspect definitions. From-SVN: r208137
2014-02-24[multiple changes]Arnaud Charlet1-21/+1
2014-02-24 Thomas Quinot <quinot@adacore.com> * par_sco.adb (Traverse_One): Refine categorization of statement SCOs. 2014-02-24 Robert Dewar <dewar@adacore.com> * aspects.ads, aspects.adb: Remove aspects Ada_2005 and Ada_2012, Pure_05, Pure_12 and Preelaborate_05. * gnat_rm.texi: Update accordingly. * sem_prag.adb: Document one argument form of Ada_05/Ada_2005 pragmas Document one argument form of Ada_12/Ada_2012 pragmas Recognize one argument form of these pragmas only in GNAT mode (-gnatg). From-SVN: r208072
2014-02-20[multiple changes]Arnaud Charlet1-0/+5
2014-02-20 Robert Dewar <dewar@adacore.com> * s-os_lib.ads (Rename_File): Minor commment addition. 2014-02-20 Thomas Quinot <quinot@adacore.com> * einfo.ads: Minor reformatting. 2014-02-20 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb (Exchange_Aspects): New routine. * aspects.ads (Exchange_Aspects): New routine. * atree.adb (Rewrite): Do not check whether the save node has aspects as it never will, instead check the node about to be clobbered. * einfo.adb (Write_Field25_Name): Abstract_States can appear in entities of generic packages. * sem_ch6.adb (Analyze_Expression_Function): Fix the parent pointer of an aspect specification list after rewriting takes place. * sem_ch7.adb (Analyze_Package_Body_Helper): Swap the aspect specifications of the generic template and the copy used for analysis. * sem_ch12.adb (Analyze_Generic_Package_Declaration): Swap the aspect specifications of the generic template and the copy used for analysis. (Analyze_Package_Instantiation): Propagate the aspect specifications from the generic template to the instantiation. (Build_Instance_Compilation_Unit_Nodes): Propagate the aspect specifications from the generic template to the instantiation. * sem_ch13.adb (Analyze_Aspect_Specifications): Handle aspects Abstract_State, Initializes and Initial_Condition when they apply to a package instantiation. 2014-02-20 Robert Dewar <dewar@adacore.com> * stringt.adb: Add call to Initialize in package initialization. From-SVN: r207946
2014-02-19style.adb (Missing_Overriding): Warning does not apply in language versions ↵Ed Schonberg1-0/+4
prior to Ada 2005. 2014-02-19 Ed Schonberg <schonberg@adacore.com> * style.adb (Missing_Overriding): Warning does not apply in language versions prior to Ada 2005. * snames.ads-tmpl: Add Name_Iterable and Attribute_Iterable. * sem_attr.adb: Add Attribute_Iterable where needed. * exp_attr.adb: ditto. * exp_ch5.adb (Expand_Formal_Container_Loop): New procedure to handle loops and quantified expressions over types that have an iterable aspect. Called from Expand_Iterator_Loop. * sem_ch5.adb (Analyze_Iterator_Specification): Recognize types with Iterable aspect. * sem_ch13.adb (Validate_Iterable_Aspect): Verify that the subprograms specified in the Iterable aspect have the proper signature involving container and cursor. (Check_Aspect_At_Freeze_Point): Analyze value of iterable aspect. * sem_ch13.ads (Validate_Iterable_Aspect): New subprogram. * sem_util.ads, sem_util.adb (Get_Iterable_Type_Primitive): New procedure to retrieve one of the primitives First, Last, or Has_Element, from the value of the iterable aspect of a formal container. (Is_Container_Element): Predicate to recognize expressions that denote an element of one of the predefined containers, for possible optimization. This subprogram is not currently used, pending ARG discussions on the legality of the proposed optimization. Worth preserving for eventual use. (Is_Iterator): Recognize formal container types. * aspects.ads, aspects.adb: Add Aspect_Iterable where needed. From-SVN: r207881
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/+4
* 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-23[multiple changes]Arnaud Charlet1-0/+4
2014-01-23 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Make_Invqriant_Call): If type of expression is a private extension, get invariant from base type. 2014-01-23 Robert Dewar <dewar@adacore.com> * sem_util.adb, sem_attr.adb: Minor reformatting. 2014-01-23 Robert Dewar <dewar@adacore.com> * opt.adb (Save_Opt_Config_Switches): Save SPARK_Mode_Pragma (Restore_Opt_Config_Switches): Restore SPARK_Mode_Pragma. * sem.adb (Semantics): Remove save/restore of SPARK_Mode[_Pragma]. Not needed since already done in Save/Restore_Opt_Config_Switches. 2014-01-23 Robert Dewar <dewar@adacore.com> * gnat_rm.texi, einfo.adb, einfo.ads, sem_prag.adb, gnat_ugn.texi, freeze.adb, repinfo.adb, aspects.adb, aspects.ads, sem_ch13.adb: Linker_Section enhancements. From-SVN: r206992
2014-01-21[multiple changes]Arnaud Charlet1-0/+16
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-20[multiple changes]Arnaud Charlet1-1/+3
2014-01-20 Pascal Obry <obry@adacore.com> * s-win32.ads (FreeLibrary): New import. 2014-01-20 Robert Dewar <dewar@adacore.com> * sem_res.adb, sem_cat.adb: Minor reformatting. * sem_ch11.adb (Analyze_Raise_Statement): Only give warning about assigning to OUT parameters for the current subprogram scope. * exp_ch4.adb: Minor reformatting. 2014-01-20 Ed Schonberg <schonberg@adacore.com> * exp_ch4.adb (Process_Transient_Object, Find_Enclosing_Contexts): If the top-level if-expression that generated the transient object is an actual in a call, the proper Hook_Context is a construct enclosing the call. * einfo.ads: Indicate that Related_Expression is used to link a loop variable to the container expression over which the loop takes place. (Analyze_Iterator_Specification): Set the Related_Expression of the loop variable in a container element iterator. (Note_Possible_Modification): If the variable is the loop variable in a container element iterator, indicate that the enclosing container is also modified. 2014-01-20 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb (Move_Or_Merge_Aspects): Reimplemented. From-SVN: r206824
2013-10-17aspects.adb, [...]: Remove all entries for Refined_Pre from the various tables.Hristian Kirtchev1-5/+0
2013-10-17 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb, aspects.ads, sem_prag.ads: Remove all entries for Refined_Pre from the various tables. * par-prag.adb: Remove the entry for Refined_Pre from the list of pragmas not needing special processing by the parser. * sem_ch13.adb (Analyze_Aspect_Specifications): Remove the processing for aspect Refined_Pre. (Check_Aspect_At_Freeze_Point): Remove the entry for aspect Refined_Pre. * sem_prag.adb (Analyze_Pragma): Refined_Pre is no longer a valid assertion kind. Remove the analysis of pragma Refined_Pre. (Analyze_Refined_Pragma): Update the comment on usage. (Find_Related_Subprogram_Or_Body): Update the comment on usage. Pragma Refined_Pre is no longer processed by this routine. (Is_Valid_Assertion_Kind): Refined_Pre is no longer a valid assertion kind. * snames.ads-tmpl: Remove predefined name Refined_Pre. Remove the pragma id for Refined_Pre. From-SVN: r203765
2013-10-14[multiple changes]Arnaud Charlet1-0/+4
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry in table Canonical_Aspect for Initial_Condition. * aspects.ads: Add entries in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay for Initial_Condition. * einfo.adb (Get_Pragma): Include pragma Initial_Condition to categorization pragmas. * einfo.ads (Get_Pragma): Update comment on usage. * exp_ch7.adb (Expand_N_Package_Body): Add a runtime check to verify the assertion introduced by pragma Initial_Condition. (Expand_N_Package_Declaration): Add a runtime check to verify the assertion introduced by pragma Initial_Condition. (Expand_Pragma_Initial_Condition): New routine. * par-prag: Include pragma Initial_Condition to the list of pragmas that do not require special processing by the parser. * sem_ch3.adb (Analyze_Declarations): Analyze pragma Initial_Condition at the end of the visible declarations. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Initial_Condition. (Check_Aspect_At_Freeze_Point): Aspect Initial_Condition does not need inspection at freezing. * sem_prag.adb (Analyze_Initial_Condition_In_Decl_Part): New routine. (Analyze_Pragma): Update all calls to Check_Declaration_Order. Add processing for pragma Initial_Condition. Initial_Condition is now a valid assertion kind. Add an entry in table Sig_Flags for Initial_Condition. (Check_Declaration_Order): Reimplemented to handle arbitrary pragmas. (Is_Valid_Assertion_Kind): Add an entry for Initial_Condition. * sem_pag.ads (Analyze_Initial_Condition_In_Decl_Part): New routine. * sem_util.adb (Add_Contract_Item): Pragma Initial_Condition can now be associated with a package spec. * sem_util.ads (Add_Contract_Item): Update comment on usage. * sinfo.ads: Update the documentation of node N_Contract * snames.ads-tmpl: Add new predefined name Initial_Condition. Add new pragma id for Initial_Condition. 2013-10-14 Thomas Quinot <quinot@adacore.com> * exp_pakd.adb: Minor reformatting. From-SVN: r203551
2013-10-14aspects.adb: Add an entry in table Canonical_Aspect for Initializes.Hristian Kirtchev1-0/+4
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-10-10[multiple changes]Arnaud Charlet1-0/+4
2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry in table Canonical_Aspect for Refined_State. * aspects.ads: Add entries in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay for Refined_State. * einfo.adb: Add with and use clauses for Elists. Remove Refined_State from the list of node usage. Add Refined_State_Pragma to the list of node usage. (Has_Null_Abstract_State): New routine. (Refined_State): Removed. (Refined_State_Pragma): New routine. (Set_Refined_State): Removed. (Set_Refined_State_Pragma): New routine. (Write_Field8_Name): Add output for Refined_State_Pragma. (Write_Field9_Name): Remove the output for Refined_State. * einfo.ads: Add new synthesized attribute Has_Null_Abstract_State along with usage in nodes. Remove attribute Refined_State along with usage in nodes. Add new attribute Refined_State_Pragma along with usage in nodes. (Has_Null_Abstract_State): New routine. (Refined_State): Removed. (Refined_State_Pragma): New routine. (Set_Refined_State): Removed. (Set_Refined_State_Pragma): New routine. * elists.adb (Clone): New routine. * elists.ads (Clone): New routine. * par-prag.adb: Add Refined_State to the pragmas that do not require special processing by the parser. * sem_ch3.adb: Add with and use clause for Sem_Prag. (Analyze_Declarations): Add local variables Body_Id, Context and Spec_Id. Add processing for delayed aspect/pragma Refined_State. * sem_ch13.adb (Analyze_Aspect_Specifications): Update the handling of aspect Abstract_State. Add processing for aspect Refined_State. Remove the bizzare insertion policy for aspect Abstract_State. (Check_Aspect_At_Freeze_Point): Add an entry for Refined_State. * sem_prag.adb: Add an entry to table Sig_Flags for pragma Refined_State. (Add_Item): Update the comment on usage. The inserted items need not be unique. (Analyze_Contract_Cases_In_Decl_Part): Rename variable Restore to Restore_Scope and update all its occurrences. (Analyze_Pragma): Update the handling of pragma Abstract_State. Add processing for pragma Refined_State. (Analyze_Pre_Post_Condition_In_Decl_Part): Rename variable Restore to Restore_Scope and update all its occurrences. (Analyze_Refined_State_In_Decl_Part): New routine. * sem_prag.ads (Analyze_Refined_State_In_Decl_Part): New routine. * snames.ads-tmpl: Add new predefined name for Refined_State. Add new Pragma_Id for Refined_State. 2013-10-10 Ed Schonberg <schonberg@adacore.com> * sem_ch10.adb (Install_Limited_Withed_Unit): handle properly the case of a record declaration in a limited view, when the record contains a self-referential component of an anonymous access type. From-SVN: r203371
2013-10-10[multiple changes]Arnaud Charlet1-1/+11
2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in table Canonical_Aspects for aspects Refined_Depends and Refined_Global. * aspects.ads: Add entries in tables Aspect_Id, Aspect_Argument, Aspect_Names, Aspect_Declay, Aspect_On_Body_Or_Stub_OK for aspects Refined_Depends and Refined_Global. * einfo.adb (Contract): Subprogram bodies are now valid owners of contracts. (Set_Contract): Subprogram bodies are now valid owners of contracts. (Write_Field24_Name): Output the contract attribute for subprogram bodies. * exp_ch6.adb (Expand_Subprogram_Contract): New routine. * exp_ch6.ads (Expand_Subprogram_Contract): New routine. * par-prag.adb: Pragmas Refined_Depends and Refined_Global do not require any special processing by the parser. * sem_ch3.adb (Adjust_D): Renamed to Adjust_Decl. (Analyze_Declarations): Code reformatting. Analyze the contract of a subprogram body at the end of the declarative region. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Subprogram bodies can now have contracts. Use Expand_Subprogram_Contract to handle the various contract assertions. (Analyze_Subprogram_Body_Contract): New null routine. (Analyze_Subprogram_Body_Helper): Subprogram bodies can now have contracts. Use Expand_Subprogram_Contract to handle the various contract assertions. (Analyze_Subprogram_Contract): Add local variable Nam. Update the call to Analyze_PPC_In_Decl_Part. Capture the pragma name in Nam. (Process_PPCs): Removed. * sem_ch6.ads (Analyze_Subprogram_Body_Contract): New routine. (Analyze_Subprogram_Contract): Update the comment on usage. * sem_ch13.adb (Analyze_Aspect_Specifications): Add null implementations for aspects Refined_Depends and Refined_Global. (Check_Aspect_At_Freeze_Point): Aspects Refined_Depends and Refined_Global do not need to be checked at the freeze point. * sem_prag.adb: Add entries in table Sig_Flags for pragmas Refined_Depends and Refined_Global. (Analyze_Contract_Cases_In_Decl_Part): Add local variable Restore. Use Restore to pop the scope. (Analyze_Depends_In_Decl_Part): Add local variable Restore. Use Restore to pop the scope. (Analyze_Global_In_Decl_List): Add local variable Restore. Use Restore to pop the scope. (Analyze_PPC_In_Decl_Part): Renamed to Analyze_Pre_Post_Condition_In_Decl_Part. (Analyze_Pragma): Add null implementations for pragmas Refined_Depends and Refined_Global. Refined_Pre and Refined_Post are now handled by routine Analyze_Refined_Pre_Post_Condition exclusively. (Analyze_Refined_Depends_In_Decl_Part): New null routine. (Analyze_Refined_Global_In_Decl_Part): New null routine. (Analyze_Refined_Pre_Post): Renamed to Analyze_Refined_Pre_Post_Condition. (Analyze_Refined_Pre_Post_Condition): Analyze the boolean expression. (Check_Precondition_Postcondition): Update the call to Analyze_PPC_In_Decl_Part. * sem_prag.ads: Add entries in table Pragma_On_Body_Or_Stub_OK for pragmas Refined_Depends and Refined_Global. (Analyze_PPC_In_Decl_Part): Renamed to Analyze_Pre_Post_Condition_In_Decl_Part. Update the comment on usage. (Analyze_Refined_Depends_In_Decl_Part): New routine. (Analyze_Refined_Global_In_Decl_Part): New routine. (Analyze_Test_Case_In_Decl_Part): Update the comment on usage. * sem_util.adb (Add_Contract_Item): Rename formal Item to Prag and update all occurrences. Subprogram body contracts can now contain pragmas Refined_Depends and Refined_Global. * sem_util.ads (Add_Contract_Item): Rename formal Item to Prag. Update the comment on usage. * sinfo.ads: Update the comment on structure and usage of N_Contract. * snames.ads-tmpl: Add new predefined names for Refined_Depends and Refined_Global. Add entries in table Pragma_Id for Refined_Depends and Refined_Global. 2013-10-10 Robert Dewar <dewar@adacore.com> * types.ads: Minor reformatting. From-SVN: r203365
2013-10-10[multiple changes]Arnaud Charlet1-1/+9
2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for Aspect_Refined_Post in table Canonical_Aspect. * aspects.ads: Add an entry for Aspect_Refined_Post in tables Aspect_Id, Aspect_Argument, Aspect_Names, Aspect_Delay, Aspect_On_Body_Or_Stub_OK. Update the comment on the use of table Aspect_On_Body_Or_Stub_OK. * par-prag.adb: Add pragma Refined_Post to the list of pragmas that do not require special processing by the parser. * sem_attr.adb (Analyze_Attribute): Add special analysis for attributes 'Old and 'Result when code generation is disabled and they appear in aspect/pragma Refined_Post. (In_Refined_Post): New routine. * sem_ch6.adb (Analyze_Expression_Function): Move various aspects and/or pragmas that apply to an expression function to the corresponding spec or body. (Collect_Body_Postconditions): New routine. (Process_PPCs): Use routine Collect_Body_Postconditions to gather all postcondition pragmas. * sem_ch10.adb (Analyze_Proper_Body): Use routine Relocate_Pragmas_To_Body to move all source pragmas that follow a body stub to the proper body. (Move_Stub_Pragmas_To_Body): Removed. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Refined_Post. (Check_Aspect_At_Freeze_Point): Aspect Refined_Post does not need delayed processing at the freeze point. * sem_prag.adb: Add an entry for pragma Refined_Post in table Sig_Flags. (Analyze_Pragma): Add processing for pragma Refined_Post. Update the processing of pragma Refined_Pre to use common routine Analyze_Refined_Pre_Post. (Analyze_Refined_Pre_Post): New routine. (Relocate_Pragmas_To_Body): New routine. * sem_prag.ads: Table Pragma_On_Stub_OK is now known as Pragma_On_Body_Or_Stub_OK. Update the comment on usage of table Pragma_On_Body_Or_Stub_OK. (Relocate_Pragmas_To_Body): New routine. * snames.ads-tmpl: Add new predefined name for Refined_Post. Add new Pragma_Id for Refined_Post. 2013-10-10 Robert Dewar <dewar@adacore.com> * exp_ch3.adb (Expand_N_Variant_Part): Now null, expansion of last choice to others is moved to Freeze_Record_Type. * freeze.adb (Freeze_Record_Type): Expand last variant to others if necessary (moved here from Expand_N_Variant_Part From-SVN: r203359
2013-10-10[multiple changes]Arnaud Charlet1-7/+40
2013-10-10 Ed Schonberg <schonberg@adacore.com> * par-ch13.adb (Aspect_Specifications_Present)): In earlier than Ada2012 mode, assume that a legal aspect name following "with" keyword is an older gnat switch and not a misplaced with_clause. 2013-10-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add an entry for Aspect_Refined_Pre in table Canonical_Aspect. (Aspects_On_Body_OK): Renamed to Aspects_On_Body_Or_Stub_OK. (Aspects_On_Body_Or_Stub_OK): Update the query in table Aspect_On_Body_OK. * aspects.ads: Add an entry for Aspect_Refined_Pre in tables Aspect_Id, Aspect_Argument, Aspect_Names, Aspect_Delay, Aspect_On_Body_Or_Stub_OK. Table Aspect_On_Body_OK is now known as Aspect_On_Body_Or_Stub_OK. Add a section of aspect specifications that apply to body stubs. (Aspects_On_Body_OK): Renamed to Aspects_On_Body_Or_Stub_OK. (Aspects_On_Body_Or_Stub_OK): Update the comment on usage. * par-prag.adb: Add pragma Refined_Pre to the list of pragmas that do not require special processing by the parser. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Delay the analysis of aspect specifications that apply to a body stub until the proper body is analyzed. * sem_ch10.adb: Add with and use clause for Sem_Ch13. (Analyze_Package_Body_Stub): Set the corresponding spec of the stub. (Analyze_Proper_Body): Relocate all pragmas that apply to a subprogram body stub to the declarations of the proper body. Analyze the aspect specifications of the stub when the proper body is not present. (Analyze_Protected_Body_Stub): Set the corresponding spec of the stub. (Analyze_Task_Body_Stub): Set the corresponding spec of the stub. (Move_Stub_Pragmas_To_Body): New routine. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Refined_Pre. (Check_Aspect_At_Freeze_Point): Aspect Refined_Pre does not need delayed processing at the freeze point. * sem_prag.adb: Remove with and use clause for Snames. Add an entry for Pragma_Refined_Pre in table Sig_Flags. (Analyze_Pragma): Add processing for pragma Refined_Pre. * sem_prag.ads: Add with and use clause for Snames. Add table Pragma_On_Stub_OK. * sinfo.adb (Corresponding_Spec_Of_Stub): New routine. (Set_Corresponding_Spec_Of_Stub): New routine. * sinfo.ads: Add new attribute Corresponding_Spec_Of_Stub along with comment on usage and occurrences in nodes. (Corresponding_Spec_Of_Stub): New routine along with pragma Inline. (Set_Corresponding_Spec_Of_Stub): New routine along with pragma Inline. * snames.ads-tmpl: Add new predefined name for Refined_Pre. Add new Pragma_Id for Refined_Pre. 2013-10-10 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Improve error message when name in instantiation does not designate a generic unit of the right kind. From-SVN: r203355
2013-09-10[multiple changes]Arnaud Charlet1-7/+23
2013-09-10 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case SPARK_Mode): Handle properly a subprogram body without previous spec. 2013-09-10 Gary Dismukes <dismukes@adacore.com> * sem_ch4.adb: Minor typo fixes. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb (Aspects_On_Body_OK): New routine. * aspects.ads: Modify type Aspect_Expression to include the Optional_XXX variants. Update the contents of table Aspect_Argument. Add table Aspect_On_Body_OK. (Aspects_On_Body_OK): New routine. * par-ch13.adb (Get_Aspect_Specifications): Account for optional names and expressions when parsing an aspect. * sem_ch6.adb: Add with and use clause for Aspects. (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing a body with aspects that can be applied simultaneously to both spec and body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a subprogram body in the declarative part. (Make_Aitem_Pragma): Do not generate a pragma with an empty argument list. From-SVN: r202462
2013-09-10[multiple changes]Arnaud Charlet1-4/+12
2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add entries in the Has_Aspect_Specifications_Flag table for package body and body stubs. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * aspects.ads (Move_Aspects): Update comment on usage. (Move_Or_Merge_Aspects): New routine. (Remove_Aspects): New routine. * par-ch3.adb: Update the grammar of private_type_declaration, private_extension_declaration, object_renaming_declaration, and exception_renaming_declaration. (P_Subprogram): Parse the aspect specifications that apply to a body stub. * par-ch6.adb: Update the grammar of subprogram_body_stub and generic_instantiation. * par-ch7.adb: Update the grammar of package_declaration, package_specification, package_body, package_renaming_declaration, package_body_stub. (P_Package): Parse the aspect specifications that apply to a body, a body stub and package renaming. * par-ch9.adb: Update the grammar of entry_declaration, protected_body, protected_body_stub, task_body, and task_body_stub. (P_Protected): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a protected body and a protected body stub. (P_Task): Add local variable Aspect_Sloc. Add local constant Dummy_Node. Parse the aspect specifications that apply to a task body and a task body stub. * par-ch12.adb: Update the grammar of generic_renaming_declaration. (P_Generic): Parse the aspect specifications that apply to a generic renaming. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not emit an error when analyzing aspects that apply to a body stub. Such aspects are relocated to the proper body. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the aspect specifications that apply to a body. * sem_ch9.adb (Analyze_Protected_Body): Warn about user-defined aspects not being supported on protected bodies. Remove the aspect specifications. (Analyze_Single_Protected_Declaration): Analyze the aspects that apply to a single protected declaration. (Analyze_Task_Body): Warn about user-defined aspects not being supported on task bodies. Remove the aspect specifications. * sem_ch10.adb: Add with and use clause for Aspects. (Analyze_Package_Body_Stub): Propagate the aspect specifications from the stub to the proper body. * sem_ch13.adb (Analyze_Aspect_Specifications): Insert the corresponding pragma of an aspect that applies to a body in the declarations of the body. * sinfo.ads: Update the gramma of expression_function, private_type_declaration, private_extension_declaration, object_renaming_declaration, exception_renaming_declaration, package_renaming_declaration, subprogram_renaming_declaration, generic_renaming_declaration, entry_declaration, subprogram_body_stub, package_body_stub, task_body_stub, generic_subprogram_declaration. 2013-09-10 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Add processing for aspect/pragma SPARK_Mode when it applies to a [library-level] subprogram or package [body]. 2013-09-10 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Document that -gnatc and -gnatR cannot be given together. * switch-c.adb (Scan_Front_End_Switches): Give error if both -gnatR and -gnatc given. 2013-09-10 Robert Dewar <dewar@adacore.com> * g-table.ads, g-table.adb (For_Each): New generic procedure (Sort_Table): New generic procedure. From-SVN: r202460
2013-09-10aspects.ads, [...]: Minor reformatting.Thomas Quinot1-7/+7
2013-09-10 Thomas Quinot <quinot@adacore.com> * aspects.ads, sem_ch13.adb: Minor reformatting. * adaint.c (__gnat_set_close_on_exec): Add comment documenting that this routine is shared between OS_Lib and Sockets. From-SVN: r202458
2013-09-10[multiple changes]Arnaud Charlet1-0/+197
2013-09-10 Robert Dewar <dewar@adacore.com> * aspects.ads (Delay_Type): New type (Aspect_Delay): New table. * einfo.adb (Has_Delayed_Rep_Aspects): New flag (May_Inherit_Delayed_Rep_Aspects): New flag (Rep_Clause): Removed (use Get_Attribute_Representation_Clause). * einfo.ads (Has_Delayed_Rep_Aspects): New flag (May_Inherit_Delayed_Rep_Aspects): New flag * freeze.adb: Minor reformatting * sem_ch13.adb (Analyze_Aspect_Speficifications): Redo handling of delayed evaluation, including optimizing some cases and avoiding delays. (Analyze_Aspects_At_Freeze_Point): Now handled inheriting delayed rep aspects for type derivation case. (Inherit_Delayed_Rep_Aspects): New procedure * sem_ch13.ads (Analyze_Aspects_At_Freeze_Point): Now handled inheriting delayed rep aspects for type derivation case. * sem_ch3.adb (Build_Derived_Type): Set May_Inherit_Derived_Rep_Aspects if parent type flag Has_Delayed_Rep_Aspects is set 2013-09-10 Robert Dewar <dewar@adacore.com> * errout.adb (Finalize): Don't delete real errors with specific warning control. 2013-09-10 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Expand_N_Timed_Entry_Call, Expand_N_Conditional_Entry_Call, Expand_N_Asynchronous_Select): Handle properly a trigger that is a call to a primitive operation of a type that implements a limited interface, if the type itself is not limited. From-SVN: r202456
2013-07-05aspects.adb: Add an entry for SPARK_Mode in table Canonical_Aspect.Hristian Kirtchev1-0/+3
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-25sem_prag.adb: Minor code reorganization (correct misspelling Restiction).Robert Dewar1-1/+1
2013-04-25 Robert Dewar <dewar@adacore.com> * sem_prag.adb: Minor code reorganization (correct misspelling Restiction). * sem_util.adb, aspects.ads, sem_ch6.adb: Minor reformatting. * gnat_rm.texi: Document impl-defined aspects. * sem_dim.adb, sem_dim.ads, gnat_ugn.texi, s-dimmks.ads: Minor reformatting. From-SVN: r198291