summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
Commit message (Collapse)AuthorAgeFilesLines
* 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-201-2/+2
| | | | | | | | | * s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235251 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-201-0/+45
| | | | | | | | | | | * sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the renamed operator when the associated node appears within a pre/postcondition. * sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235249 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Yannick Moy <moy@adacore.com>charlet2016-04-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix. * einfo.adb (Set_Overridden_Operation): Add assertion. * sem_util.adb (Unique_Entity): for renaming-as-body return the spec entity. 2016-04-20 Javier Miranda <miranda@adacore.com> * exp_unst.adb (Append_Unique_Call): New subprogram. (Unnest_Subprogram): Replace the unique occurrence of Call.Append() by Append_Unique_Call() which protects us from adding to the Calls table duplicated entries. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * exp_attr.adb (Is_GCC_Target): Fix for C backend. * xref_lib.ads (Dependencies_Tables): instantiate Table package with types that guarantee its safe use. * s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested procedures. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235248 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-201-14/+11
| | | | | | | | | * sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235246 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Arnaud Charlet <charlet@adacore.com>charlet2016-04-201-1/+8
| | | | | | | | | | | | | | | | | | | * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix indentation. * sem_util.adb (Is_Unchecked_Conversion_Instance): defense against library-level renamings of other functions, which are never instances of Unchecked_Conversion. * einfo.ads: minor fix of casing in comment 2016-04-20 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body that has been analyzed and expanded already. Qualify the names in the proper body for use in the generation of C code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235244 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Gary Dismukes <dismukes@adacore.com>charlet2016-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and reformatting. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool): If the pragma comes from an aspect specification, verify that the aspect applies to an entity with a declarative part. * exp_ch5.adb: Code cleanup. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_If_Expression): If first expression is universal, resolve subsequent ones with the corresponding class type (Any_Integer or Any_Real). 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is disabled, complete the analysis of the iterator name to ensure that reference for entities within are properly generated. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * a-dispat.ads (Yield): add Global contract. * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time. * a-taside.adb: Added Initializes => Tasking_State. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235240 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-201-0/+5
| | | | | | | | | | | | | | | | | | | | | * sem_ch13.adb (Add_Invariant): Do not replace the saved expression of an invariatn aspect when inheriting a class-wide type invariant as this clobbers the existing expression. Do not use New_Copy_List as it is unnecessary and leaves the parent pointers referencing the wrong part of the tree. Do not replace the type references for ASIS when inheriting a class-wide type invariant as this clobbers the existing replacement. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Build_Explicit_Dereference): If the designated expression is an entity name, generate reference to the entity because it will not be resolved again. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235238 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Olivier Hainque <hainque@adacore.com>charlet2016-04-191-3/+11
| | | | | | | | | | | | | | | | | | | | * sem_util.adb (Build_Elaboration_Entity): Always request an elab counter when preserving control-flow. 2016-04-19 Olivier Hainque <hainque@adacore.com> * sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set Needs_Debug_Info when producing SCOs. * par_sco.adb (Traverse_Aspects): Fix categorization of Type_Invariant to match actual processing as activated depending on pragma Assertion_Policy. * sem_prag.adb (Analyze_Pragma): Remove special case for Name_Invariant regarding SCO generation, which completely disabled the production of SCOs for Invariant pragmas and aspects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235202 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-191-15/+13
| | | | | | | | | | | | | | | | | | | | | | * checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor reformatting. 2016-04-19 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Profile): Refine predicate that checks whether a function that returns a limited view is declared in another unit and cannot be frozen at this point. 2016-04-19 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb (Component_Count): Handle properly superflat arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the return value of the function is Natural, rather than leaving the handling of such arrays to the caller of this function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235200 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Arnaud Charlet <charlet@adacore.com>charlet2016-04-191-0/+247
| | | | | | | | | | | | | | | | | * sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup. * sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context): Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name to publicly visible routine in Sem_Util. 2016-04-19 Ed Schonberg <schonberg@adacore.com> * checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply the check if the type of the actual is By_Reference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235199 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Ed Schonberg <schonberg@adacore.com>charlet2016-04-191-1/+1
| | | | | | | | | | | | | | | | | * sem_attr.adb (Resolve_Attribute, case 'Access): Freeze overloadable entity if originally overloaded. 2016-04-19 Arnaud Charlet <charlet@adacore.com> * exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb, exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb, sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code clean up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235194 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Arnaud Charlet <charlet@adacore.com>charlet2016-04-191-13/+4
| | | | | | | | | | | | | | | | | * sem_util.adb (Copy_Node_With_Replacement): use Set_Comes_From_Source instead of directly manipulating internals of the node table. * sem_util.adb (Within_Scope): refactored to remove duplicated code. * sem_aux.adb (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare variables that do not change as constants and initialize them in the declaration. (Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare variables that do not change as constants and initialize them in the declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235193 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-19 Ed Schonberg <schonberg@adacore.com>charlet2016-04-191-0/+23
| | | | | | | | | | | | | | | | | | | | * sem_res.adb (Resolve_Entry_Call): If the entry has preconditions it is rewritten by means of a wrapper that incorporates the original call. Before rewriting generate a reference to the entry being called to prevent spurious warnings and provide correct cross-reference information. 2016-04-19 Hristian Kirtchev <kirtchev@adacore.com> * sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add local constant Scop. Ignore any internally generated loops when performing the check concerning an abstract subprogram call without a controlling argument. * sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235192 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Arnaud Charlet <charlet@adacore.com>charlet2016-04-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * einfo.adb (Overridden_Operation): assert that function is called for valid arguments. * sem_aggr.adb, sem_ch3.adb, sem_ch5.adb, sem_type.adb, s-osinte-vxworks.ads, a-ngcefu.adb, sem_ch10.adb, einfo.ads, sem_prag.adb, sem_ch12.adb, sem.adb, i-cobol.ads, freeze.adb, sem_util.adb, a-chtgop.ads, s-rannum.adb, exp_ch6.adb, s-bignum.adb, s-osinte-freebsd.ads, par-ch5.adb, a-chtgbo.ads, a-cofove.adb: No space after closing parenthesis except where required for layout. * sem_res.adb: Minor reformatting. 2016-04-18 Arnaud Charlet <charlet@adacore.com> * exp_ch4.adb (Expand_N_Case_Expression): Convert into a case statement when relevant. 2016-04-18 Bob Duff <duff@adacore.com> * a-cuprqu.adb (Enqueue): Properly handle the case where the new element has a unique priority. 2016-04-18 Tristan Gingold <gingold@adacore.com> * adaint.h: Define stat structures and functions for iOS simulator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235146 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Yannick Moy <moy@adacore.com>charlet2016-04-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | * sem_util.adb (Apply_Compile_Time_Constraint_Error): Do not generate raise node in GNATprove mode. 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com> * s-fileio.adb: Minor reformatting. * sem_prag.adb (Analyze_Input_Item): Add local variable Input_OK. Do not consider mappings of generic formal parameters to actuals. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Get_Cursor_Type): If iterator type is a derived type, the cursor is declared in the scope of the parent type. (Analyze_Parameter_Specification): A qualified expression with an iterator type indicates an iteration over a container (explicit or implicit). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235139 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Arnaud Charlet <charlet@adacore.com>charlet2016-04-181-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * osint-c.ads, osint-c.adb (Delete_C_File, Delete_H_File): New. * gnat1drv.adb (Gnat1drv): Delete old C files before regenerating them. * debug.adb: Reserve -gnatd.4 to force generation of C files. 2016-04-18 Yannick Moy <moy@adacore.com> * sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static division by zero, instead possibly issue a warning. * sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on static division by zero, instead add check flag on original expression. * sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error): Only issue error when both SPARK_Mode is On and Warn is False. 2016-04-18 Yannick Moy <moy@adacore.com> * checks.adb (Apply_Scalar_Range_Check): Force warning instead of error when SPARK_Mode is On, on index out of bounds, and set check flag for GNATprove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235138 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Yannick Moy <moy@adacore.com>charlet2016-04-181-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): used outside of GNATprove, hence it should not be removed. 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Refinement_Clause): The refinement of an external abstract state can now mention non-external constituents. (Check_External_Property): Update all SPARK RM references. 2016-04-18 Bob Duff <duff@adacore.com> * exp_intr.adb: Remove some duplicated code. 2016-04-18 Yannick Moy <moy@adacore.com> * a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-nuflra.ads: Mark package spec and body out of SPARK. 2016-04-18 Johannes Kanig <kanig@adacore.com> * spark_xrefs.ads: Minor comment update. 2016-04-18 Johannes Kanig <kanig@adacore.com> * gnat1drv.adb (Gnat1drv): Force loading of System unit for SPARK. 2016-04-18 Bob Duff <duff@adacore.com> * a-cuprqu.adb: Correction to previous change. If a new node is inserted at the front of the queue (because it is higher priority than the previous front node), we need to update Header.Next_Unequal -- not just in the case where the queue was previously empty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235122 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Bob Duff <duff@adacore.com>charlet2016-04-181-104/+0
| | | | | | | | | | | | | | | | | | | | | | * a-cuprqu.ads: Change the representation of List_Type from a singly-linked list to a doubly-linked list. In addition, add a pointer Next_Unequal, which points past a possibly-long chain of equal-priority items. This increases efficiency, especially in the case of many equal-priority items. * a-cuprqu.adb (Dequeue, Enqueue): Rewrite algorithms to take advantage of new data structure. (Finalize): Rewrite in terms of Dequeue, for simplicity. 2016-04-18 Yannick Moy <moy@adacore.com> * contracts.adb (Analyze_Object_Contract, Analyze_Protected_Contract): Remove tests performed in GNATprove. * sem_util.adb, sem_util.ads (Has_Full_Default_Initialization): Remove query for tests performed in GNATprove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235121 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Hristian Kirtchev <kirtchev@adacore.com>charlet2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | * sem_res.adb (Is_Protected_Operation_Call): Add guards to account for a non-decorated selected component. 2016-04-18 Yannick Moy <moy@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Improve implementation of Body_Has_SPARK_Mode_On. * sem_prag.adb, sem_prag.ads (Get_SPARK_Mode_From_Annotation): New function replacing previous Get_SPARK_Mode_From_Pragma, that deals also with aspects. (Get_SPARK_Mode_Type): Make function internal again. * inline.adb, sem_ch7.adb, sem_util.adb: Use new Get_SPARK_Mode_From_Annotation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235116 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Ed Schonberg <schonberg@adacore.com>charlet2016-04-181-0/+17
| | | | | | | | | | | | | | | | | | | | * sem_ch6.adb (Analyze_Expression_Function): Set Inlined flag on the entity of a subprogram declaration that is completed by an expression function. 2016-04-18 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Is_Current_Instance): A entity given by a subtype declaration can appear in an aspect specification for a dynamic predicate, and a pragma for aspect Predicate_Failure. * exp_util.adb (Replace_Subtype_References): Replace current occurrences of the subtype to which a dynamic predicate applies, byt the expression that triggers a predicate check. Needed to implement new aspect Predicate_Failure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235107 138bc75d-0d04-0410-961f-82ee72b054a4
* 2016-04-18 Arnaud Charlet <charlet@adacore.com>charlet2016-04-181-14/+14
| | | | | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Process_Convention): Relax rule on exporting Intrinsic types if Relaxed_RM_Semantics is True. 2016-04-18 Vincent Celier <celier@adacore.com> * sem_ch3.adb, lib.ads, sinfo.ads, sem_ch10.adb, einfo.adb, einfo.ads, checks.ads, sem_ch12.adb, sem.adb, sem_util.adb, sem_util.ads, sem_res.adb, sem_attr.adb, par.adb, exp_ch4.adb, errout.ads, sem_ch4.adb, atree.adb, atree.ads, sem_warn.adb, treepr.adb, exp_ch3.ads, exp_unst.adb: Change "descendent" to "descendant" in comments, error messages and identifiers. 2016-04-18 Eric Botcazou <ebotcazou@adacore.com> * sem_type.adb (Operator_Matches_Spec): Call First_Formal on New_S only once at the beginning of the function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235100 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-25 Bob Duff <duff@adacore.com>charlet2015-11-251-18/+22
| | | | | | | | | | | | | | | | | | | * sem_elab.adb (Check_Internal_Call_Continue): Code clean ups. 2015-11-25 Eric Botcazou <ebotcazou@adacore.com> * sem_util.ads (Has_Compatible_Alignment): Add Layout_Done parameter. * sem_util.adb (Has_Compatible_Alignment): Likewise. (Has_Compatible_Alignment_Internal): Likewise. Do not set the result to Unknown for packed types if Layout_Done is true. * checks.adb (Apply_Address_Clause_Check): Adjust call and pass False to Has_Compatible_Alignment. * sem_ch13.adb (Validate_Address_Clauses): Likewise but pass True. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230877 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Nicolas Roche <roche@adacore.com>charlet2015-11-181-87/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sysdep.c (__gnat_localtime_tzoff): On Windows platform GetTimeZoneInformation function is thread-safe. Thus there is no need to lock the runtime in the implementation of __gnat_localtime_tzoff on that platform. 2015-11-18 Eric Botcazou <ebotcazou@adacore.com> * s-arit64.adb (To_Neg_Int): Add a special case for 2**63 input. 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com> * contracts.adb (Analyze_Contracts): New routine. (Analyze_Enclosing_Package_Body_Contract): Removed. (Analyze_Entry_Or_Subprogram_Contract): Add formal parameter Freeze_Id. Propagate the entity of the freezing body to vaious analysis routines. (Analyze_Initial_Declaration_Contract): Removed. (Analyze_Object_Contract): Add formal parameter Freeze_Id. Propagate the entity of the freezing body to vaious analysis routines. (Analyze_Previous_Contracts): New routine. * contracts.ads (Analyze_Enclosing_Package_Body_Contract): Removed. (Analyze_Contracts): New routine. (Analyze_Entry_Or_Subprogram_Contract): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Initial_Declaration_Contract): Removed. (Analyze_Object_Contract): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Previous_Contracts): New routine. * sem_ch3.adb (Analyze_Declarations): Use Analyze_Contracts to analyze all contracts of eligible constructs. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Subprogram_Body_Helper): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_ch7.adb (Analyze_Package_Body_Helper): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_ch9.adb (Analyze_Entry_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Protected_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. (Analyze_Task_Body): A body now freezes the contracts of all eligible constructs that precede it. A body no longer freezes the contract of its initial declaration. This effect is achieved through different means. * sem_prag.adb (Add_Item_To_Name_Buffer): Single protected/task objects now output their respective current instance of xxx type messages. (Analyze_Contract_Cases_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Part_Of_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Pre_Post_Condition_In_Decl_Part): Add formal parameter Freeze_Id. Emit a clarification message when an undefined entity may the byproduct of contract freezing. (Analyze_Refined_State_In_Decl_Part): Do not report unused body states as constituents of single protected/task types may not bave been identified yet. (Collect_Subprogram_Inputs_Outputs): Reimplemented. (Contract_Freeze_Error): New routine. (Process_Overloadable): Use predicate Is_Single_Task_Object. * sem_prag.ads (Analyze_Contract_Cases_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Part_Of_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. (Analyze_Pre_Post_Condition_In_Decl_Part): Add formal parameter Freeze_Id and update the comment on usage. * sem_util.adb (Check_Unused_Body_States): Remove global variable Legal_Constits. The routine now reports unused body states regardless of whether constituents are legal or not. (Collect_Body_States): A constituent of a single protected/task type is not a visible state of a package body. (Collect_Visible_States): A constituent of a single protected/task type is not a visible state of a package body. (Has_Undefined_Reference): New routine. (Is_Single_Concurrent_Object): Reimplemented. (Is_Single_Protected_Object): New routine. (Is_Single_Task_Object): New routine. (Is_Visible_Object): New routine. (Report_Unused_Body_States): Moved to Check_Unused_Body_States. * sem_util.ads (Check_Unused_Body_States): Update the comment on usage. (Has_Undefined_Reference): New routine. (Is_Single_Protected_Object): New routine. (Is_Single_Task_Object): New routine. (Report_Unused_Body_States): Moved to Check_Unused_Body_States. 2015-11-18 Pierre-Marie de Rodat <derodat@adacore.com> * Makefile.rtl, impunit.adb: Add g-strhas.ads. * g-strhas.ads: New file. * s-strhas.ads: Add a comment to redirect users to g-strhas.ads. 2015-11-18 Bob Duff <duff@adacore.com> * sem_elab.adb (Check_Internal_Call_Continue): Fix the case where the call in question is to a renaming of a subprogram that can be safely called without ABE. * checks.adb: Minor edits. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230546 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-11-181-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * atree.adb (Elist11): New routine. (Set_Elist11): New routine. * atree.ads (Elist11): New routine. (Set_Elist11): New routine. * atree.h: Define Elist11. * contracts.adb (Analyze_Object_Contract): Verify the legality of all references to a variable given that the variable is a constituent of a single protected/task type. * einfo.adb: Part_Of_References now utilizes Elist11. (Part_Of_References): New routine. (Set_Part_Of_References): New routine. (Write_Field11_Name): Add output for Part_Of_References. * einfo.ads New attribute Part_Of_References along with usage in entities. (Part_Of_References): New routine along with pragma Inline. (Set_Part_Of_References): New routine along with pragma Inline. * sem_prag.adb (Analyze_Constituent): Record a possible reference to a concurrent constituent. (Analyze_Global_Item): Record a possible reference to a concurrent constituent. (Analyze_Input_Output): Record a possible reference to a concurrent constituent. * sem_res.adb (Resolve_Entity_Name): Record a possible reference to a concurrent constituent. * sem_util.adb (Check_Part_Of_Reference): New routine. (Record_Possible_Part_Of_Reference): New routine. * sem_util.ads (Check_Part_Of_Reference): New routine. (Record_Possible_Part_Of_Reference): New routine. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * checks.adb (Apply_Arithmetic_Overflow_Minimized_Eliminated): An if_expression is the proper place to apply the overflow minimization procedure if its context is not an enclosing arithmetic expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230540 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-11-181-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * einfo.adb (Has_Non_Null_Refinement): Rename to Has_Non_Null_Visible_Refinement. (Has_Null_Refinement): Rename to Has_Null_Visible_Refinement. * einfo.ads Update the documentation of attribute Has_Non_Null_Refinement and attribute Has_Null_Refinement. (Has_Non_Null_Refinement): Rename to Has_Non_Null_Visible_Refinement and update occurrences in entities. (Has_Null_Refinement): Rename to Has_Null_Visible_Refinement and update occurrences in entities. * sem_prag.adb (Check_In_Out_States): Update the calls to Has_[Non_]Null_Refinement. (Check_Input_States): Update the calls to Has_[Non_]Null_Refinement. (Check_Output_States): Update the calls to Has_[Non_]Null_Refinement. (Check_Proof_In_States): Update the calls to Has_[Non_]Null_Refinement. (Collect_Global_Item): Update the calls to Has_[Non_]Null_Refinement. (Is_Null_Refined_State): Update the calls to Has_[Non_]Null_Refinement. (Match_Item): Update the calls to Has_[Non_]Null_Refinement. * sem_util.adb (Has_Non_Null_Refinement): New routine. (Has_Null_Refinement): New routine. * sem_util.ads (Has_Non_Null_Refinement): New routine. (Has_Null_Refinement): New routine. 2015-11-18 Gary Dismukes <dismukes@adacore.com> * exp_util.adb: Minor reformatting and typo fixes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230525 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-11-181-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_util.adb (Has_Full_Default_Initialization): Perform the test for the presence of pragma Default_Initial_Condition prior to the specialized type checks. Add a missing case where the lack of a pragma argument yields full default initialization. 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Resolve_Entity_Name): Do not check for elaboration issues when a variable appears as the name of an object renaming declaration as this constitutes an aliasing, not a read. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * checks.adb (Overlap_Check): An actual that is an aggregate cannot overlap with another actual, and no check should be generated for it. * targparm.ads: Fix typos. 2015-11-18 Pascal Obry <obry@adacore.com> * adaint.c: Routine __gnat_killprocesstree only implemented on Linux and Windows. 2015-11-18 Pascal Obry <obry@adacore.com> * g-ctrl_c.adb: Minor style fixes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230523 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Pascal Obry <obry@adacore.com>charlet2015-11-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | * adaint.c, s-os_lib.adb, s-os_lib.ads (Kill_Process_Tree): New. 2015-11-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (Check_Nonvolatile_Function_Profile): Place the error message concerning the return type on the result definition. (Is_Volatile_Function): A function with a parameter of a protected type is a protected function if it is defined within a protected definition. 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Container_Indexing): When building the parameter list for the function call on indexing functions, preserve overloading of the parameters, which may themselves be generalized indexing operations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230522 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-13 Eric Botcazou <ebotcazou@adacore.com>charlet2015-11-131-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sigtramp-ios.c, init.c: Minor cosmetic tweaks. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * s-gloloc.adb, g-debpoo.adb: Minor reformatting. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Specification): Improve error message for the case the iterable name (array or container) is a component that depends on a discriminant. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Indicate_Name_And_Type): If the analysis of one interpretation succeeds, set type of name in call, for completeness. (Try_Container_Indexing): If there are multiple indexing functions, collect possible interpretations that are compatible with given parameters, and add implicit dereference types when present. * sem_util.adb (Build_Explicit_Dereference): If the expression is an overloaded function call use the given discriminant to resolve the call, and set properly the type of the call and of the resulting dereference. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Pragma Constant_After_Elaboration can now apply to a variable without an initialization expression. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch9.adb (Add_Matching_Formals): Parameter Actuals is now of mode IN OUT. Create a new list when list Actuals is not present. (Build_Contract_Wrapper): Create the wrapper only when the entry has at least on checked contract case or pre/postcondition. Ensure that the call to the original entry lacks an actual parameter list when the entry appears without formal parameters. (Expand_Entry_Declaration): Code cleanup. 2015-11-13 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Continue the analysis after encountering an illegal aspect Part_Of. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference, case Overlaps_Storage): Add copies for nodes that represent the integer addresses of the two actuals, to prevent identical nodes in the tree, which the backend cannot handle properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230316 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-13 Eric Botcazou <ebotcazou@adacore.com>charlet2015-11-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * init.c [Darwin/arm64]: Move __gnat_sigtramp implementation to... (__gnat_map_signal): New function. (__gnat_error_handler): Adjust the context and call above function. * sigtramp-armios.c: ...here. New file. 2015-11-13 Arnaud Charlet <charlet@adacore.com> * bcheck.adb (Check_Consistent_Restrictions): Do not check consistency of No_Dependence for runtime units. 2015-11-13 Tristan Gingold <gingold@adacore.com> * s-rident.ads (Restriction_Id): Add Pure_Barriers. * restrict.ads (Implementation_Restriction): Add Pure_Barriers. * exp_ch9.adb (Expand_Entry_Barrier): Create Is_Simple_Barrier_Name function, add Is_Pure_Barrier and Check_Pure_Barriers. 2015-11-13 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Get_Cursor_Type): To determine whether a function First is the proper Iterable primitive, use the base type of the first formal rather than the type. This is needed in the unusual case where the Iterable aspect is specified for an integer type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230305 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-12 Bob Duff <duff@adacore.com>charlet2015-11-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * impunit.adb, lib-xref.ads, restrict.ads, scos.ads, sem_attr.ads, types.ads: Get rid of some global variables. * output.adb, output.ads: Move some global variables to the body. 2015-11-12 Yannick Moy <moy@adacore.com> * lib-xref-spark_specific.adb (Is_Constant_Object_Without_Variable_Input): Add special case for imported constants. 2015-11-12 Philippe Gil <gil@adacore.com> * g-debpoo.adb (Allocate): Avoid having allocations not handled. 2015-11-12 Ed Schonberg <schonberg@adacore.com> * checks.adb (Apply_Scalar_Range_Check): If the expression is a real literal and the context type has static bounds, remove range check when possible. 2015-11-12 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Collect_Primitive_Operations): If the type is derived from a type declared elsewhere that has an incomplete type declaration, the primitives are found in the scope of the type nat that of its ancestor. 2015-11-12 Arnaud Charlet <charlet@adacore.com> * switch-c.adb, debug.adb, osint-c.adb, gnat1drv.adb: Remove -gnatd.V debug switch. * exp_aggr.adb, exp_util.adb: Fix typos. 2015-11-12 Jerome Lambourg <lambourg@adacore.com> * init.c: Properly adjust PC values in case of signals. 2015-11-12 Bob Duff <duff@adacore.com> * sem_prag.adb (Check_Arg_Is_Library_Level_Local_Name): A pragma that comes from an aspect does not "come from source", so we need to test whether it comes from an aspect. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230253 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-12 Gary Dismukes <dismukes@adacore.com>charlet2015-11-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_ch5.adb, sem_ch3.adb, exp_util.ads, inline.adb, freeze.adb, sem_util.adb, sem_util.ads, par-ch6.adb, sem_elab.adb: Minor reformatting and a typo fix. 2015-11-12 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Preanalyze_Actuals): Add guard on use of Incomplete_Actuals, which are only stored for a package instantiation, in order to place the instance in the body of the enclosing unit. 2015-11-12 Ed Schonberg <schonberg@adacore.com> * exp_intr.adb: Add legality checks on calls to a Generic_Dispatching_Constructor: the given tag must be defined, it cannot be the tag of an abstract type, and its accessibility level must not be greater than that of the constructor. 2015-11-12 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Container_Indexing, Constant_Indexing_OK): If the context is an overloaded call, assume that Constant_Indexing is not OK if an interpretation has an assignable parameter corresponding to the indexing expression. 2015-11-12 Jerome Lambourg <lambourg@adacore.com> * init.c (__gnat_error_handler): Force the SPE bit of the MSR when executing on e500v2 CPU. 2015-11-12 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Constituent): Stop the analysis after detecting a misplaced constituent as this is a critical error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230239 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-12 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-11-121-1/+39
| | | | | | | | | | | | | | | | | | * sem_ch10.adb, atree.adb: Minor reformatting. 2015-11-12 Hristian Kirtchev <kirtchev@adacore.com> * sem_elab.adb (Check_A_Call): Add new variable Is_DIC_Proc. Report elaboration issue in SPARK concerning calls to source subprograms or nontrivial Default_Initial_Condition procedures. Add specialized error message to avoid outputting the internal name of the Default_Initial_Condition procedure. * sem_util.ads, sem_util.adb (Is_Non_Trivial_Default_Init_Cond_Procedure): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230237 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-12 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-11-121-0/+1
| | | | | | | | | * exp_attr.adb, freeze.adb, sem_util.adb, sem_ch13.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230235 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-12 Eric Botcazou <ebotcazou@adacore.com>charlet2015-11-121-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | * einfo.ads (Overlays_Constant): Document usage for E_Constant. * freeze.adb (Warn_Overlay): Small reformatting. (Check_Address_Clause): Deal specifically with deferred constants. For a variable or a non-imported constant overlaying a constant object and with initialization value, either remove the initialization or issue a warning. Fix a couple of typos. * sem_util.adb (Note_Possible_Modification): Overhaul the condition for the warning on modified constants and use Find_Overlaid_Entity instead of doing it manually. * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Compute and set Overlays_Constant once on entry. Do not treat the overlaid entity as volatile. Do not issue the warning on modified constants here. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Remove over-restrictive condition for the special treatment of deferred constants. <E_Variable>: Remove obsolete associated code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230229 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-27 Javier Miranda <miranda@adacore.com>charlet2015-10-271-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_util.ads, sem_util.adb (Defining_Identifier): Adding a formal to indicate the needed behavior in case of nodes with errors. 2015-10-27 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Eval_Attribute): If the prefix of attribute Enum_Rep is an object that is a generated loop variable for an element iterator, no folding is possible. * sem_res.adb (Resolve_Entity_Name): Do not check for a missing initialization in the case of a constant that is an object renaming. * exp_attr.adb (Expand_N_Attribute_Reference, case Enum_Rep): If the prefix is a constant that renames an expression there is nothing to evaluate statically. 2015-10-27 Vincent Celier <celier@adacore.com> * gnatlink.adb: Always delete the response file, even when the invocation of gcc to link failed. 2015-10-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not inherit the SPARK_Mode from the context if it has been set already. (Build_Subprogram_Declaration): Relocate relevant pragmas from the subprogram body to the generated corresponding spec. Do not copy aspect SPARK_Mode as this leads to circularity in Copy_Separate_Tree. Inherit the attributes that describe pragmas Ghost and SPARK_Mode. (Move_Pragmas): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229421 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-27 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-271-16/+35
| | | | | | | | | | | | | | | * inline.adb (Is_Expression_Function): Removed. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): An internally generated subprogram body that completes an expression function inherits the SPARK_Mode from the spec. * sem_res.adb (Resolve_Call): Update all calls to Is_Expression_Function. * sem_util.ads, sem_util.adb (Is_Expression_Function): Reimplemented. (Is_Expression_Function_Or_Completion): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229420 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * contracts.adb (Analyze_Object_Contract): Set and restore the SPARK_Mode for both constants and objects. Factor out the semantic checks concerning Ghost objects. * freeze.adb (Freeze_Array_Type): A Ghost array type cannot have a concurrent component type. (Freeze_Entity): A Ghost type cannot also be concurrent. (Freeze_Record_Type): A Ghost record type cannot have a concurrent component. * sem_prag.adb (Analyze_Abstract_State): A Ghost abstract state cannot also be synchronized. (Check_Ghost_Synchronous): New routine. * sem_util.adb (Yields_Synchronized_Object): Correct the case of record components to account for the case where the type has no component list. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * expander.adb (Expand): Expand a single protected declaration. * exp_ch9.ads, exp_ch9.adb (Expand_N_Single_Protected_Declaration): New routine. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Is_OK_Volatile_Context): A volatile object may appear in an object declaration as long as it denotes the name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229376 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | * sem_ch9.adb (Analyze_Single_Protected_Declaration): The anonymous object no longer comes from source. (Analyze_Single_Task_Declaration): The anonymous object no longer comes from source. * sem_prag.adb (Analyze_Pragma): The analysis of pragma SPARK_Mode now recognizes the internal anonymous object created for a single concurren type as a valid context. (Find_Related_Context): The internal anonymous object created for a single concurrent type is now a valid context. (Find_Related_Declaration_Or_Body): The internal anonymous object created for a single concurrent type is now a valid context. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Inherit_Rep_Item_Chain): Another another guard to prevent circularities in the rep_item_chain of the full view of a type extension in a child unit that extends a private type from the parent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229374 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * atree.ads, atree.adb (Ekind_In): New 10 and 11 parameter versions. * contracts.ads, contracts.adb (Analyze_Initial_Declaration_Contract): New routine. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Analyze the contract of the initial declaration. (Analyze_Subprogram_Body_Helper): Analyze the contract of the initial declaration. * sem_ch7.adb (Analyze_Package_Body_Helper): Analyze the contract of the initial declaration. * sem_ch9.adb (Analyze_Entry_Body): Analyze the contract of the initial declaration. (Analyze_Protected_Body): Analyze the contract of the initial declaration. (Analyze_Task_Body): Analyze the contract of the initial declaration. * sem_prag.adb (Add_Entity_To_Name_Buffer): Use "type" rather than "unit" as it makes the error messages sound better. (Add_Item_To_Name_Buffer): Update comment on usage. The routine now supports discriminants and current instances of concurrent types. (Analyze_Depends_In_Decl_Part): Install the discriminants of a task type. (Analyze_Global_In_Decl_Part): Install the discriminants of a task type. (Analyze_Global_Item): Add processing for current instances of concurrent types and include discriminants as valid global items. (Analyze_Input_Output): Discriminants and current instances of concurrent types are now valid items. Update various error messages. (Check_Usage): Current instances of protected and task types behaves as formal parameters. (Collect_Subprogram_Inputs_Outputs): There is no longer need to manually analyze [Refined_]Global thanks to freezing of initial declaration contracts. Add processing for the current instance of a concurrent type. (Find_Role): Add categorizations for discriminants, protected and task types. (Is_CCT_Instance): New routine. (Match_Items): Update the comment on usage. Update internal comments. * sem_prag.ads (Collect_Subprogram_Inputs_Outputs): Update the comment on usage. * sem_util.adb (Entity_Of): Ensure that the entity is an object when traversing a potential renaming chain. (Fix_Msg): Use "type" rather than "unit" as it makes the error messages sound better. * sem_util.ads (Fix_Msg): Update the comment on usage. 2015-10-26 Arnaud Charlet <charlet@adacore.com> * par.adb (Par): Do not generate an error when generating SCIL for predefined units or new children of system and co. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * einfo.adb: Access_Disp_Table applies to a private extension. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229373 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-2/+2
| | | | | | | | | | | | | | | | * exp_util.adb, sem_aux.adb, exp_attr.adb, sem_eval.adb: Minor reformatting. * sem_util.adb, sem_ch5.adb: Minor reformatting. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * exp_unst.adb (Unnest_Subprogram): Add guard to prevent compiler abort when handling a reference to a formal in an aspect of a nested subprogram declaration as an uplevel reference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229359 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Bob Duff <duff@adacore.com>charlet2015-10-261-107/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229357 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-14/+22
| | | | | | | | * sem_ch3.adb, sem_util.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229354 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Bob Duff <duff@adacore.com>charlet2015-10-261-0/+71
| | | | | | | | | | | | | | | | * s-rident.ads (No_Dynamic_Sized_Objects): New restriction name. * sem_util.ads, sem_util.adb (All_Composite_Constraints_Static): New function to check that all relevant constraints are static. * sem_aggr.adb (Resolve_Array_Aggregate): Call All_Composite_Constraints_Static on the bounds of named array aggregates. * sem_ch3.adb (Analyze_Subtype_Declaration): Call All_Composite_Constraints_Static if the type is composite and the subtype is constrained. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229351 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Bob Duff <duff@adacore.com>charlet2015-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * s-fileio.adb (Fopen_Mode): Use "r+" for Out_File/Stream_IO, so the file won't be truncated on 'fopen', as required by AI95-00283-1. 2015-10-26 Bob Duff <duff@adacore.com> * gnat1drv.adb, prj.adb, sem_ch6.adb, s-regpat.adb, sem_prag.adb: Fix typos. * einfo.ads, restrict.ads: Minor comment fixes. * err_vars.ads, sem_util.adb, errout.ads: Code clean up. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): Do not check that the Left-hand side is legal in an inlined body, check is done on the original template. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * exp_util.ads, exp_util.adb (Find_Primitive_Operations): New subprogram to retrieve by name the possibly overloaded set of primitive operations of a type. * sem_ch4.adb (Try_Container_Indexing): Use Find_Primitive_Operations to handle overloaded indexing operations of a derived type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229343 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Yannick Moy <moy@adacore.com>charlet2015-10-261-5/+13
| | | | | | | | | | | | | | | | | | | * lib-xref-spark_specific.adb (Add_SPARK_Xrefs): Use character 'r' to denote a reference to a constant which may have variable input, and thus may be treated as a variable in GNATprove, instead of the character 'c' used for constants. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Object_Access_Level): Only aliased formals of functions have the accessibility level of the point of call; aliased formals of procedures have the same level as unaliased formals. (New_Copy_Tree): Add guard on copying itypes. From code reading. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229337 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-31/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * inline.adb: Minor reformatting. 2015-10-26 Yannick Moy <moy@adacore.com> * get_spark_xrefs.adb (get_SPARK_Xrefs): Remove obsolete assertion. * lib-xref-spark_specific.adb (Traverse_Declaration_Or_Statement): New procedure to factor duplicated code and add treatment of protected entries. (Add_SPARK_Scope, Traverse_Declarations_Or_Statements): Call the new procedure Traverse_Declaration_Or_Statement. Use same character used in normal xrefs for SPARK xrefs, for a given entity used as scope. * spark_xrefs.ads Document character used for entries. * sem_prag.adb (Check_Loop_Pragma_Placement): Account for possible introduction of declarations and statements by the expansion, between two otherwise consecutive loop pragmas. * sem_util.ads, sem_util.adb (Is_Suspension_Object): Lifted from nested function. (Is_Descendant_Of_Suspension_Object): nested function lifted. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Eval_Attribute): Attribute 'Enum_Rep can be folded when its prefix denotes a constant, an enumeration literal or an enumeration type. Use the expression of the attribute in the enumeration type form, otherwise use the prefix to fold. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229334 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * aspects.adb Add an entry for entry bodies in table Has_Aspect_Specifications_Flag. (Aspects_On_Body_Or_Stub_OK): Entry bodies now allow for certain aspects. * contracts.adb (Add_Contract_Items): Code cleanup. Add processing for entry bodies, entry declarations and task units. (Analyze_Subprogram_Body_Contract): Renamed to Analyze_Entry_Or_Subprogram_Body_Contract. Do not analyze the contract of an entry body unless annotating the original tree. (Analyze_Subprogram_Contract): Renamed to Analyze_Entry_Or_Subprogram_Contract. Do not analyze the contract of an entry declaration unless annotating the original tree. (Analyze_Task_Contract): New routine. * contracts.ads (Add_Contract_Item): Update the comment on usage. (Analyze_Package_Body_Contract): Update comment on usage. (Analyze_Package_Contract): Update the comment on usage. (Analyze_Subprogram_Body_Contract): Renamed to Analyze_Entry_Or_Subprogram_Body_Contract. (Analyze_Subprogram_Body_Stub_Contract): Update the comment on usage. (Analyze_Subprogram_Contract): Renamed to Analyze_Entry_Or_Subprogram_Contract. (Analyze_Task_Contract): New routine. * einfo.adb (Contract): Restructure the assertion to include entries and task units. (SPARK_Pragma): This attribute now applies to operators. (SPARK_Pragma_Inherited): This flag now applies to operators. (Set_Contract): Restructure the assertion to include entries and task units. (Set_SPARK_Pragma): This attribute now applies to operators. (Set_SPARK_Pragma_Inherited): This flag now applies to operators. (Write_Field34_Name): Write out all Ekinds that have a contract. (Write_Field40_Name): SPARK_Pragma now applies to operators. * einfo.ads: Update the documentation of attribute Contract along with usage in nodes. Update the documentation of attributes SPARK_Pragma and SPARK_Pragma_Inherited. * exp_ch6.adb (Freeze_Subprogram): Update the call to Analyze_Subprogram_Contract. * par-ch9.adb (P_Entry_Barrier): Do not parse keyword "is" as it is not part of the entry barrier production. (P_Entry_Body): Parse the optional aspect specifications. Diagnose misplaced aspects. * sem_attr.adb (Analyze_Attribute_Old_Result): Update the call to Find_Related_Subprogram_Or_Body. * sem_aux.adb (Unit_Declaration_Node) Add an entry for entry declarations and bodies. * sem_ch3.adb (Analyze_Declarations): Analyze the contracts of entry declarations, entry bodies and task units. * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Update the call to Analyze_Subprogram_Body_Contract. (Analyze_Subprogram_Body_Helper): Update the call to Analyze_Subprogram_Body_Contract. * sem_ch9.adb (Analyze_Entry_Body): Analyze the aspect specifications and the contract. * sem_ch10.adb (Analyze_Compilation_Unit): Update the call to Analyze_Subprogram_Contract. * sem_ch12.adb (Save_References_In_Pragma): Update the call to Find_Related_Subprogram_Or_Body. * sem_ch13.adb (Analyze_Aspects_On_Body_Or_Stub): Use Unique_Defining_Entity rather than rummaging around in nodes. (Diagnose_Misplaced_Aspects): Update comment on usage. Update the error messages to accomondate the increasing number of contexts. * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. (Analyze_Depends_Global): Update the call to Find_Related_Subprogram_Or_Body. Add processing for entry declarations. (Analyze_Depends_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. Task units have no formal parameters to install. (Analyze_Global_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. Task units have no formal parameters to install. (Analyze_Global_Item): Use Fix_Msg to handle the increasing number of contexts. (Analyze_Pragma): Update the call to Find_Related_Subprogram_Or_Body. Perform full analysis when various pragmas appear in an entry body. (Analyze_Pre_Post_Condition): Update the call to Find_Related_Subprogram_Or_Body. Perform full analysis when the pragma appears in an entry body. (Analyze_Pre_Post_Condition_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. (Analyze_Refined_Depends_Global_Post): Update the call to Find_Related_Subprogram_Or_Body. Use Fix_Msg to handle the increasing number of contexts. (Analyze_Refined_Depends_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. Use Unique_Defining_Entity to obtain the entity of the spec. Use Fix_Msg to handle the increasing number of contexts. (Analyze_Refined_Global_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. Use Unique_Defining_Entity to obtain the entity of the spec. Use Fix_Msg to handle the increasing number of contexts. (Analyze_Test_Case_In_Decl_Part): Update the call to Find_Related_Subprogram_Or_Body. (Check_Dependency_Clause): Use Fix_Msg to handle the increasing number of contexts. (Check_Mode_Restriction_In_Enclosing_Context): Use Fix_Msg to handle the increasing number of contexts. (Collect_Subprogram_Inputs_Outputs): Use the refined versions of the pragmas when the context is an entry body or a task body. (Find_Related_Subprogram_Or_Body): Renamed to Find_Related_Declaration_Or_Body. Add processing for entries and task units. (Fix_Msg): New routine. (Role_Error): Use Fix_Msg to handle the increasing number of contexts. * sem_prag.ads (Find_Related_Subprogram_Or_Body): Renamed to Find_Related_Declaration_Or_Body. Update the comment on usage. * sem_util.adb (Is_Entry_Body): New routine. (Is_Entry_Declaration): New routine. * sem_util.ads (Is_Entry_Body): New routine. (Is_Entry_Declaration): New routine. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * inline.adb (Has_Excluded_Declaration): A subtype declaration with a predicate aspect generates a subprogram, and therefore prevents the inlining of the enclosing subprogram. * osint.ads: Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229333 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * sem_util.adb (Is_Suspension_Object): Ensure that the scope of "Ada" is Standard_Standard. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Is_OK_Volatile_Context): A subprogram call is an OK context for a reference to an effectively volatile object. (Resolve_Actuals): Add references to SPARK RM. (Within_Procedure_Call): Removed. (Within_Subprogram_Call): New routine. 2015-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Check_Aggregate_Accessibility): A reference to a formal parameter in an aggregate does not need an accesibility check only if the formal is aliased. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229329 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-26 Claire Dross <dross@adacore.com>charlet2015-10-261-59/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_aux.ads (Number_Components): Can return 0 when called on an empty record. 2015-10-26 Hristian Kirtchev <kirtchev@adacore.com> * contracts.adb (Analyze_Subprogram_Body_Contract): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. * einfo.adb SPARK_Pragma and SPARK_Aux_Pragma are now Node40 and Node41 respectively. (SPARK_Aux_Pragma): Update the assertion and node querry. (SPARK_Aux_Pragma_Inherited): Update the assertion and node query. (SPARK_Pragma): Update the assertion and node query. (SPARK_Pragma_Inherited): Update the assertion and node query. (Set_SPARK_Aux_Pragma): Update the assertion and node setting. (Set_SPARK_Aux_Pragma_Inherited): Update the assertion and node setting. (Set_SPARK_Pragma): Update the assertion and node setting. (Set_SPARK_Pragma_Inherited): Update the assertion and node setting. (Write_Field32_Name): Remove the output for SPARK_Pragma. (Write_Field33_Name): Remove the output for SPARK_Aux_Pragma. (Write_Field40_Name): Add output for SPARK_Pragma. (Write_Field41_Name): Add output for SPARK_Aux_Pragma. * einfo.ads Rewrite the documentation on attributes SPARK_Pragma, SPARK_Aux_Pragma, SPARK_Pragma_Inherited and SPARK_Aux_Pragma_Inherited. Update their uses in nodes. * exp_ch4.adb (Create_Anonymous_Master): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. * exp_ch9.adb (Expand_Entry_Declaration): Mark the barrier function as such. (Expand_N_Task_Body): Mark the task body as such. (Expand_N_Task_Type_Declaration): Mark the task body as such. * exp_unst.adb (Visit_Node): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. * sem_attr.adb (Analyze_Attribute_Old_Result): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Entry barrier functions do not inherit the SPARK_Mode from the context. (Build_Subprogram_Declaration): The matching spec is now marked as a source construct to mimic the original stand alone body. * sem_ch7.adb (Analyze_Package_Body_Helper): Code cleanup. * sem_ch9.adb Add with and use clauses for Contracts. (Analyze_Entry_Body): An entry body freezes the contract of the nearest enclosing package body. The entry body now inherits the SPARK_Mode from the context. (Analyze_Entry_Declaration): A protected entry declaration now inherits the SPARK_Mode from the context. (Analyze_Protected_Body): A protected body freezes the contract of the nearest enclosing package body. Set the Etype of a protected body as this is neede for proper aspect analysis. Protected bodies can now carry meaningful aspects and those are now analyzed. (Analyze_Protected_Type_Declaration): A protected type now inherits the SPARK_Mode from the context. (Analyze_Task_Body): A task body freezes the contract of the nearest enclosing package body. Set the Etype of a task body as this is needed for proper aspect analysis. A task body now inherits the SPARK_Mode from the context. Task bodies can now carry meaningful aspects and those are now analyzed. (Analyze_Task_Type_Declaration): A task type declaration now inherits the SPARK_Mode of from the context. * sem_ch10.adb (Analyze_Protected_Body_Stub): Protected body stubs can now carry meaningful aspects. (Analyze_Task_Body_Stub): Task body stubs can now carry meaningful aspects. * sem_ch13.adb (Analyze_Aspect_Specifications): Aspects SPARK_Mode Warnings now use routine Insert_Pragma as means of insertion into the tree. (Insert_After_SPARK_Mode): Clean up documentation. (Insert_Pragma): Clean up documentation. The routine is now capable of operating on synchronized units. * sem_prag.adb (Add_Entity_To_Name_Buffer): New routine. (Analyze_Contract_Cases_In_Decl_Part): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Analyze_Depends_Global): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Analyze_Depends_In_Decl_Part): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Analyze_Global_In_Decl_Part): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Analyze_Pragma): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. Update the detection of an illegal pragma Ghost when it applies to a task or protected unit. Reimplement the handling of pragma SPARK_Mode. (Analyze_Pre_Post_Condition_In_Decl_Part): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Analyze_Test_Case_In_Decl_Part): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Check_Library_Level_Entity): Update the comment on usage. Reimplemented to offer a more specialized errror context. (Check_Pragma_Conformance): Update profile and comment on usage. Handle error message output on single protected or task units. (Collect_Subprogram_Inputs_Outputs): Use Unique_Defining_Entity instead of Corresponding_Spec_Of. (Process_Body): New routine. (Process_Overloadable): New routine. (Process_Private_Part): New routine. (Process_Statement_Part): New routine. (Process_Visible_Part): New routine. (Set_SPARK_Context): New routine. (Set_SPARK_Flags): Removed. * sem_util.adb (Corresponding_Spec_Of): Removed. (Unique_Entity): Reimplemented to handle many more cases. * sem_util.ads (Corresponding_Spec_Of): Removed. (Unique_Defining_Entity): Update the comment on usage. * sinfo.ads (Is_Entry_Barrier_Function): Update the assertion. (Is_Task_Body_Procedure): New routine. (Set_Is_Entry_Barrier_Function): Update the assertion. (Set_Is_Task_Body_Procedure): New routine. * sinfo.adb Update the documentation of attribute Is_Entry_Barrier_Function along with use in nodes. Add new attribute Is_Task_Body_Procedure along with use in nodes. (Is_Task_Body_Procedure): New routine along with pragma Inline. (Set_Is_Task_Body_Procedure): New routine along with pragma Inline. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229328 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>charlet2015-10-231-392/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * contracts.ads, contracts.adb: New unit. * exp_ch6.adb Add with and use clauses for Contracts. (Expand_Subprogram_Contract): Moved to Contracts. * exp_ch6.ads (Expand_Subprogram_Contract): Moved to Contracts. * sem_ch3.adb Add with and use clauses for Contracts. (Analyze_Object_Contract): Moved to Contracts. (Analyze_Declarations): Remove local variable Pack_Decl. Do not capture global references in contracts. Check the hidden states of a package body. * sem_ch6.adb Add with and use clauses in Contracts. (Analyze_Generic_Subprogram_Body): Do not capture global references in contracts. (Analyze_Subprogram_Body_Contract): Moved to Contracts. (Analyze_Subprogram_Body_Helper): Freeze the contract of the nearest enclosing package body. Always analyze the subprogram body contract. Do not expand the subprogram body contract. (Analyze_Subprogram_Contract): Moved to Contracts. * sem_ch6.ads (Analyze_Subprogram_Body_Contract): Moved to Contracts. (Analyze_Subprogram_Contract): Moved to Contracts. * sem_ch7.adb Add with and use clauses for Contracts. (Analyze_Package_Body_Contract): Moved to Contracts. (Analyze_Package_Body_Helper): Freeze the contract of the nearest enclosing package body. (Analyze_Package_Contract): Moved to Contracts. * sem_ch7.ads (Analyze_Package_Body_Contract): Moved to Contracts. (Analyze_Package_Contract): Moved to Contracts. * sem_ch10.adb Add with and use clauses for Contracts. (Analyze_Compilation_Unit): Do not capture global references in contracts. (Analyze_Subprogram_Body_Stub_Contract): Moved to Contracts. * sem_ch10.ads (Analyze_Subprogram_Body_Stub_Contract): Moved to Contracts. * sem_ch12.adb Add with and use clauses for Contracts. (Analyze_Subprogram_Instantiation): Update the call to Instantiate_Subprogram_Contract. (Instantiate_Package_Body): Do not copy the entity of the spec when creating an entity for the body. Construct a brand new defining identifier for the body and inherit the Comes_From_Source flag from the spec. (Instantiate_Subprogram_Body): Remove Anon_Id to Act_Decl_Id and update all occurrences. Construct a brand new defining identifier for the body and inherit the Comes_From_Source flag from the spec. (Instantiate_Subprogram_Contract): Moved to Contracts. (Save_Global_References_In_Aspects): Moved to the spec of Sem_Ch12. (Save_Global_References_In_Contract): Moved to Contracts. * sem_ch12.ads (Save_Global_References_In_Aspects): Moved from the body of Sem_Ch12. (Save_Global_References_In_Contract): Moved to Contracts. * sem_prag.adb Add with and use clauses for Contracts. (Add_Item): Removed. All references to this routine have been replaced with calls to Append_New_Elmt. (Analyze_Constituent): Add special diagnostics for errors caused by freezing of contracts. (Analyze_Refined_State_In_Decl_Part): Add formal parameter Freeze_Id. Add new global variable Freeze_Posted. (Collect_Body_States): Removed. (Report_Unused_States): Removed. * sem_prag.ads (Analyze_Defined_State_In_Decl_Part): Add formal parameter Freeze_Id and update comment on usage. * sem_util.adb Remove with and use clauses for Sem_Ch12. (Add_Contract_Item): Moved to Contracts. (Check_Unused_Body_States): New routine. (Collect_Body_States): New routine. (Create_Generic_Contract): Moved to Contracts. (Inherit_Subprogram_Contract): Moved to Contracts. (Report_Unused_Body_States): New routine. * sem_util.ads (Add_Contract_Item): Moved to Contracts. (Check_Unused_Body_States): New routine. (Collect_Body_States): New routine. (Create_Generic_Contract): Moved to Contracts. (Inherit_Subprogram_Contract): Moved to Contracts. (Report_Unused_Body_States): New routine. * sinfo.adb (Is_Expanded_Contract): New routine. (Set_Is_Expanded_Contract): New routine. * sinfo.ads New attribute Is_Expanded_Contract along with placement in nodes. (Is_Expanded_Contract): New routine along with pragma Inline. (Set_Is_Expanded_Contract): New routine along with pragma Inline. * gcc-interface/Make-lang.in: Add entry for contracts.o 2015-10-23 Bob Duff <duff@adacore.com> * bindgen.adb, init.c, opt.ads, switch-b.adb: Implement new -Ea and -Es switches. * switch-b.ads: Minor comment fix. * bindusg.adb: Document new -Ea and -Es switches. * s-exctra.ads: Use -Es instead of -E. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229253 138bc75d-0d04-0410-961f-82ee72b054a4