summaryrefslogtreecommitdiffstats
path: root/gcc/ada
Commit message (Collapse)AuthorAgeFilesLines
...
* 2014-02-19 Gary Dismukes <dismukes@adacore.com>charlet2014-02-195-6/+18
| | | | | | | | | | | | | | * gnat_rm.texi: Minor spelling fixes. 2014-02-19 Doug Rupp <rupp@adacore.com> * init.c: Remove unneeded code. * fe.h (Float_Format): New macro * gcc-interface/trans.c (gigi): On VMS, set vms_float_format. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207887 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-02-194-3/+69
| | | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Check_Refined_Global_Item): A state or variable acts as a constituent only it is part of an encapsulating state and the state has visible refinement. 2014-02-19 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Contract): Do not warn on a postcondition for a function when the expression does not mention 'Result but the function has in-out parameters. 2014-02-19 Robert Dewar <dewar@adacore.com> * gnat_rm.texi: Add documentation on Value_Size forcing biased representation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207886 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-02-194-104/+309
| | | | | | | | | | | | | | | | | | | | | | | | * lib-xref.ads Remove the small table of letter and symbol usage as we already have one. 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Emit specific error messages depending on the offending misplaced aspect specifications. (Diagnose_Misplaced_Aspect_Specifications): New routine. 2014-02-19 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Get_Cursor): Utility to retrieve cursor type for iterable aspect primitives. (Resolve_Iterable_Operation): Use expected signature of iterable aspect to resolve primitive when overloading is present. (Validate_Iterable_Aspect, Analyze_Aspects_At_Freeze_Point): use it. (Check_Signature): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207885 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Yannick Moy <moy@adacore.com>charlet2014-02-195-110/+128
| | | | | | | | | | | | | | | | | | | | | | | * sem_ch10.adb (Analyze_Proper_Body): Issue error on missing subunit in GNATprove_Mode. * sinfo.ads (GNATprove_Mode): Document error issued in GNATprove_Mode. 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com> * lib-xref.ads Alphabetize the contents of table Xref_Entity_Letters. Add an entry in table Xref_Entity_Letters for E_Abstract_State. List all letters and symbols in use. * sem_prag.adb (Analyze_Abstract_State): Update all calls to Create_Abstract_State to reflect the new signature. (Create_Abstract_State): Change subprogram profile and update the comment on usage. Use the proper location of the state declaration when creating a new abstract state entity. Do not generate an external name, but simply reuse the name coming from the state declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207884 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Robert Dewar <dewar@adacore.com>charlet2014-02-193-1/+41
| | | | | | | | | | * exp_ch4.adb (Expand_N_Expression_With_Actions): Make sure declarations get properly inserted in Modify_Tree_For_C mode. * sinfo.ads: Minor comment addition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207883 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Robert Dewar <dewar@adacore.com>charlet2014-02-199-82/+101
| | | | | | | | | * par-ch9.adb, exp_ch5.adb, sem_ch5.adb, exp_attr.adb, sem_util.adb, sem_util.ads, sem_ch13.adb, sem_ch13.ads: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207882 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Ed Schonberg <schonberg@adacore.com>charlet2014-02-1913-5/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207881 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-19 Robert Dewar <dewar@adacore.com>charlet2014-02-199-86/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_attr.adb (Expand_Min_Max_Attribute): New procedure (Expand_N_Attribute_Reference): Use this procedure for Min and Max. * exp_ch4.adb (Expand_N_Expression_With_Actions): Remove object declarations from list of actions. * output.ads, output.adb (Delete_Last_Char): New procedure. * sinfo.ads: Document handling of Mod and expression with actions in Modify_Tree_For_C mode. 2014-02-19 Ed Schonberg <schonberg@adacore.com> * par-ch9.adb (P_Task): Add a null statement to produce a well-formed task body when due to a previous syntax error the statement list is empty. 2014-02-19 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Check_Dependency_Clause): Account for the case where a state with a non-null refinement matches a null output list. Comment reformatting. (Inputs_Match): Copy a solitary input to avoid an assertion failure when trying to match the same input in multiple clauses. 2014-02-19 Gary Dismukes <dismukes@adacore.com> * sem_attr.adb: Minor typo fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207880 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-18 Robert Dewar <dewar@adacore.com>charlet2014-02-1820-231/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cstand.adb (Build_Signed_Integer_Type): Minor change of formal from Int to Nat (Build_Unsigned_Integer_Type): New procedure (Create_Standard): Create new unsigned types. * exp_ch4.adb (Expand_N_Op_Mod): Expand mod in Modify_Tree_For_C mode (Expand_N_Reference): Removed, problematic and not needed for now. * exp_ch4.ads (Expand_N_Reference): Removed, problematic and not needed for now. * exp_util.ads, exp_util.adb (Power_Of_Two): New function. * expander.adb: Remove call to Expand_N_Reference (problematic, and not needed now). * sem_aux.ads, sem_aux.adb (Corresponding_Unsigned_Type): New function. * stand.adb: Read and write unsigned type entities. * stand.ads: Add new unsigned types. 2014-02-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch4.adb (Analyze_Call): Do not mark a function call as being inside an assertion expression as the flag is now removed. (Check_Ghost_Subprogram_Call): Do not query the In_Assertion_Expression flag as it is now removed, instead use a predicate function. * sem_elab.adb (Check_Internal_Call_Continue): Do not query the In_Assertion_Expression flag as it is now removed, instead use a predicate function. * sem_prag.ads: Add new table Assertion_Expression_Pragma. * sem_util.adb Add with and use clause for Sem_Prag. (In_Assertion_Expression_Pragma): New routine. * sem_util.ads (In_Assertion_Expression_Pragma): New routine. * sinfo.adb (In_Assertion_Expression): Removed. (Set_In_Assertion_Expression): Removed. * sinfo.ads Remove flag In_Assertion_Expression along with its use in nodes. (In_Assertion_Expression): Removed along with pragma Inline. (Set_In_Assertion_Expression): Removed along with pragma Inline. 2014-02-18 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: gnatpp section: add note that '-j' cannot be used together with '-r', '-rf' or '-rnb' options. 2014-02-18 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Comment and code reformatting. Use separate routines to check the legality of attribute 'Old in certain pragmas. Verify the use of 'Old, 'Result and locally declared entities within the prefix of 'Old. (Check_References_In_Prefix): New routine. (Check_Use_In_Contract_Cases): New routine. (Check_Use_In_Test_Case): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207843 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-18 Vincent Celier <celier@adacore.com>charlet2014-02-182-0/+14
| | | | | | | | | | | * sem_aux.adb (Is_By_Reference_Type): For each components of a record type, check also if the component is volatile as it may have an aspect that makes it volatile. If it is, then the record type is a by reference type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207842 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-18 Robert Dewar <dewar@adacore.com>charlet2014-02-186-16/+100
| | | | | | | | | | | | | * exp_attr.adb: Minor reformatting. * exp_ch4.ads, exp_ch4.adb (Expand_N_Reference): New procedure. * exp_util.adb (Remove_Side_Effects): Add conditional expressions as another case where we don't generate N_Reference nodes for primitive types. * expander.adb (Expand): Add call to Expand_N_Reference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207841 138bc75d-0d04-0410-961f-82ee72b054a4
* Code clean ups.charlet2014-02-061-13/+39
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207560 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-02-066-42/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Analyze_Refined_Pragma): Remove local variable Pack_Spec. Refinement pragmas may now apply to bodies of both visible and private subprograms. 2014-02-06 Robert Dewar <dewar@adacore.com> * exp_attr.adb (Expand_Loop_Entry_Attribute): Minor change (Attr => N) (Expand_Pred_Succ): New name Expand_Pred_Succ_Attribute (Expand_N_Attribute_Reference, case Max): Expand into if expression if Modify_Tree_For_C mode. (Expand_N_Attribute_Reference, case Min): ditto * sinfo.ads: Modify_Tree_For_C takes care of expanding Min and Max attributes. 2014-02-06 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Analyze_Object_Declaration): Do not generate predicate check if this is an internal declaration with No_Initialization set, as for an expanded aggregate component. 2014-02-06 Doug Rupp <rupp@adacore.com> * init.c (__gnat_default_resignal_p) [VMS]: Test for and resignal conditions with severity of "SUCCESS" or "INFORMATIONAL". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207559 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Yannick Moy <moy@adacore.com>charlet2014-02-063-44/+75
| | | | | | | | | | | | | | | | * sem_prag.adb (Analyze_Pragma): Analyze pragma Debug rewritten node before rewriting it as a null statement in GNATprove mode. 2014-02-06 Robert Dewar <dewar@adacore.com> * sem_attr.adb (Min_Max): New procedure. (Max_Alignment_For_Allocation_Max_Size_In_Storage_Elements): New procedure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207558 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Sergey Rybin <rybin@adacore.com frybin>charlet2014-02-064-12/+88
| | | | | | | | | | | | | | | | | | * gnat_ugn.texi, vms_data.ads: Add documentation of '-t' option for gnatmetric/gnatpp. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Abstract_State): Update all calls to Create_Abstract_State to pass the proper state "declaration". (Create_Abstract_State): Add new formal parameter State_Decl along with comment on usage. Establish a link between the abstract state entity and the state declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207557 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Robert Dewar <dewar@adacore.com>charlet2014-02-065-25/+54
| | | | | | | | | | | | | | | * sem_attr.adb (Analyze_Attribute, case Max): Check for improper comparison of unordered enumeration type. (Analyze_Attribute, case Max): Check for improper comparison of unordered enumeration type. * sem_res.adb (Bad_Unordered_Enumeration_Reference): Moved to sem_util.adb. * sem_util.ads, sem_util.adb (Bad_Unordered_Enumeration_Reference): Moved here from Sem_Res. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207556 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Robert Dewar <dewar@adacore.com>charlet2014-02-066-48/+56
| | | | | | | | | | | | | * sem_ch3.adb, sem_prag.adb, sem_res.adb, lib-xref.adb: Minor reformatting. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Process_Formals): Error message reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207555 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-02-062-1/+16
| | | | | | | | | | * sem_ch3.adb (Handle_Late_Controlled_Primitive): Add local variable Spec. Do not inherit the null indicator from the subprogram body when generating the spec. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207548 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Robert Dewar <dewar@adacore.com>charlet2014-02-066-78/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * casing.adb (Determine_Casing): Consider SPARK_Mode to be mixed case. 2014-02-06 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Is_Build_In_Place_Function): Predicate is false when the function has a foreign convention, but not if only the limited return type has such a convention. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch3.adb (Handle_Late_Controlled_Primitive): Remove local variable Spec. Comment reformatting. Use Copy_Separate_Tree rather than New_Copy_Tree when building the corresponding subprogram declaration. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Global_Item): Remove the mode-related checks on abstract states with enabled external properties. (Property_Error): Removed. 2014-02-06 Javier Miranda <miranda@adacore.com> * lib-xref.adb (Generate_Reference): When generating the reference to the first private entity take care of handling swapped entities. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207547 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Sergey Rybin <rybin@adacore.com frybin>charlet2014-02-067-5/+137
| | | | | | | | | | | | | | | | | | | | | | * gnat_ugn.texi, vms_data.ads: Add documentation of -j option for gnatmetric. 2014-02-06 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Expand_N_Shift_Left): Handle shift counts greater than the word size when operating in Modify_Tree_For_C mode. * sinfo.ads: Add documentation section on Modify_Tree_For_C mode. 2014-02-06 Robert Dewar <dewar@adacore.com> * erroutc.adb (Warning_Specifically_Suppressed.Matches): compare is case insensitive. * gnat_rm.texi: Document that string compare for Warnings Off is now case insensitive. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207546 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Eric Botcazou <ebotcazou@adacore.com>charlet2014-02-0616-49/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnat_rm.texi: Small wording tweak. 2014-02-06 Pascal Obry <obry@adacore.com> * prj-attr.adb, projects.texi, snames.ads-tmpl: Add Included_Patterns and Included_Artifact_Patterns attribute definitions. 2014-02-06 Yannick Moy <moy@adacore.com> * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set SPARK_Mode pragma component for all subprograms, including stubs. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch10.adb (Analyze_Package_Body_Stub): Maintain the configuration options of the enclosing context in a stack-like fasion. (Analyze_Subprogram_Body_Stub): Maintain the configuration options of the enclosing context in a stack-like fashion. 2014-02-06 Robert Dewar <dewar@adacore.com> * debug.adb: -gnatd.u sets Modify_Tree_For C * exp_ch4.adb (Expand_N_Op_Rotate_Left): Expand out if Modify_Tree_For_C (Expand_N_Op_Rotate_Right): ditto. (Expand_N_Op_Arithmetic_Right_Shift): ditto. * exp_intr.adb (Expand_Shift): Call expander so we do Modify_Tree_For_C expansions. * gnat1drv.adb (Adjust_Global_Switches): Set Modify_Tree_For_C if -gnatd.u set. 2014-02-06 Fedor Rybin <frybin@adacore.com> * prj-proc.ads (Tree_Loaded_Callback): new type Callback used after the phase 1 of the processing of each aggregated project to get access to project trees of aggregated projects. (Process_Project_Tree_Phase_1): new parameter On_New_Tree_Loaded If specified, On_New_Tree_Loaded is called after each aggregated project has been processed succesfully. (Process): new parameter On_New_Tree_Loaded. * prj-proc.adb (Process_Aggregated_Projects): On_New_Tree_Loaded callback added after processing of each aggregated project. (Recursive_Process): new parameter On_New_Tree_Loaded. (Process): new parameter On_New_Tree_Loaded. (Process_Project_Tree_Phase_1): new parameter On_New_Tree_Loaded. * prj-conf.ads (Parse_Project_And_Apply_Config): new parameter On_New_Tree_Loaded. * prj-conf.adb (Parse_Project_And_Apply_Config): new parameter On_New_Tree_Loaded. 2014-02-06 Bob Duff <duff@adacore.com> * gnat_ugn.texi: Implement --insert-blank-lines and --preserve-blank-lines switches. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207545 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Sergey Rybin <rybin@adacore.com frybin>charlet2014-02-068-39/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnat_ugn.texi, vms_data.ads: Add documentation of -j option for gnatelim. 2014-02-06 Eric Botcazou <ebotcazou@adacore.com> * gnat_rm.texi (Pragma Optimize_Alignment): Document the effect of the pragma on individual objects. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb Node29 is now used as BIP_Initialization_Call. (BIP_Initialization_Call): New routine. (Set_BIP_Initialization_Call): New routine. (Write_Field29_Name): Add an entry for constants and variables. * einfo.ads Add new attribute BIP_Initialization_Call and update its usage in nodes. (BIP_Initialization_Call): New routine along with pragma Inline. (Set_BIP_Initialization_Call): New routine along with pragma Inline. * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Add local declaration Res_Decl. Capture the build-in-place initialization call when the related object declaration has created a transient block. * exp_ch7.adb (Process_Transient_Objects): Add local variable Fin_Insrt. Recognize a scenario where an object declaration acts as a transient context and is initialized by a build-in-place function call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207543 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Pascal Obry <obry@adacore.com>charlet2014-02-069-19/+95
| | | | | | | | | | | | | | | | | | | | | | | | | * prj-util.adb (For_Interface_Sources): Fix handling of required bodies for aggregate libs. 2014-02-06 Robert Dewar <dewar@adacore.com> * nlists.ads: Minor comment clarifications. 2014-02-06 Robert Dewar <dewar@adacore.com> * gnat1drv.adb (Adjust_Global_Switches): Set Modify_Tree_For_C if gnatd.V set. * opt.ads (Modify_Tree_For_C): New flag. * output.ads, output.adb (Last_Char): New function. 2014-02-06 Pascal Obry <obry@adacore.com> * projects.texi, prj-env.adb (Initialize_Default_Project_Path): Add share/gpr for cross-builds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207542 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Robert Dewar <dewar@adacore.com>charlet2014-02-066-6/+15
| | | | | | | | | * exp_util.ads, checks.adb, sem_prag.adb, prj-util.adb, sem_ch13.adb: Minor reformatting and code clean ups. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207540 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Pascal Obry <obry@adacore.com>charlet2014-02-063-1/+7
| | | | | | | | | * prj-util.adb (For_Interface_Sources): Skip non compilable languages. * prj.ads: Minor typo fix in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207538 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-02-0610-111/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add local variable Expr. Flag clauses with extra parenthesis as this is not allowed by the syntax of the pragma. Code reformatting. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Alphabetize variables. Rename variabme Tnn to Temp. Do not create a temporary if assertions are disabled. Find enclosing routine _Postconditions and insert the temporary that captures the value of the prefix before the routine. * exp_ch6.adb (Build_Postconditions_Procedure): Insert the generated _Postconditions routine before the first source declaration of the related subprogram. (Insert_After_Last_Declaration): Removed. (Insert_Before_First_Source_Declaration): New routine. 2014-02-06 Ed Schonberg <schonberg@adacore.com> * exp_util.adb, exp_util.ads (Within_Internal_Subprogram): Utility to determine whether current expansion is for the body of a predefined primitive operation. (Make_Predicate_Check): Use Within_Internal_Subpgram * checks.adb (Apply_Predicate_Check): Use Within_Internal_Subprogram * sem_ch13.adb (Freeze_Entity_Checks): Ditto. 2014-02-06 Pascal Obry <obry@adacore.com> * prj.ads, prj-util.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207537 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Ed Schonberg <schonberg@adacore.com>charlet2014-02-068-9/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | * exp_ch6.adb (Expand_Subprogram_Contract, Append_Enabled_Item): Take into account the Split_PPC flag to ensure that conjuncts in a composite postcondition aspect are tested in source order. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Analyze_Generic_Subprogram_Body): Flag illegal use of SPARK_Mode. * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration): Flag illegal use of SPARK_Mode. (Instantiate_Subprogram_Body): Flag illegal use of SPARK_Mode. * sem_prag.adb (Analyze_Pragma): Code reformatting. * sem_util.adb Add with and use clause for Aspects. (Check_SPARK_Mode_In_Generic): New routine. * sem_util.ads (Check_SPARK_Mode_In_Generic): New routine. 2014-02-06 Thomas Quinot <quinot@adacore.com> * a-calend.adb (Formatting_Operations.Split): Ensure that Time_Error is raised for invalid time values. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207536 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Arnaud Charlet <charlet@adacore.com>charlet2014-02-067-21/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_prag.adb (Analyze_Pragma): Rewrite as a null statement in GNATprove_Mode. 2014-02-06 Robert Dewar <dewar@adacore.com> * einfo.ads, einfo.adb (Is_Discriminant_Check_Function): New flag. * exp_ch3.adb (Build_Dcheck_Function): Set Is_Discriminant_Check_Function. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Is_Subprogram_Call): Inspect the original tree in certain cases where a construct has been factored out and replaced by a reference to a temporary. 2014-02-06 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Process_Full_View): Fix typo in the order of parameters when propagating predicate function to full view. (Find_Type_Of_Object): Freeze base type of object type to catch premature use of discriminated private type without a full view. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207535 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-06 Robert Dewar <dewar@adacore.com>charlet2014-02-067-77/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sprint.adb: Minor reformatting. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Process_Transient_Object): Add local variable Temp_Ins. When the transient object is initialized by an aggregate, the hook must capture the object after the last component assignment takes place. * exp_ch7.adb (Detect_Subprogram_Call): Expose the subprogram to routine Is_Subprogram_Call. (Is_Subprogram_Call): Inspect an aggregate that has been heavily expanded for subprogram calls. (Process_Transient_Objects): Add local variables Expr, Ptr_Id and Temp_Ins. Remove the nested declare block and adjust the indentation. When the transient object is initialized by an aggregate, the hook must capture the object after the last component assignment takes place. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Global_Item): Detect illegal uses of external states with enabled properties that do not match the global mode. (Property_Error): New routine. * sem_res.adb (Property_Error): New routine. (Resolve_Actuals): Detect illegal uses of external variables with enabled properties in procedure calls that do not match the mode of the corresponding formal parameter. 2014-02-06 Hristian Kirtchev <kirtchev@adacore.com> * sem_util.adb (Has_Enabled_Property): Rename formal parameter Prop_Nam to Property. Update the comment on usage and all occurrences in the body. Add local variable Prop_Nam. When inspecting a property with an expression, the property name appears as the first choice of the component association. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207534 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-04 Robert Dewar <dewar@adacore.com>charlet2014-02-045-3/+13
| | | | | | | | * exp_ch5.adb, einfo.ads, freeze.adb, sem_ch8.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207470 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-04 Gary Dismukes <dismukes@adacore.com>charlet2014-02-047-16/+61
| | | | | | | | | | | | | | | | | | | | | | | | | * sem_aggr.adb: Change "runtime" to "run time" in warning message, for consistency with other messages. 2014-02-04 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_Iterator_Loop): For a container element iterator, indicate that the element is a constant if the container type does not have a variable indexing aspect. * sem_ch8.adb (Analyze_Object_Renaming): If the entity is already marked as constant, do not reset its Ekind, to ensure that container elements in an element loop are not modified if the container (e.g. a hashed set) only has a constant indexing aspect. 2014-02-04 Arnaud Charlet <charlet@adacore.com> * g-souinf.ads: Subprograms in this unit are actually not pure. * freeze.adb (Freeze_Subprogram): Do not reset Is_Pure for Intrinsics. * einfo.ads (Is_Pure): Update doc to match implementation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207469 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-04 Gary Dismukes <dismukes@adacore.com>charlet2014-02-045-13/+58
| | | | | | | | | | | | | | | | | | | | | | | * exp_ch13.adb: Minor spelling fix. 2014-02-04 Robert Dewar <dewar@adacore.com> * opt.ads: Minor comment update. 2014-02-04 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Expand_N_Expression_With_Actions): Use Rewrite instead of Replace. 2014-02-04 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Resolve_Array_Aggregate): Suppress warnings on null expressions if component type is non-null, when the corresponding association covers an empty range of index values. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207468 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-04 Robert Dewar <dewar@adacore.com>charlet2014-02-045-364/+527
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sinfo.ads: Further comments on N_Expression_With_Actions node. 2014-02-04 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Remove global variables Out_Items and Ref_Global. Remove local constant Body_Id along with dummy variables D1, D2, D3, D4, D5, D6, D7 and D8. Remove the useless collection of global items as this was a leftover from an earlier version of the routine. Move several routines out to avoid deep nesting and indentation. (Inputs_Match): Add formal parameter Dep_Clause. Rename formal parameter Do_Checks to Post_Errors. Update the comment on usage. (Is_Matching_Input): Renamed to Input_Match. Add formal parameters Ref_Inputs and Do_Checks. Rename formal parameter Do_Checks to Post_Errors. Update the comment on usage. Account for the case where a self referential state may have a null input_list. (Is_Self_Referential): New routine. 2014-02-04 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause): If the entity renames an expression, as in the case of an object of an unconstrained type initialized by a function call, defer the rewriting of the expression to the expander. * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case 'Alignment): If the entity renames an expression, introduce temporary to capture value, and rewrite original declaration to use temporary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207467 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-02-04 Gary Dismukes <dismukes@adacore.com>charlet2014-02-046-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | | * g-comlin.adb: Minor typo fix. 2014-02-04 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_All): Types derived from a formal access_to_classwide type do not have a finalization master. 2014-02-04 Robert Dewar <dewar@adacore.com> * sprint.adb: Minor reformatting. 2014-02-04 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Expand_N_Expression_With_Actions): Eliminate cases where Actions is a null list. * sinfo.ads (N_Expression_With_Actions): Actions can be temporarily empty during semantic analysis, but must be non-empty in the final expanded tree. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207466 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Robert Dewar <dewar@adacore.com>charlet2014-01-315-8/+45
| | | | | | | | | | | | | | | | | | | | | | | * exp_ch9.adb: Minor reformatting. 2014-01-31 Emmanuel Briot <briot@adacore.com> * g-comlin.adb (Set_Command_Line): Take the switches configuration from the Command_Line_Config. 2014-01-31 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Refinement_Clause): Guard against a malformed refinement clause. 2014-01-31 Vincent Celier <celier@adacore.com> * projects.texi: Add more documentation about others used as an index in indexed attributes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207358 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Robert Dewar <dewar@adacore.com>charlet2014-01-315-10/+98
| | | | | | | | | | | | | | | | * gnat_ugn.texi: Minor update. * gnat_rm.texi: Add example to Restriction_Warnings documentation. * exp_util.adb: Minor reformatting. 2014-01-31 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Expand_Entry_Barrier): Warn if the barrier depends on data that is not private to the protected object, and potentially modifiable in unsynchronized fashion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207357 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Yannick Moy <moy@adacore.com>charlet2014-01-316-95/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | * erroutc.adb (Validate_Specific_Warnings): Remove special case for GNATprove_Mode. 2014-01-31 Robert Dewar <dewar@adacore.com> * prj-attr.ads (First_Attribute_Of): Returns Empty_Attribute for Unknown_Package. * sem_ch6.adb, sem_attr.adb: Minor comment addition. 2014-01-31 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Build_Allocate_Deallocate_Proc): Rewrite the logic that generates a runtime check to determine the controlled status of the object about to be allocated or deallocated. Class-wide types now always use a runtime check even if they appear as generic actuals. (Find_Object): Detect a special case that involves interface class-wide types because the object appears as a complex expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207356 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Ed Schonberg <schonberg@adacore.com>charlet2014-01-315-24/+51
| | | | | | | | | | | | | | | | | | | | | * sem_ch6.adb (Process_Formals): In Ada2012 mode, place subprogram with an incomplete untagged formals on the list of private dependents, to verify that the type is properly completed in the private part. * sem_attr.adb: Code clean up. 2014-01-31 Robert Dewar <dewar@adacore.com> * exp_ch6.adb: Minor reformatting. 2014-01-31 Vincent Celier <celier@adacore.com> * prj-attr.adb (First_Attribute_Of): Return Unknown_Attribute when Pkg is unknown. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207354 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-01-314-12/+38
| | | | | | | | | | | | | | | | | | | | * sem_res.adb (Resolve_Entity_Name): Comment reformatting. Allow volatile objects in various generated checks. 2014-01-31 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute, case 'Update): For a record component association, set the etype of the identifier, for SPARK use. 2014-01-31 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Has_Visibility_Of_Subprogram): If type is not declared in a package, not checks can apply to the subprogram. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207353 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Robert Dewar <dewar@adacore.com>charlet2014-01-318-19/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * erroutc.adb (Validate_Specific_Warnings): Warnings are controlled -gnatw.W. * gnat_ugn.texi: Document new warnings controlled by -gnatw.w. * opt.ads (Warn_On_Warnings_Off): Now controls more cases. 2014-01-31 Arnaud Charlet <charlet@adacore.com> * exp_disp.adb: Update comments. 2014-01-31 Yannick Moy <moy@adacore.com> * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration, Save_Global_References): Guard access to expression in aspect. 2014-01-31 Yannick Moy <moy@adacore.com> * sem_prag.adb (Analyze_Pragma/Pragma_SPARK_Mode): Issue an error when the pragma is applied to a generic unit, a generic declaration, or inside a generic. 2014-01-31 Yannick Moy <moy@adacore.com> * sem_ch8.adb (Analyze_Subprogram_Renaming): Set SPARK_Mode on renaming entity. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207352 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Robert Dewar <dewar@adacore.com>charlet2014-01-318-67/+97
| | | | | | | | | | | | | | | | | | | | | | | * exp_ch9.adb, s-tassta.adb, s-tposen.adb, s-tposen.ads: Minor reformatting. 2014-01-31 Tristan Gingold <gingold@adacore.com> * exp_disp.adb: Add a historic note. 2014-01-31 Robert Dewar <dewar@adacore.com> * sem_warn.adb (Warn_On_Useless_Assignments): Add call to Process_Deferred_References. 2014-01-31 Yannick Moy <moy@adacore.com> * erroutc.adb (Validate_Specific_Warnings): Do not issue a message for ineffective pragma Warnings(Off) in GNATprove_Mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207351 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Bob Duff <duff@adacore.com>charlet2014-01-313-18/+40
| | | | | | | | | | | | | | | | * s-taskin.ads: Minor comment fix. * s-tassta.adb (Abort_Dependents): Don't abort all dependents; just direct dependents. If this is actually an abort, each task will take care of aborting its dependents, so all dependents will get aborted, as before. However, when this is called the second time from Vulnerable_Complete_Master "for convenience" (i.e. to kill off tasks waiting at terminate alternatives), aborting indirect dependents is wrong, because it causes some unrelated tasks to get aborted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207350 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-31 Robert Dewar <dewar@adacore.com>charlet2014-01-3117-334/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sem_ch4.adb: Minor reformatting. 2014-01-31 Robert Dewar <dewar@adacore.com> * exp_ch2.adb: New calling sequence for Is_LHS. * frontend.adb: Add call to Process_Deferred_References. * lib-xref.ads, lib-xref.adb (Process_Deferred_References): New. (Deferred_References): New table. * sem_ch8.adb (Find_Direct_Name): Make deferred reference table entries. (Find_Expanded_Name): Ditto. * sem_res.adb: New calling sequence for Is_LHS. * sem_util.ads, sem_util.adb (Is_LHS): New calling sequence. * sem_warn.adb: Call Process_Deferred_References before issuing warnings. 2014-01-31 Tristan Gingold <gingold@adacore.com> * exp_util.adb (Corresponding_Runtime_Package): Restrict the use of System_Tasking_Protected_Objects_Single_Entry. * exp_ch9.adb (Build_Simple_Entry_Call): Remove Mode parameter of Protected_Single_Entry_Call. (Expand_N_Timed_Entry_Call): Remove single_entry case. * exp_disp.adb (Make_Disp_Asynchronous_Select_Body): Remove single_entry case. (Make_Disp_Timed_Select_Body): Likewise. * rtsfind.ads (RE_Timed_Protected_Single_Entry_Call): Remove. * s-tposen.adb (Send_Program_Error, PO_Do_Or_Queue): Remove Self_Id parameter. (Wakeup_Entry_Caller): Remove Self_ID and New_State parameters. (Wait_For_Completion_With_Timeout): Remove. (Protected_Single_Entry_Call): Remove Mode parameter (always Simple_Call). (Service_Entry): Remove Self_Id constant (not used anymore). (Timed_Protected_Single_Entry_Call): Remove. * s-tposen.ads (Timed_Protected_Single_Entry_Call): Remove. (Protected_Single_Entry_Call): Remove Mode parameter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207349 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-29 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-01-298-2/+39
| | | | | | | | | | | | | | | | | | | | | | | * einfo.adb (Get_Pragma): Handle the retrieval of pragma Refined_Post. * einfo.ads (Get_Pragma): Update the comment on special pragmas handled by this routine. * sem_prag.adb (Analyze_Pragma): Add a legal pragma Refined_Post to the contract of the related subprogram body. * sem_util.adb (Add_Contract_Item): Handle the insertion of pragma Refined_Post into the contract of a subprogram body. * sinfo.ads Update the documentation of node N_Contract. * sem_res.adb (Resolve_Entity_Name): Add a guard to detect abstract states and variables only when checking the SPARK 2014 rules concerning volatile object placement. 2014-01-29 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): within an instance, null is compatible with any access type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207269 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-29 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-01-292-1/+7
| | | | | | | | | * sem_util.adb (Find_Placement_In_State_Space): Assume that the default placement is not in a package. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207268 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-29 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-01-2915-19/+30
| | | | | | | | | | | | | | | * sem_util.adb (Has_Enabled_Property): Compare the character field of the sole property. 2014-01-29 Robert Dewar <dewar@adacore.com> * sem_intr.adb, a-ztexio.ads, sinfo.ads, sem_res.adb, gnatlink.adb, vms_conv.adb, a-except.ads, a-except-2005.ads, a-teioed.adb, sem_warn.ads, treepr.ads, erroutc.ads, a-excach.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207267 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-29 Robert Dewar <dewar@adacore.com>charlet2014-01-294-4/+39
| | | | | | | | | | * sem_util.ads, sem_util.adb (In_Pragma_Expression): New function. * sem_warn.adb (Check_References): Suppress warnings if inside Initial_Condition pragma. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207266 138bc75d-0d04-0410-961f-82ee72b054a4
* Update comments.charlet2014-01-291-0/+11
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207264 138bc75d-0d04-0410-961f-82ee72b054a4
* Code clean up.charlet2014-01-291-6/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207263 138bc75d-0d04-0410-961f-82ee72b054a4
* 2014-01-29 Hristian Kirtchev <kirtchev@adacore.com>charlet2014-01-293-20/+118
| | | | | | | | | | | | | | | | | * sem_prag.adb (Check_Missing_Part_Of): List all values of State_Space_Kind for readability reasons. Do not emit an error on a private item when the enclosing package lacks aspect/pragma Abstract_State. Do not emit an error on a private package instantiation when the corresponding generic template lacks visible state. (Has_Visible_State): New routine. * sem_util.adb (Find_Placement_In_State_Space): The visible declarations of any kind of child units in general act as proper placement location. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207261 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud