aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
AgeCommit message (Collapse)AuthorFilesLines
2008-09-14a-crbtgk.adb, [...]: Fix typos in comments.Ralf Wildenhues1-1/+1
gcc/ada/ * a-crbtgk.adb, a-direct.ads, a-tasatt.adb, ali.ads, bindgen.adb, checks.adb, einfo.ads, exp_aggr.adb, exp_ch11.adb, exp_ch3.adb, exp_ch4.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_dbug.ads, exp_disp.adb, exp_dist.adb, exp_pakd.adb, exp_util.adb, g-alveop.ads, g-comlin.adb, g-comlin.ads, g-diopit.adb, g-socket.ads, gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/trans.c, lib-load.adb, lib-xref.ads, make.adb, mlib-prj.adb, nlists.ads, opt.ads, par-ch10.adb, par-ch5.adb, par.adb, s-os_lib.ads, s-oscons-tmplt.c, s-parint.ads, s-regpat.ads, s-shasto.ads, s-stausa.ads, s-taprop-vms.adb, sem.adb, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_elim.adb, sem_prag.adb, sem_util.adb, sem_util.ads, sem_warn.adb, sinfo.ads, styleg.adb, vms_data.ads: Fix typos in comments. * gnathtml.pl: Fix typos. From-SVN: r140356
2008-08-04sem_type.adb, [...]: Minor reformattingThomas Quinot1-1/+1
2008-08-04 Thomas Quinot <quinot@adacore.com> * sem_type.adb, sem_ch4.adb, sprint.adb, exp_ch3.adb: Minor reformatting From-SVN: r138635
2008-08-04sem_ch4.adb: Minor reformatting.Thomas Quinot1-2/+2
2008-08-04 Thomas Quinot <quinot@adacore.com> * sem_ch4.adb: Minor reformatting. From-SVN: r138619
2008-08-04sem_ch4.adb (Analyze_Allocator): If the designated type is a non-null access ↵Ed Schonberg1-3/+16
type and the allocator is not... 2008-08-04 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Allocator): If the designated type is a non-null access type and the allocator is not initialized, warn rather than reporting an error. From-SVN: r138600
2008-08-04sem_ch3.adb (Access_Definition): A formal object declaration is a legal ↵Ed Schonberg1-9/+27
context for an anonymous access to... 2008-08-04 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Access_Definition): A formal object declaration is a legal context for an anonymous access to subprogram. * sem_ch4.adb (Analyze_One_Call): If the call can be interpreted as an indirect call, report success to the caller to include possible interpretation. * sem_ch6.adb (Check_Return_Type_Indication): Apply proper conformance check when the type of the extended return is an anonymous access_to_subprogram type. * sem_res.adb: (Resolve_Call): Insert a dereference if the type of the subprogram is an access_to_subprogram and the context requires its return type, and a dereference has not been introduced previously. From-SVN: r138591
2008-08-01sem_ch4.adb: Minor reformatting Minor code reorganizationRobert Dewar1-3/+6
2008-08-01 Robert Dewar <dewar@adacore.com> * sem_ch4.adb: Minor reformatting Minor code reorganization From-SVN: r138495
2008-08-01sem_ch4.adb (Analyze_One_Call): Handle complex overloading of a procedure ↵Arnaud Charlet1-5/+25
call whose prefix is a parameterless... 2008-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_One_Call): Handle complex overloading of a procedure call whose prefix is a parameterless function call that returns an access_to_procedure. From-SVN: r138491
2008-07-31sem_ch4.adb (Valid_First_Argument_Of): Complete its functionality to handle ↵Javier Miranda1-1/+7
synchronized types. 2008-07-31 Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Valid_First_Argument_Of): Complete its functionality to handle synchronized types. Required to handle well the object.operation notation applied to synchronized types. From-SVN: r138404
2008-07-31sem_type.adb (Has_Compatible_Type): Complete support for synchronized types ↵Javier Miranda1-0/+4
when... 2008-07-31 Javier Miranda <miranda@adacore.com> * sem_type.adb (Has_Compatible_Type): Complete support for synchronized types when the candidate type is a synchronized type. * sem_res.adb (Resolve_Actuals): Reorganize code handling synchronized types, and complete management of synchronized types adding missing code to handle formal that is a synchronized type. * sem_ch4.adb (Try_Primitive_Operation): Avoid testing attributes that are not available and cause the compiler to blowup. Found compiling test with switch -gnatc * sem_ch6.adb (Check_Synchronized_Overriding): Remove local subprogram Has_Correct_Formal_Mode plus code cleanup. From-SVN: r138400
2008-06-03Makefile.in (common_tools): Fix typos in $(exeext) extension.Ralf Wildenhues1-1/+1
gcc/ada/ * Makefile.in (common_tools): Fix typos in $(exeext) extension. * gnat_ugn.texi (Style Checking) (Adding the Results of Compiler Checks to gnatcheck Output) (Example of Binder Output File): Fix typos. * ali.ads, einfo.ads, exp_ch4.adb, exp_ch6.adb, exp_dbug.ads, exp_dist.adb, exp_smem.adb, g-socket.ads, s-osinte-rtems.ads, s-shasto.ads, s-stausa.adb, s-stausa.ads, sem_cat.adb, sem_ch12.adb, sem_ch3.adb, sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_util.ads, sinfo.ads, utils.c: Fix typos in comments. * sem_ch6.adb, vms_data.ads: Fix typos in strings. From-SVN: r136329
2008-05-26einfo.ads (Abstract_Interface_Alias): Renamed as Interface_Alias.Javier Miranda1-7/+6
2008-05-26 Javier Miranda <miranda@adacore.com> * einfo.ads (Abstract_Interface_Alias): Renamed as Interface_Alias. (Set_Abstract_Interface_Alias): Renamed as Set_Interface_Alias. (Is_Internal): Adding documentation on internal entities that have attribute Interface_Alias (old attribute Abstract_Interface_Alias) * einfo.adb (Abstract_Interface_Alias): Renamed as Interface_Alias. (Set_Abstract_Interface_Alias): Renamed as Set_Interface_Alias. Added assertion to force entities with this attribute to have attribute Is_Internal set to True. (Next_Tag_Component): Simplify assertion using attribute Is_Tag. * sem_ch3.adb (Derive_Interface_Subprograms): This subprogram has been renamed as Derive_Progenitor_Subprograms. In addition, its code is a new implementation. (Add_Interface_Tag_Components): Remove special management of synchronized interfaces. (Analyze_Interface_Declaration): Minor reformating (Build_Derived_Record_Type): Minor reformating (Check_Abstract_Overriding): Avoid reporting error in case of abstract predefined primitive inherited from interface type because the body of internally generated predefined primitives of tagged types are generated later by Freeze_Type (Derive_Subprogram): Avoid generating an internal name if the parent subprogram overrides an interface primitive. (Derive_Subprograms): New implementation that keeps separate the management of tagged types not implementing interfaces, from tagged types that implement interfaces. (Is_Progenitor): New implementation. (Process_Full_View): Add documentation (Record_Type_Declaration): Replace call to Derive_Interface_Subprograms by call to Derive_Progenitor_Subprograms. * sem_ch6.ads (Is_Interface_Conformant): New subprogram. (Check_Subtype_Conformant, Subtype_Conformant): Adding new argument Skip_Controlling_Formals. * sem_ch6.adb (Is_Interface_Conformant): New subprogram. (Check_Conventions): New implementation. Remove local subprogram Skip_Check. Remove formal Search_From of routine Check_Convention. (Check_Subtype_Conformant, Subtype_Conformant): Adding new argument Skip_Controlling_Formals. (New_Overloaded_Entity): Enable addition of predefined dispatching operations. * sem_disp.ads (Find_Primitive_Covering_Interface): New subprogram. * sem_disp.adb (Check_Dispatching_Operation): Disable registering the task body procedure as a primitive of the corresponding tagged type. (Check_Operation_From_Private_Type): Avoid adding twice an entity to the list of primitives. (Find_Primitive_Covering_Interface): New subprogram. (Override_Dispatching_Operation): Add documentation. * sem_type.adb (Covers): Minor reformatings * sem_util.ads (Collect_Abstract_Interfaces): Renamed as Collect_Interfaces. Rename formal. (Has_Abstract_Interfaces): Renamed as Has_Interfaces. (Implements_Interface): New subprogram. (Is_Parent): Removed. (Primitive_Names_Match): New subprogram. (Remove_Homonym): Moved here from Derive_Interface_Subprograms. (Ultimate_Alias): New subprogram. * sem_util.adb (Collect_Abstract_Interfaces): Renamed as Collect_Interfaces. Remove special management for synchronized types. Rename formal. Remove internal subprograms Interface_Present_In_Parent and Add_Interface. (Has_Abstract_Interfaces): Renamed as Has_Interfaces. Replace assertion on non-record types by code to return false in such case. (Implements_Interface): New subprogram. (Is_Parent): Removed. No special management is now required for synchronized types covering interfaces. (Primitive_Names_Match): New subprogram. (Remove_Homonym): Moved here from Derive_Interface_Subprograms. (Ultimate_Alias): New subprogram. * exp_ch3.adb (Add_Internal_Interface_Entities): New subprogram. Add internal entities associated with secondary dispatch tables to the list of tagged type primitives that are not interfaces. (Freeze_Record_Type): Add new call to Add_Internal_Interface_Entities (Make_Predefined_Primitive_Specs): Code reorganization to improve the management of predefined equality operator. In addition, if the type has an equality function corresponding with a primitive defined in an interface type, the inherited equality is abstract as well, and no body can be created for it. * exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved from exp_util to exp_disp. (Is_Predefined_Interface_Primitive): New subprogram. Returns True if an entity corresponds with one of the predefined primitives required to implement interfaces. Update copyright notice. * exp_disp.adb (Set_All_DT_Position): Add assertion. Exclude from the final check on abstract subprograms all the primitives associated with interface primitives because they must be visible in the public and private part. (Write_DT): Use Find_Dispatching_Type to locate the name of the interface type. This allows the use of this routine, for debugging purposes, when the tagged type is not fully decorated. (Is_Predefined_Dispatching_Operation): Moved from exp_util to exp_disp. Factorize code calling new subprogram Is_Predefined_Interface_Primitive. (Is_Predefined_Interface_Primitive): New subprogram. Returns True if an entity corresponds with one of the predefined primitives required to implement interfaces. * exp_util.adb (Find_Interface_ADT): New implementation (Find_Interface): Removed. * sprint.adb (Sprint_Node_Actual): Generate missing output for the list of interfaces associated with nodes N_Formal_Derived_Type_Definition and N_Private_Extension_Declaration. From-SVN: r135923
2008-05-202008-05-20 Ed Schonberg <schonberg@adacore.com>Ed Schonberg1-47/+94
Thomas Quinot <quinot@adacore.com> * sem_ch4.adb (Try_Indexed_Call): Handle properly a construct of the form F(S) where F is a parameterless function that returns an array, and S is a subtype mark. (Analyze_Call): Insert dereference when the prefix is a parameterless function that returns an access to subprogram and the call has parameters. Reject a non-overloaded call whose name resolves to denote a primitive operation of the stub type generated to support a remote access-to-class-wide type. From-SVN: r135640
2008-04-13sem_ch10.adb, [...]: Fix comment typos.Ralf Wildenhues1-7/+7
gcc/ada/ * sem_ch10.adb, sem_ch10.ads, sem_ch12.adb, sem_ch12.ads, sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch6.ads, sem_ch8.adb, sem_ch8.ads, sem_ch9.adb, sem_elab.adb, sem_elab.ads, sem_elim.ads, sem_eval.adb, sem_eval.ads, sem_intr.adb, sem_mech.adb, sem_mech.ads, sem_prag.adb, sem_prag.ads, sem_res.adb, sem_res.ads, sem_type.adb, sem_util.adb, sem_util.ads, sem_warn.adb, sem_warn.ads: Fix comment typos. From-SVN: r134242
2008-04-08sem_cat.adb (Validate_RCI_Subprogram_Declaration): Add tests of ↵Gary Dismukes1-43/+146
Has_Stream_Attribute_ Definition when... 2008-04-08 Gary Dismukes <dismukes@adacore.com> Ed Schonberg <schonberg@adacore.com> Robert Dewar <dewar@adacore.com> * sem_cat.adb (Validate_RCI_Subprogram_Declaration): Add tests of Has_Stream_Attribute_ Definition when checking for available stream attributes on parameters of a limited type in Ada 2005. Necessary for proper recognition of visible stream attribute clauses. (Has_Stream_Attribute_Definition): If the type is derived from a private type, then use the derived type's underlying type for checking whether it has stream attributes. (Validate_Object_Declaration): The check for a user-defined Initialize procedure applies also to types with controlled components or a controlled ancestor. Reject an object declaration in a preelaborated unit if the type is a controlled type with an overriding Initialize procedure. (Validate_Remote_Access_To_Class_Wide_Type): Return without further checking when the parent of a dereference is a selected component and the name has not been analyzed. * sem_ch4.adb (Analyze_Selected_Component): Add checking for selected prefixes that are invalid explicit dereferences of remote access-to-class-wide values, first checking whether the selected component is a prefixed form of call to a tagged operation. (Analyze_Call): Remove code that issues an error for limited function calls in illegal contexts, as we now support all of the contexts that were forbidden here. Allow a function call that returns a task.and appears as the prefix of a selected component. (Analyze_Reference): Give error message if we try to make a 'Reference for an object that is atomic/aliased without its type having the corresponding attribute. (Analyze_Call): Remove condition checking for attributes to allow calls to functions with inherently limited results as prefixes of attributes. Remove related comment about Class attributes. (Analyze_Selected_Component): If the prefix is a remote type, check whether this is a prefixed call before reporting an error. (Complete_Object_Operation): If the controlling formal is an access to variable reject an actual that is a constant or an access to one. (Try_Object_Operation): If prefix is a tagged protected object,retrieve primitive operations from base type. * exp_ch4.adb (Expand_N_Indexed_Component): Test for prefix that is a build-in-place function call and call Make_Build_In_Place_Call_In_Anonymous_Context. (Expand_N_Selected_Component): Test for prefix that is a build-in-place function call and call Make_Build_In_Place_Call_In_Anonymous_Context. (Expand_N_Slice): Test for prefix that is a build-in-place function call and call Make_Build_In_Place_Call_In_Anonymous_Context. (Analyze_Call): Remove code that issues an error for limited function calls in illegal contexts, as we now support all of the contexts that were forbidden here. New calling sequence for Get_Simple_Init_Val (Expand_Boolean_Operator): Add call to Silly_Boolean_Array_Xor_Test (Expand_N_Op_Not): Add call to Silly_Boolan_Array_Not_Test From-SVN: r134026
2008-03-26exp_ch5.adb (Expand_N_Extended_Return_Statement): Suppress generation of a ↵Gary Dismukes1-2/+21
heap allocator for a limited unconstrained function... 2008-03-26 Gary Dismukes <dismukes@adacore.com> * exp_ch5.adb (Expand_N_Extended_Return_Statement): Suppress generation of a heap allocator for a limited unconstrained function return when resstriction No_Allocators is active. (Analyze_Allocator): The restriction No_Allocators is now only checked on allocators that have Comes_From_Source set, as per RM-H.4(7). * sem_ch4.adb (Expand_N_Extended_Return_Statement): Suppress generation of a heap allocator for a limited unconstrained function return when resstriction No_Allocators is active. (Analyze_Allocator): The restriction No_Allocators is now only checked on allocators that have Comes_From_Source set, as per RM-H.4(7). (Has_Fixed_Op): If the name in a function call is Standard."*" and the operands are fixed-point types, the universal_fixed predefined operation is used, regardless of whether the operand type (s) have a primitive operation of the same name. From-SVN: r133563
2008-03-02gnatfind.adb, [...]: Fix argument parsing typos.Ralf Wildenhues1-1/+1
gcc/ada * gnatfind.adb, gnatxref.adb: Fix argument parsing typos. * s-auxdec-empty.adb, s-auxdec.adb: Fix typos in copyright statement. * a-ngcoar.adb, a-ngrear.adb, g-awk.adb, g-debpoo.adb, gprep.adb, make.adb, makegpr.adb, par-ch6.adb, prj-nmsc.adb, sem_attr.adb, sem_ch4.adb, sem_ch8.adb: Fix typos in ada source code output strings. * sem_type.adb, system-vms-ia64.ads, system-vms.ads, system-vms_64.ads: Fix typos in ada source code comments. * sinfo-cn.adb: Remove incomplete sentence. From-SVN: r132822
2007-12-19sem_ch4.adb (Analyze_Concatenation_Rest): New procedure.Bob Duff1-10/+65
2007-12-19 Bob Duff <duff@adacore.com> * sem_ch4.adb (Analyze_Concatenation_Rest): New procedure. (Analyze_Concatenation): Use iteration instead of recursion in order to avoid running out of stack space for deeply nested concatenations. From-SVN: r131080
2007-12-13sem_ch4.adb (Analyze_Selected_Component): Include the requeue statement to ↵Hristian Kirtchev1-191/+397
the list of contexts where a selected... 2007-12-06 Hristian Kirtchev <kirtchev@adacore.com> Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Include the requeue statement to the list of contexts where a selected component with a concurrent tagged type prefix should yield a primitive operation. (Find_Primitive_Operation): Handle case of class-wide types. (Analyze_Overloaded_Selected_Component): If type of prefix is class-wide, use visible components of base type. (Resolve_Selected_Component): Ditto. (Try_Primitive_Operation, Collect_Generic_Type_Ops): If the type is a formal of a generic subprogram. find candidate interpretations by scanning the list of generic formal declarations.: (Process_Implicit_Dereference_Prefix): If the prefix has an incomplete type from a limited_with_clause, and the full view is available, use it for subsequent semantic checks. (Check_Misspelled_Selector): Use Namet.Sp.Is_Bad_Spelling_Of function (Find_Primitive_Operation): New function. (Analyze_Overloaded_Selected_Component): insert explicit dereference only once if several interpretations of the prefix yield an access type. (Try_Object_Operation): Code and comment cleanup. (Analyze_Selected_Component): Reorder local variables. Minot comment and code reformatting. When the type of the prefix is tagged concurrent, a correct interpretation might be available in the primitive and class-wide operations of the type. From-SVN: r130853
2007-10-15sem_ch4.adb: Minor code and comment reformatting.Hristian Kirtchev1-8/+48
2007-10-15 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch4.adb: Minor code and comment reformatting. (Analyze_Allocator): When the designated type of an unconstrained allocator is a record with unknown discriminants or an array with unknown range bounds, emit a detailed error message depending on the compilation mode and whether the designated type is limited. From-SVN: r129334
2007-09-26sem_ch4.adb (Analyze_Qualified_Expression): Apply name resolution rule for ↵Ed Schonberg1-10/+54
qualified expressions properly... 2007-09-26 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Qualified_Expression): Apply name resolution rule for qualified expressions properly, to detect improper conversions and resolve some cases of overloading. From-SVN: r128803
2007-09-10sem_aggr.adb (Build_Record_Aggr_Code): If an aggregate component is given a ↵Ed Schonberg1-35/+72
box association... 2007-09-10 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Build_Record_Aggr_Code): If an aggregate component is given a box association, the type of the component is discriminated, and the value of the discriminant is the discriminant of the enclosing type, retrieve its value from the aggregate itself, where it must have been supplied. * sem_ch4.adb (Analyze_One_Call): Further refinement to previous fix, to remove other spurious ambiguities on arithmetic operations involving literals and addresses, on systems where Address is a visible integer type, when the operator is called in functional notation. (Try_Primitive_Operation): Within an instance, a call in prefixed form is legal when the types match, even if the operation is currently hidden. From-SVN: r128337
2007-08-31sem_ch3.adb: The predicate Is_Descendent_Of_Address is now an entity flag, ↵Ed Schonberg1-4/+28
for effiency. 2007-08-31 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb: The predicate Is_Descendent_Of_Address is now an entity flag, for effiency. It is called when analyzing arithmetic operators and also for actuals in calls that are universal_integers. The flag is set for the predefined type address, and for any type or subtype derived from it. * sem_ch4.adb (Analyze_One_Call): Reject an actual that is a Universal_Integer, when the formal is a descendent of address and the call appears in user code. (Analyze_Selected_Component): if the prefix is a private extension, the tag component is visible. * sem_util.ads, sem_util.adb: Remove Is_Descendent_Of_Address, now an entity flag. From-SVN: r127980
2007-08-16[multiple changes]Arnaud Charlet1-4/+4
2007-08-16 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Add note on preprocessing (output file not written) 2007-08-16 Thomas Quinot <quinot@adacore.com> * a-tags.adb: Minor reformatting. 2007-08-16 Bob Duff <duff@adacore.com> * sem_type.ads, sem_ch4.adb: Minor reformatting. From-SVN: r127552
2007-08-14sem_ch4.adb (Try_Class_Wide_Operation): use base type of first parameter to ↵Ed Schonberg1-42/+151
determine whether operation applies to the... 2007-08-14 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Class_Wide_Operation): use base type of first parameter to determine whether operation applies to the prefix. (Complete_Object_Operation): If actual has an access type and controlling formal is not an in_parameter, reject the actual if it is an access_to_constant type. (Try_Primitive_Operation): If the type of the prefix is a formal tagged type, the candidate operations are found in the scope of declaration of the type, because the type has no primitive subprograms. (Analyze_Selected_Component): If prefix is class-wide, and root type is a private extension, only examine visible components before trying to analyze as a prefixed call. Change Entity_List to Type_To_Use, for better readability. (Has_Fixed_Op): Use base type when checking whether the type of an operator has a user-defined multiplication/division (Check_Arithmetic_Pair): Use Ada 2005 rules to remove ambiguities when user-defined operators are available for fixed-point types. From-SVN: r127444
2007-06-06einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable ↵Javier Miranda1-176/+511
to types that have the With_Type flag set. 2007-04-20 Javier Miranda <miranda@adacore.com> Ed Schonberg <schonberg@adacore.com> Robert Dewar <dewar@adacore.com> Eric Botcazou <ebotcazou@adacore.com> Arnaud Charlet <charlet@adacore.com> * einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable to types that have the With_Type flag set. Returns the non-limited view of the type, if available, otherwise the type itself. For class-wide types, there is no direct link in the tree, so we have to retrieve the class-wide type of the non-limited view of the Etype. New attributes Static_Initialization and Static_Elaboration_Desired. Remove the pragma Thread_Body, and the associated flag Is_Thread_Body in entities, and all related code. (Suppress_Value_Tracking_On_Call): New flag E_Exception has Esize and Alignment fields (Universal_Aliasing): New function. (Set_Universal_Aliasing): New procedure. (Write_Entity_Flags): Deal with Universal_Aliasing flag. (Check_Nested_Access): New procedure. (Has_Up_Level_Access, Set_Has_Up_Level_Access): New procedures. (Find_Direct_Name, Note_Possible_Modification): Use Check_Nested_Access. (Related_Interface): New attribute. Present in dispatch table pointer components of records. Set to point to the entity of the corresponding interface type. (Is_By_Reference_Type): Recurse on the full view of an incomplete type. (Original_Access_Type): Remove, not needed. (Root_Type): Handle properly subtypes of class-wide-types. Update comments. * sem_ch4.adb (Analyze_Explicit_Dereference): Add support for class-wide types visible through limited-with clauses. (Try_Primitive_Operation): When examining all primitive operations of a tagged type, do not consider subprograms labeled as hidden unless they belong to a private generic type with a tagged parent. (Try_Object_Operation): Extensive rewriting, to handle properly various overloading cases, when several ancestors may have class-wide operations that are possible candidates, and when the overloaded functions return array types and have defaulted parameters so that the call may be interpreted as an indexing. (Analyze_Allocator): Remove Mark_Allocator and its invocation. (Process_Function_Call): use Next, rather than Next_Actual, to analyze successive actuals before analyzing the call itself. (Try_Primitive_Operation): A primitive operation is compatible with the prefix if the prefix has a synchronized type and the type of the formal is its corresponding record, as can be the case when the primitive operation is declared outside of the body of the type. (Traverse_Homonyms): New subprocedure of Try_Class_Wide_Operation, to perform homonym traversal, looking for class-wide operation matches (formerly done in statements of Try_Class_Wide_Operation). Matches on access parameters are now restricted to anonymous access types. (Mark_Allocator): An allocator with a discriminant association parent is a coextension. (Try_One_Prefix_Interpretation): If the type of the object is incomplete, as can be happen when it is a limited view obtained through a limited_with_clause, the selected component is not part of a prefixed call. (Complete_Object_Operation): Diagnose properly an object that is not aliased when the corresponding controlling formal is an access parameter. (Try_Primitive_Operation, Try_Class_Wide_Operation): Diagnose properly ambiguous calls in prefixed notation, where two primitives differ only in that the controlling argument of one is an access parameter. * sem_ch6.adb (Has_Single_Return): Add guard in code that determines whether a function that returns an unconstrained type can be inlined. (Process_Formals): Diagnose properly the illegal use of an incomplete type in the profile of an access_to_subprogram declaration. (Check_Synchronized_Overriding): Nothing check for concurrent types, the operations are attached to the corresponding record. (Analyze_Subprogram_Specification): Add variables Formal and Formal_Typ. When processing a primitive of a concurrent type which implements an interface change the type of all controlling formals to that of the corresponding record type. (Check_Synchronized_Overriding): Relax the conditional logic when trying to determine the tagged type to which a primitive belongs. (Check_Conventions): Capture condition to ignore a primitive operation (which is shared between the loop in Check_Conventions and the one in Check_Convention) in a new local function Skip_Check. (Check_Convention): Rename Prim_Op to Second_Prim_Op to avoid possible confusion with Check_Conventions' own Prim_Op local variable. (Create_Extra_Formals): Test for a tagged result type rather than a controlling result when determining whether to add a BIP_Alloc_Form formal and a BIP_Final_List formal to the function. (Check_Conformance); For parameters that are anonymous access types, subtype conformance requires that the not null and the constant indicators must match (Check_Synchronized_Overriding): New parameter Formal_Typ. Add machinery to retrieve the appropriate type when processing a concurrent type declared within a generic. Minor comment reformatting. Change invocation of Overrides_Synchronized_Primitive to Find_Overridden_Synchronized_Pri- mitive. (Analyze_Subprogram_Body): If the return type of a function is an anonymous access to the limited view of a class-wide type, and the non-limited view of the type is available, update the type of the function so that code can be generated. (Process_Formals): In case of access-subtype itype whose designated type is also an itype (situation that happens now with access to subprograms) we mark the access-type itype with the Has_Delayed_Freeze attribute to avoid backend problems. (Check_Return_Subtype_Indication): Replace R_Type with R_Stm_Type in init of R_Stm_Type_Is_Anon_Access. Also check that base types of the anonymous types' designated types are same before testing Subtypes_Statically_Match. (Create_Extra_Formals): Test for a named access parameter that is a controlling formal as an additional condition for adding an accessibility level formal. This can occur in the subp type created for dispatching calls in Expand_Dispatching_Call, and allows calling Create_Extra_Formals from that procedure rather than special-casing the extra formals there. (Create_Extra_Formals): Add BIP_Alloc_Form and BIP_Final_List formals when the function has a controlling result. (Check_Returns): Add much more knowledge of the optimization of local raise statements to gotos, to retain proper warnings in this case. (Check_Statement_Sequence): Ignore N_Push_xxx_Label and N_Pop_xxx_Label nodes when looking for last statement. * sem_type.ads, sem_type.adb (Specific_Type): Add support for class-wide types visible through limited with clauses. (Add_One_Interp): If the operands are anonymous access types, the predefined operator on universal_access is immediately visibles (Find_Unique_Type): Handle anonymous access to subprogram types just as other anonymous access types. (Disambiguate): Take into account CIL convention. (Interface_Present_In_Ancestor): Add support for class-wide interfaces. From-SVN: r125390
2007-04-06sem_ch4.adb (Try_Primitive_Operation): The call is legal if the prefix type ↵Ed Schonberg1-68/+184
is a discriminated subtype of the type of... 2007-04-06 Ed Schonberg <schonberg@adacore.com> Bob Duff <duff@adacore.com> Gary Dismukes <dismukes@adacore.com> * sem_ch4.adb (Try_Primitive_Operation): The call is legal if the prefix type is a discriminated subtype of the type of the formal. (Analyze_Allocator): Collect all coextensions regardless of the context. Whether they can be allocated statically is determined in exp_ch4. (Analyze_Selected_Component): If the prefix is a limited view and the non-limited view is available, use the non-limited one. (Operator_Check): For "X'Access = Y'Access" (which is ambiguous, and therefore illegal), suggest a qualified expression rather than a type conversion, because a type conversion would be illegal in this context. (Anayze_Allocator): Trace recursively all nested allocators so that all coextensions are on the corresponding list for the root. Do no mark coextensions if the root allocator is within a declaration for a stack- allocated object, because the access discriminants will be allocated on the stack as well. (Analyze_Call): Remove restriction on calls to limited functions for the cases of generic actuals for formal objects, defaults for formal objects and defaults for record components. (Analyze_Allocator): Before analysis, chain coextensions on the proper element list. Their expansion is delayed until the enclosing allocator is processed and its finalization list constructed. (Try_Primitive_Operation): If the prefix is a concurrent type, looks for an operation with the given name among the primitive operations of the corresponding record type. (Analyze_Selected_Component): If the prefix is a task type that implements an interface, and there is no entry with the given name, check whether there is another primitive operation (e.g. a function) with that name. (Try_Object_Operation, Analyze_One_Call, Try_Indexed_Call): Handle properly the indexing of a function call written in prefix form, where the function returns an array type, and all parameters of the function except the first have defaults. (Analyze_Equality_Op): If this is a call to an implicit inequality, keep the original operands, rather than relocating them, for efficiency and to work properly when an operand is overloaded. (Analyze_Allocator,Operator_Check,Remove_Abstract_Operations): Split Is_Abstract flag into Is_Abstract_Subprogram and Is_Abstract_Type. (Analyze_Selected_Component): If the prefix is a private extension, only scan the visible components, not those of the full view. (Try_Primitive_Operation): If the operation is a procedure, collect all possible interpretations, as for a function, because in the presence of classwide parameters several primitive operations of the type can match the given arguments. From-SVN: r123594
2006-10-31sem_ch4.adb (Try_Primitive_Operation): Code cleanup to ensure that we ↵Ed Schonberg1-64/+191
generate the same errors compiling under -gnatc. 2006-10-31 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> Robert Dewar <dewar@adacore.com> * sem_ch4.adb (Try_Primitive_Operation): Code cleanup to ensure that we generate the same errors compiling under -gnatc. (Try_Object_Operation): If no candidate interpretation succeeds, but there is at least one primitive operation with the right name, report error in call rather than on a malformed selected component. (Analyze_Selected_Component): If the prefix is an incomplete type from a limited view, and the full view is available, use the full view to determine whether this is a prefixed call to a primitive operation. (Operator_Check): Verify that a candidate interpretation is a binary operation before checking the type of its second formal. (Analyze_Call): Add additional warnings for function call contexts not yet supported. (Analyze_Allocator): Move the check for "initialization not allowed for limited types" after analyzing the expression. This is necessary, because OK_For_Limited_Init looks at the structure of the expression. Before analysis, we don't necessarily know what sort of expression it is. For example, we don't know whether F(X) is a function call or an indexed component; the former is legal in Ada 2005; the latter is not. (Analyze_Allocator): Correct code for AI-287 -- extension aggregates were missing. We also didn't handle qualified expressions. Now also allow function calls. Use new common routine OK_For_Limited_Init. (Analyze_Type_Conversion): Do not perform some legality checks in an instance, because the error message will be redundant or spurious. (Analyze_Overloaded_Selected_Component): Do not do style check when setting an entity, since we do not know it is the right entity yet. (Analyze_Selected_Component): Move Generate_Reference call to Sem_Res (Analyze_Overloaded_Selected_Component): Same change (Analyze_Selected_Component): Remove unnecessary prefix type retrieval since regular incomplete subtypes are transformed into corresponding subtypes of their full views. (Complete_Object_Operation): Treat name of transformed subprogram call as coming from source, for browsing purposes. (Try_Primitive_Operation): If formal is an access parameter, compare with base type of object to determine whether it is a primitive operation. (Operator_Check): If no interpretation of the operator matches, check whether a use clause on any candidate might make the operation legal. (Try_Class_Wide_Operation): Check whether the first parameter is an access type whose designated type is class-wide. From-SVN: r118302
2006-02-17sem_ch4.adb (Find_Boolean_Types): If one of the operands is an aggregate...Ed Schonberg1-1/+26
2006-02-17 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Find_Boolean_Types): If one of the operands is an aggregate, check the interpretations of the other operand to find one that may be a boolean array. (Analyze_Selected_Component): Fix flow-of-control typo in case where the prefix is a private extension. From-SVN: r111182
2006-02-15sem_ch4.adb (Remove_Abstract_Interpretations): Even if there are no abstract ↵Ed Schonberg1-45/+156
interpretations on an operator... 2006-02-13 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Remove_Abstract_Interpretations): Even if there are no abstract interpretations on an operator, remove interpretations that yield Address or a type derived from it, if one of the operands is an integer literal. (Try_Object_Operation.Try_Primitive_Operation, Try_Object_Operation.Try_Class_Wide_Operation): Set proper source location when creating the new reference to a primitive or class-wide operation as a part of rewriting a subprogram call. (Try_Primitive_Operations): If context requires a function, collect all interpretations after the first match, because there may be primitive operations of the same type with the same profile and different return types. From code reading. (Try_Primitive_Operation): Use the node kind to choose the proper operation when a function and a procedure have the same parameter profile. (Complete_Object_Operation): If formal is an access parameter and prefix is an object, rewrite as an Access reference, to match signature of primitive operation. (Find_Equality_Type, Find_One_Interp): Handle properly equality given by an expanded name with prefix Standard, when the operands are of an anonymous access type. (Remove_Abstract_Operations): If the operation is abstract because it is inherited by a user-defined type derived from Address, remove it as well from the set of candidate interpretations of an overloaded node. (Analyze_Membership_Op): Membership test not applicable to cpp-class types. From-SVN: r111092
2005-12-09sem_ch4.adb (Remove_Abstract_Operations): Do not apply preference rule ↵Ed Schonberg1-32/+34
prematurely when operands are universal... 2005-12-05 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Remove_Abstract_Operations): Do not apply preference rule prematurely when operands are universal, remaining ambiguities will be removed during resolution. Code cleanup. * sem_type.adb (Disambiguate): In Ada95 mode, discard interpretations that are Ada 2005 functions. (Has_Abstract_Interpretation): Subsidiary to Remove_Conversions, to remove ambiguities caused by abstract operations on numeric types when operands are universal. From-SVN: r108302
2005-11-15a-secain.adb, [...]: Minor reformattingRobert Dewar1-22/+7
2005-11-14 Robert Dewar <dewar@adacore.com> * a-secain.adb, a-slcain.adb, a-shcain.adb, a-chtgke.ads, a-chtgke.adb, a-stwiha.adb, a-strhas.adb, a-chzla1.ads, a-chzla9.ads, a-stzbou.adb, a-stzbou.ads, a-stzfix.adb, a-stzhas.adb, a-stzmap.adb, a-stzmap.ads, a-stzsea.adb, a-stzsea.ads, a-stzsup.adb, a-stzsup.ads, a-stzunb.adb, a-stzunb.ads, a-szuzha.adb, a-szuzha.ads, a-szuzti.adb, a-szuzti.ads, a-ztcoau.adb, a-ztcoau.ads, a-ztcoio.adb, a-ztcstr.adb, a-ztcstr.ads, a-ztdeau.adb, a-ztdeau.ads, a-ztdeio.adb, a-ztdeio.ads, a-ztedit.adb, a-ztedit.ads, a-ztenau.ads, a-ztenio.adb, a-ztenio.ads, a-ztexio.adb, a-ztexio.ads, a-ztfiio.adb, a-ztfiio.ads, a-ztflau.adb, a-ztflau.ads, a-ztflio.adb, a-ztflio.ads, a-ztgeau.adb, a-ztgeau.ads, a-ztinau.adb, a-ztinau.ads, a-ztinio.adb, a-ztmoau.ads, a-ztmoio.adb, a-ztmoio.ads, a-zttest.adb, g-enblsp-vms-alpha.adb, g-enblsp-vms-alpha.adb, g-enblsp-vms-ia64.adb, g-enblsp-vms-ia64.adb, system-linux-hppa.ads, a-chacon.adb, a-chacon.ads, a-wichun.adb, a-wichun.ads, a-zchuni.adb, a-zchuni.ads, g-trasym-vms-alpha.adb, g-trasym-vms-ia64.adb, system-hpux-ia64.ads, g-soccon-unixware.ads, g-soliop-unixware.ads, g-soccon-interix.ads, g-soliop-solaris.ads, g-eacodu-vms.adb, g-expect-vms.adb, g-socthi-vms.adb, g-soliop-mingw.ads, a-intnam-unixware.ads, a-intnam-lynxos.ads, a-intnam-tru64.ads, a-intnam-aix.ads, a-intnam-linux.ads, a-intnam-linux.ads, a-intnam-dummy.ads, a-numaux-libc-x86.ads, a-intnam-interix.ads, a-intnam-solaris.ads, a-calend-vms.adb, a-calend-vms.ads, a-intnam-vms.ads, a-calend-mingw.adb, a-intnam-mingw.ads, a-intnam-vxworks.ads, a-numaux-vxworks.ads, system-unixware.ads, system-linux-ia64.ads, a-intnam-freebsd.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, system-linux-x86_64.ads, a-stunha.adb, a-cgaaso.ads, a-cgaaso.adb, a-chtgop.adb, a-cgcaso.adb, a-cgarso.adb, a-cohata.ads, a-crbtgk.adb, a-crbltr.ads, a-coprnu.adb, a-rbtgso.adb, a-intnam-darwin.ads, system-darwin-ppc.ads, gprmake.adb, makegpr.ads, system-tru64.ads, system-aix.ads, system-solaris-x86.ads, system-irix-o32.ads, s-interr-sigaction.adb, system-irix-n32.ads, s-parame-mingw.adb, system-hpux.ads, s-traceb-hpux.adb, system-linux-x86.ads, s-inmaop-dummy.adb, system-os2.ads, system-interix.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, s-inmaop-vms.adb, s-mastop-vms.adb, expander.adb, expander.ads, s-gloloc-mingw.adb, system-mingw.ads, system-vms-zcx.ads, s-osinte-fsu.adb, s-traceb-mastop.adb, a-exextr.adb, a-exstat.adb, a-filico.ads, a-finali.ads, a-interr.ads, a-intsig.adb, a-intsig.ads, a-except.ads, a-numaux-x86.ads, a-astaco.adb, a-calend.adb, a-calend.ads, a-chahan.adb, a-chahan.ads, a-chlat9.ads, a-colien.adb, a-colien.ads, a-colire.adb, a-colire.ads, a-comlin.adb, a-comlin.ads, a-cwila1.ads, a-cwila9.ads, a-elchha.adb, a-decima.adb, a-decima.ads, a-diocst.ads, a-direio.adb, a-direio.ads, a-excach.adb, a-excach.adb, a-exctra.ads, ali-util.adb, a-ngcefu.adb, a-ngcoty.adb, a-ngcoty.ads, a-nudira.adb, a-nudira.ads, a-nuflra.adb, a-numaux.ads, a-reatim.ads, a-sequio.adb, a-sequio.ads, a-siocst.ads, a-ssicst.ads, a-stmaco.ads, a-storio.adb, a-strbou.adb, a-strbou.ads, a-stream.ads, a-strfix.adb, a-strmap.adb, a-strmap.ads, a-strsea.adb, a-strsea.ads, a-strsup.adb, a-strsup.ads, a-strunb.adb, a-strunb.ads, a-stwibo.adb, a-stwibo.ads, a-stwifi.adb, a-stwima.adb, a-stwima.ads, a-stwise.adb, a-stwise.ads, a-stwisu.adb, a-stwisu.ads, a-stwiun.adb, a-stwiun.ads, a-suteio.adb, a-suteio.ads, a-swmwco.ads, a-swuwti.adb, a-swuwti.ads, a-sytaco.adb, a-sytaco.ads, a-tasatt.adb, a-taside.adb, a-taside.ads, a-teioed.adb, a-textio.adb, a-textio.ads, a-ticoau.adb, a-ticoau.ads, a-ticoio.adb, a-tideau.adb, a-tideio.adb, a-tienau.adb, a-tienio.adb, a-tifiio.adb, a-tiflio.adb, a-tigeau.adb, a-tigeau.ads, a-tiinau.adb, a-tiinio.adb, a-timoau.adb, a-timoio.adb, a-timoio.ads, a-tiocst.ads, a-titest.adb, atree.adb, a-witeio.adb, a-witeio.ads, a-wtcoau.adb, a-wtcoau.ads, a-wtcoio.adb, a-wtcstr.ads, a-wtdeau.adb, a-wtdeio.adb, a-wtedit.adb, a-wtedit.ads, a-wtenau.adb, a-wtenio.adb, a-wtfiio.adb, a-wtflio.adb, a-wtgeau.adb, a-wtinau.adb, a-wtinio.adb, a-wtmoau.adb, a-wtmoio.adb, a-wttest.adb, back_end.adb, bindgen.adb, butil.adb, butil.ads, checks.ads, cio.c, comperr.adb, csets.ads, cstand.adb, debug.ads, elists.ads, errno.c, errout.adb, errout.ads, erroutc.adb, erroutc.ads, errutil.adb, errutil.ads, errutil.ads, err_vars.ads, eval_fat.adb, exp_ch11.adb, exp_ch11.ads, exp_ch2.adb, exp_ch7.ads, exp_imgv.ads, exp_pakd.adb, exp_prag.adb, exp_prag.ads, exp_tss.adb, exp_tss.ads, exp_vfpt.ads, fe.h, fmap.adb, freeze.ads, frontend.adb, frontend.ads, g-arrspl.adb, g-arrspl.ads, g-awk.adb, g-awk.ads, g-boumai.ads, g-calend.adb, g-calend.ads, g-catiio.adb, g-comlin.adb, g-comlin.ads, g-comlin.ads, g-comlin.ads, g-comver.adb, g-crc32.adb, g-crc32.ads, g-ctrl_c.ads, g-curexc.ads, g-debpoo.ads, g-debuti.adb, g-diopit.adb, g-diopit.ads, g-dirope.adb, g-dirope.ads, g-dyntab.adb, g-dyntab.ads, g-excact.adb, g-excact.ads, g-except.ads, g-exctra.adb, g-exctra.ads, g-expect.ads, g-flocon.ads, g-hesorg.ads, g-io.adb, g-locfil.ads, g-md5.adb, g-md5.ads, g-md5.ads, g-moreex.adb, g-signal.ads, g-signal.adb, gnatbind.ads, gnatchop.adb, gnatcmd.adb, gnatfind.adb, gnatlbr.adb, gnatmake.ads, gnatmem.adb, gnatprep.adb, gnatprep.ads, gnatsym.adb, gnatxref.adb, g-os_lib.adb, g-os_lib.ads, g-pehage.adb, g-pehage.ads, gprep.ads, g-regexp.adb, g-regexp.ads, g-regist.adb, g-regist.ads, g-regpat.ads, g-semaph.adb, g-socthi.adb, g-soliop.ads, g-spipat.adb, g-spipat.ads, g-sptabo.ads, g-sptain.ads, g-sptavs.ads, g-string.ads, g-tasloc.adb, g-tasloc.ads, g-trasym.adb, g-trasym.ads, i-fortra.adb, i-fortra.ads, inline.adb, layout.adb, live.adb, make.ads, makeutl.ads, makeutl.adb, mdll-fil.adb, mdll-fil.ads, mdll-utl.ads, memroot.ads, memtrack.adb, mlib.ads, mlib-fil.adb, mlib-fil.ads, mlib-prj.ads, mlib-utl.adb, mlib-utl.ads, nlists.adb, nlists.ads, osint.adb, osint.ads, osint-c.adb, osint-l.adb, osint-l.ads, osint-m.ads, output.adb, par.adb, par.adb, par.ads, par-ch11.adb, par-ch12.adb, par-ch2.adb, par-ch4.adb, par-ch5.adb, par-ch6.adb, par-ch9.adb, par-endh.adb, par-labl.adb, par-load.adb, par-tchk.adb, prep.adb, prepcomp.adb, prepcomp.ads, prj-attr.ads, prj-com.ads, prj-dect.adb, prj-dect.ads, prj-env.ads, prj-err.ads, prj-ext.ads, prj-makr.adb, prj-makr.ads, prj-nmsc.ads, prj-pars.adb, prj-pars.ads, prj-part.ads, prj-pp.ads, prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-util.adb, prj-util.ads, rtsfind.adb, sem.adb, sem.ads, sem_case.adb, sem_case.ads, sem_ch11.adb, sem_ch4.adb, sem_ch6.ads, sem_ch7.ads, sem_dist.ads, sem_elab.ads, sem_elim.ads, sem_eval.ads, sem_intr.ads, sem_maps.adb, sem_maps.ads, sem_maps.ads, sem_res.ads, sem_type.ads, sfn_scan.adb, sfn_scan.ads, s-imgwch.ads, s-imgwiu.adb, s-imgwiu.ads, s-inmaop.ads, sinput.adb, sinput.ads, s-pack03.adb, s-pack03.ads, s-pack05.adb, s-pack05.ads, s-pack06.adb, s-pack06.ads, s-pack07.adb, s-pack07.ads, s-pack09.adb, s-pack09.ads, s-pack10.adb, s-pack10.ads, s-pack11.adb, s-pack11.ads, s-pack12.adb, s-pack12.ads, s-pack13.adb, s-pack13.ads, s-pack14.adb, s-pack14.ads, s-pack15.adb, s-pack15.ads, s-pack17.adb, s-pack17.ads, s-pack18.adb, s-pack18.ads, s-pack19.adb, s-pack19.ads, s-pack20.adb, s-pack20.ads, s-pack21.adb, s-pack21.ads, s-pack22.adb, s-pack22.ads, s-pack23.adb, s-pack23.ads, s-pack24.adb, s-pack24.ads, s-pack25.adb, s-pack25.ads, s-pack26.adb, s-pack26.ads, s-pack27.adb, s-pack27.ads, s-pack28.adb, s-pack28.ads, s-pack29.adb, s-pack29.ads, s-pack30.adb, s-pack30.ads, s-pack31.adb, s-pack31.ads, s-pack33.adb, s-pack33.ads, s-pack34.adb, s-pack34.ads, s-pack35.adb, s-pack35.ads, s-pack36.adb, s-pack36.ads, s-pack37.adb, s-pack37.ads, s-pack38.adb, s-pack38.ads, s-pack39.adb, s-pack39.ads, s-pack40.adb, s-pack40.ads, s-pack41.adb, s-pack41.ads, s-pack42.adb, s-pack42.ads, s-pack43.adb, s-pack43.ads, s-pack44.adb, s-pack44.ads, s-pack45.adb, s-pack45.ads, s-pack46.adb, s-pack46.ads, s-pack47.adb, s-pack47.ads, s-pack48.adb, s-pack48.ads, s-pack49.adb, s-pack49.ads, s-pack50.adb, s-pack50.ads, s-pack51.adb, s-pack51.ads, s-pack52.adb, s-pack52.ads, s-pack53.adb, s-pack53.ads, s-pack54.adb, s-pack54.ads, s-pack55.adb, s-pack55.ads, s-pack56.adb, s-pack56.ads, s-pack57.adb, s-pack57.ads, s-pack58.adb, s-pack58.ads, s-pack59.adb, s-pack59.ads, s-pack60.adb, s-pack60.adb, s-pack60.ads, s-pack61.adb, s-pack61.ads, s-pack62.adb, s-pack62.ads, s-pack63.adb, s-pack63.ads, s-parint.adb, s-parint.adb, s-parint.ads, sprint.ads, s-purexc.ads, s-restri.ads, s-restri.adb, s-scaval.adb, s-scaval.ads, s-secsta.adb, s-secsta.ads, s-sequio.adb, s-sequio.ads, stand.ads, s-tasuti.adb, s-traceb.adb, s-traceb.ads, stringt.adb, stringt.ads, styleg.ads, s-valboo.adb, s-valboo.ads, s-valcha.adb, s-valcha.ads, s-valdec.adb, s-valdec.ads, s-valint.adb, s-valint.ads, s-valint.ads, s-vallld.adb, s-vallld.ads, s-vallli.adb, s-vallli.ads, s-valllu.adb, s-valllu.ads, s-valrea.adb, s-valrea.ads, s-valuns.adb, s-valuns.ads, s-valuti.adb, s-valuti.ads, s-valwch.ads, s-veboop.adb, s-veboop.ads, s-vercon.adb, s-vercon.ads, s-wchcnv.adb, s-wchcnv.ads, s-wchcon.ads, s-wchjis.adb, s-wchjis.ads, s-wchstw.adb, s-wchstw.adb, s-wchstw.ads, s-wchwts.adb, s-wchwts.ads, s-widboo.adb, s-widboo.ads, s-widcha.adb, s-widcha.ads, s-widenu.adb, s-widenu.ads, s-widlli.adb, s-widlli.ads, s-widllu.adb, s-widllu.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads, s-wwdenu.adb, s-wwdenu.ads, symbols.adb, symbols.ads, table.ads, targparm.adb, targparm.ads, tb-alvms.c, tb-alvxw.c, tbuild.adb, tree_io.ads, treepr.adb, treeprs.adt, ttypef.ads, ttypes.ads, types.adb, uintp.adb, uintp.ads, uname.ads, urealp.ads, usage.ads, validsw.ads, vxaddr2line.adb, widechar.adb, widechar.ads, xeinfo.adb, xnmake.adb, xref_lib.ads, xr_tabls.adb, xr_tabls.ads, xsinfo.adb, xtreeprs.adb, xsnames.adb, vms_conv.ads, vms_conv.adb, a-dirval.ads, a-dirval.adb, a-dirval-mingw.adb, a-direct.ads, a-direct.adb, indepsw.ads, prj-attr-pm.ads, system-linux-ppc.ads, a-numaux-darwin.ads, a-numaux-darwin.adb, a-swuwha.ads, a-stunha.ads: Minor reformatting From-SVN: r107016
2005-09-05sem_ch4.adb (Transform_Object_Operation): In a context off the form V (Obj.F)...Ed Schonberg1-237/+219
2005-09-01 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Transform_Object_Operation): In a context off the form V (Obj.F), the rewriting does not involve the indexed component, but only the selected component itself. Do not apply the transformation if the analyzed node is an actual of a call to another subprogram. (Complete_Object_Operation): Retain the entity of the dispatching operation in the selector of the rewritten node. The entity will be used in the expansion of dispatching selects. (Analyze_One_Call): Improve location of the error message associated with interface. (Analyze_Selected_Component): No need to resolve prefix when it is a function call, resolution is done when parent node is resolved, as usual. (Analyze_One_Call): Add a flag to suppress analysis of the first actual, when attempting to resolve a call transformed from its object notation. (Try_Object_Operation, Transform_Object_Operastion): Avoid makind copies of the argument list for each interpretation of the operation. (Try_Object_Operation): The designated type of an access parameter may be an incomplete type obtained through a limited_with clause, in which case the primitive operations of the type are retrieved from its full view. (Analyze_Call): If this is an indirect call, and the return type of the access_to_subprogram is incomplete, use its full view if available. From-SVN: r103882
2005-07-07par-load.adb (Load): If a child unit is loaded through a limited_with clause...Ed Schonberg1-0/+19
2005-07-07 Ed Schonberg <schonberg@adacore.com> Javier Miranda <miranda@adacore.com> * par-load.adb (Load): If a child unit is loaded through a limited_with clause, each parent must be loaded as a limited unit as well. * sem_ch10.adb (Previous_Withed_Unit): Better name for Check_Withed_Unit. Return true if there is a previous with_clause for this unit, whether limited or not. (Expand_Limited_With_Clause): Do not generate a limited_with_clause on the current unit. (Is_Visible_Through_Renamings): New local subprogram of install_limited _withed_unit that checks if some package installed through normal with clauses has a renaming declaration of package whose limited-view is ready to be installed. This enforces the check of the rule 10.1.2 (21/2) of the current Draft document for Ada 2005. (Analyze_Context): Complete the list of compilation units that are allowed to contain limited-with clauses. It also contains checks that were previously done by Install_Limited_Context_Clauses. This makes the code more clear and easy to maintain. (Expand_Limited_With_Clause) It is now a local subprogram of Install_Limited_Context_Clauses, and contains the code that adds the implicit limited-with clauses for parents of child units. This functionality was prevously done by Analyze_Context. * sem_ch4.adb (Analyze_Selected_Component): Check wrong use of incomplete type. * sem_ch7.adb (Analyze_Package_Declaration): Check if the package has been erroneously named in a limited-with clause of its own context. In this case the error has been previously notified by Analyze_Context. From-SVN: r101697
2005-07-04sem_ch4.adb (Transform_Object_Operation): For an actual that is an ↵Thomas Quinot1-1/+13
overloaded function call... 2005-07-04 Thomas Quinot <quinot@adacore.com> * sem_ch4.adb (Transform_Object_Operation): For an actual that is an overloaded function call, carry interpretations from the original tree to the copy. From-SVN: r101587
2005-07-01Update FSF addressR. Kelley Cook1-2/+2
From-SVN: r101492
2005-06-16exp_ch4.adb (Expand_Allocator_Expression): When an initialized allocator's ↵Gary Dismukes1-6/+71
designated type is a class-wide type... 2005-06-14 Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Ed Schonberg <schonberg@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_Allocator_Expression): When an initialized allocator's designated type is a class-wide type, and compiling for Ada 2005, emit a run-time check that the accessibility level of the type given in the allocator's expression is not deeper than the level of the allocator's access type. (Tagged_Membership): Modified to gives support to abstract interface types. * a-tags.ads, a-tags.adb (type Type_Specific_Data): Add component Access_Level. (Descendant_Tag): New predefined function (Is_Descendant_At_Same_Level): New predefined function (Get_Access_Level): New private function (Set_Access_Level): New private procedure (IW_Membership): New function. Given the tag of an object and the tag associated with an interface, evaluate if the object implements the interface. (Register_Interface_Tag): New procedure used to initialize the table of interfaces used by the IW_Membership function. (Set_Offset_To_Top): Initialize the Offset_To_Top field in the prologue of the dispatch table. (Inherit_TSD): Modified to copy the table of ancestor tags plus the table of interfaces of the parent. (Expanded_Name): Raise Tag_Error if the passed tag equals No_Tag. (External_Tag): Raise Tag_Error if the passed tag equals No_Tag. (Parent_Tag): Return No_Tag in the case of a root-level tagged type, and raise Tag_Error if the passed tag equalis No_Tag, to conform with Ada 2005 semantics for the new predefined function. * exp_attr.adb (Expand_N_Attribute, case Attribute_Input): Generate call to Descendant_Tag rather than Internal_Tag. (Expand_N_Attribute, case Attribute_Output): Emit a check to ensure that the accessibility level of the attribute's Item parameter is not deeper than the level of the attribute's prefix type. Tag_Error is raised if the check fails. The check is only emitted for Ada_05. (Find_Stream_Subprogram): If a TSS exists on the type itself for the requested stream attribute, use it. (Expand_N_Attribute_Reference): If the designated type is an interface then rewrite the referenced object as a conversion to force the displacement of the pointer to the secondary dispatch table. (Expand_N_Attribute_Reference, case 'Constrained): Return false if this is a dereference of an object with a constrained partial view. * exp_ch5.adb (Expand_N_Return_Statement): When a function's result type is a class-wide type, emit a run-time check that the accessibility level of the returned object is not deeper than the level of the function's master (only when compiling for Ada 2005). * exp_disp.ads, exp_disp.adb (Ada_Actions, Action_Is_Proc, Action_Nb_Arg): Add entries for new Get_Access_Level and Set_Access_Level routines in these tables. (Make_DT): Generate a call to set the accessibility level of the tagged type in its TSD. (Make_DT): Code cleanup. The functionality of generating all the secondary dispatch tables has been moved to freeze_record_type. (Make_Abstract_Interface_DT): Minor code cleanup. (Set_All_DT_Position): Code cleanup. As part of the code cleanup this subprogram implements a new algorithm that provides the same functionality and it is more clear in case of primitives associated with abstract interfaces. (Set_All_Interfaces_DTC_Entity): Removed. As part of the code clean up, the functionality of this subprogram is now provided by Set_All_DT_Position. (Write_DT): New subprogram: a debugging procedure designed to be called within gdb to display the dispatch tables associated with a tagged type. (Collect_All_Interfaces): New subprogram that collects the whole list of interfaces that are directly or indirectly implemented by a tagged type. (Default_Prim_Op_Position): New subprogram that returns the fixed position in the dispatch table of the default primitive operations. (Expand_Interface_Actuals): New subprogram to generate code that displaces all the actuals corresponding to class-wide interfaces to reference the interface tag of the actual object. (Expand_Interface_Conversion): New subprogram. Reference the base of the object to give access to the interface tag associated with the secondary dispatch table. (Expand_Interface_Thunk): New subprogram that generates the code of the thunk. This is required for compatibility with the C+ ABI. (Make_Abstract_Interface_DT): New subprogram that generate the declarations for the secondary dispatch tables associated with an abstract interface. (Set_All_Interfaces_DTC_Entity): New subprogram that sets the DTC_Entity attribute for each primitive operation covering interface subprograms (Expand_Dispatching_Call, Fill_DT_Entry, Make_DT, Set_All_DT_Position): These subprograms were upgraded to give support to abstract interfaces * rtsfind.ads (type RE_Id): Add RE_Descendant_Tag, RE_Is_Descendant_At_Same_Level, RE_Get_Access_Level, and RE_Set_Access_Level. (RE_Unit_Table): Add entries for new Ada.Tags operations. Add support to call the followig new run-time subprograms: IW_Membership, Register_Interface_Tag, and Set_Offset_To_Top * sem_ch3.adb (Constant_Redeclaration): Allow a deferred constant to match its full declaration when both have an access definition with statically matching designated subtypes. (Analyze_Component_Declaration): Delete commented out code that was incorrectly setting the scope of an anonymous access component's type. (Process_Discriminants): Set Is_Local_Anonymous_Access for the type of an access discriminant when the containing type is nonlimited. (Make_Incomplete_Type_Declaration): Create an incomplete type declaration for a record type that includes self-referential access components. (Check_Anonymous_Access_Types): Before full analysis of a record type declaration, create anonymous access types for each self-referential access component. (Analyze_Component_Declaration, Array_Type_Declaration): Indicate that an access component in this context is a Local_Anonymous_Access, for proper accessibility checks. (Access_Definition): Set properly the scope of the anonymous access type created for a stand-alone access object. (Find_Type_Of_Object): An object declaration may be given with an access definition. (Complete_Subprograms_Derivation): New subprogram used to complete type derivation of private tagged types implementing interfaces. In this case some interface primitives may have been overriden with the partial-view and, instead of re-calculating them, they are included in the list of primitive operations of the full-view. (Build_Derived_Record_Type): Modified to give support to private types implemening interfaces. (Access_Definition): Reject ALL on anonymous access types. (Build_Derived_Record_Type): In the case of Ada 2005, allow a tagged type derivation to occur at a deeper accessibility level than the parent type. For the case of derivation within a generic body however, disallow the derivation if the derived type has an ancestor that is a formal type declared in the formal part of an enclosing generic. (Analyze_Object_Declaration): For protected objects, remove the check that they cannot contain interrupt handlers if not declared at library level. (Add_Interface_Tag_Components): New subprogram to add the tag components corresponding to all the abstract interface types implemented by a record type or a derived record type. (Analyze_Private_Extension_Declaration, Build_Derived_Record_Type, Derived_Type_Declaration, Find_Type_Name, Inherit_Components, Process_Full_View, Record_Type_Declaration): Modified to give support to abstract interface types (Collect_Interfaces): New subprogram that collects the list of interfaces that are not already implemented by the ancestors (Process_Full_View): Set flag Has_Partial_Constrained_View appropriately when partial view has no discriminants and full view has defaults. (Constrain_Access): Reject a constraint on a general access type if the discriminants of the designated type have defaults. (Access_Subprogram_Declaration): Associate the Itype node with the inner full-type declaration or subprogram spec. This is required to handle nested anonymous declarations. (Analyze_Private_Extension_Declaration, Build_Derived_Record_Type, Derived_Type_Declaration, Find_Type_Name, Inherit_Components, Process_Full_View, Record_Type_Declaration): Modified to give support to abstract interface types (Derive_Subprograms): Addition of a new formal to indicate if we are in the case of an abstact-interface derivation (Find_Type_Of_Subtype_Indic): Moved from the body of the package to the specification because it is requied to analyze all the identifiers found in a list of interfaces * debug.adb: Complete documentation of flag "-gnatdZ" * exp_ch3.adb: Implement config version of persistent_bss pragma (Check_Stream_Attributes): Use Stream_Attribute_Available instead of testing for TSS presence to properly enforce visibility rules. (Freeze_Record_Type): Code cleanup. Modified to call the subprogram Make_Abstract_Interfaces_DT to generate the secondary tables associated with abstract interfaces. (Build_Init_Procedure): Modified to initialize all the tags corresponding. (Component_Needs_Simple_Initialization): Similar to other tags, interface tags do not need initialization. (Freeze_Record_Type): Modified to give support to abstract interface types. (Expand_N_Object_Declaration): Do not generate an initialization for a scalar temporary marked as internal. * exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Handle properly an in-out parameter that is a component in an initialization procedure, whose constraint might depend on discriminants, and that may be misaligned because of packing or representation clauses. (Is_Legal_Copy): New predicate to determine whether a possibly misaligned in-out actual can actually be passed by copy/return. This is an error in case the type is by_reference, and a warning if this is the consequence of a DEC import pragma on the subprogram. (Expand_Call, Freeze_Subprogram): Modified to give support to abstract interface types (Expand_Inlined_Call): Mark temporary generated for the return value as internal, so that no useless scalar normalization is generated for it. (Expand_N_Subprogram_Declaration): Save unanalyzed body so calls to null procedure can always be inlined. (Expand_N_Subprogram_Declaration): If this is the declaration of a null procedure, generate an explicit empty body for it. * exp_util.ads, exp_util.adb (Find_Interface_ADT): New subprogram. Given a type implementing an interface, returns the corresponding access_disp_table value. (Find_Interface_Tag): New subprogram. Given a type implementing an interface, returns the record component containing the tag of the interface. (Find_Interface_Tag): New overloaded subprogram. Subsidiary to the previous ones that return the corresponding tag and access_disp_table entities. (Is_Predefined_Dispatching_Operation): Determines if a subprogram is a predefined primitive operation. (Expand_Subtype_From_Expr): If the expression is a selected component within an initialization procedure, compute its actual subtype, because the component may depend on the discriminants of the enclosing record. * i-cpp.ads, i-cpp.adb: This package has been left available for compatibility with previous versions of the frontend. As part of the new layout this is now a dummy package that uses declarations available at a-tags.ads * par-ch3.adb (P_Identifier_Declarations): Give an error for use of "constant access" and "aliased [constant] access" when not compiling with -gnat05. Suppress Ada 2005 keyword warning if -gnatwY used (P_Identifier_Declarations): Add support for object declarations with access definitions. (Private_Extension_Declaration): Complete the documentation (P_Derived_Type_Def_Or_Private_Ext_Decl): Fill the inteface_list attribute in case of private extension declaration (P_Type_Declaration): Mark as "abstract" the type declarations corresponding with protected, synchronized and task interfaces (P_Declarative_Items): "not" and "overriding" are overriding indicators for a subprogram or instance declaration. * sem_ch12.adb (Analyze_Subprogram_Instantiation): Verify that an instantiation that is a dispatching operation has controlling access parameters that are null excluding. Save and restore Ada_Version_Explicit, for implementation of AI-362 (Validate_Derived_Type_Instance): Add check for abstract interface types. (Analyze_Formal_Package): Establish Instantiation source for the copy of the generic that is created to represent the formal package. (Analyze_Package_Instantiation): Instantiate body immediately if the package is a predefined unit that contains inlined subprograms, and we are compiling for a Configurable_Run_Time. (Instantiate_Formal_Subprogram): Indicate that null default subprogram If the program has a null default, generate an empty body for it. * sem_ch6.adb, sem_ch9.adb (Analyze_Subprograms_Declaration): Update error message condition, null procedures are correctly detected now. (New_Overloaded_Entity): Bypass trivial overriding indicator check for subprograms in the context of protected types. Instead, the indicator is examined in Sem_Ch9 while analysing the subprogram declaration. (Check_Overriding_Indicator): Check consistency of overriding indicator on subprogram stubs as well. (Analyze_Subprogram_Declaration): Diagnose null procedures declared at the library level. (Analize_Subprogram_Specification): When analyzing a subprogram in which the type of the first formal is a concurrent type, replace this type by the corresponding record type. (Analyze_Subprogram_Body): Undo the previous work. (Analyze_Procedure_Call): If the call has the form Object.Op, the analysis of the prefix ends up analyzing the call itself, after which we are done. (Has_Interface_Formals): New subprogram subsidiary to analyze subprogram_specification that returns true if some non class-wide interface subprogram is found (New_Overloaded_Entity): Modified to give support to abstract interface types (Conforming_Types): In Ada 2005 mode, conformance checking of anonymous access to subprograms must be recursive. (Is_Unchecked_Conversion): Improve the test that recognizes instantiations of Unchecked_Conversion, and allows them in bodies that are to be inlined by the front-end. When the body comes from an instantiation, a reference to Unchecked_Conversion will be an Expanded_Name, even though the body has not been analyzed yet. Replace Is_Overriding and Not_Overriding in subprogram_indication with Must_Override and Must_Not_Override, to better express intent of AI. (Analyze_Subprogram_Body): If an overriding indicator is given, check that it is consistent with the overrinding status of the subprogram at this point. (Analyze_Subprogram_Declaration): Indicate that a null procedure is always inlined. If the subprogram is a null procedure, indicate that it does not need a completion. * sem_disp.adb (Check_Controlling_Type): Give support to entities available through limited-with clauses. (Check_Dispatching_Operation): A stub acts like a body, and therefore is allowed as the last primitive of a tagged type if it has no previous spec. (Override_Dispatching_Operation, Check_Dispatching_Operation): Modified to give support to abstract interface types * sem_res.adb (Valid_Conversion): Perform an accessibility level check in the case where the target type is an anonymous access type of an object or component (that is, when Is_Local_Anonymous_Access is true). Prevent the special checks for conversions of access discriminants in the case where the discriminant belongs to a nonlimited type, since such discriminants have their accessibility level defined in the same way as a normal component of an anonymous access type. (Resolve_Allocator): When an allocator's designated type is a class-wide type, check that the accessibility level of type given in the allocator's expression or subtype indication is not statically deeper than the level of the allocator's access type. (Check_Discriminant_Use): Diagnose discriminant given by an expanded name in a discriminant constraint of a record component. (Resolve_Explicit_Dereference): Do not check whether the type is incomplete when the dereference is a use of an access discriminant in an initialization procedure. (Resolve_Type_Conversion): Handle conversions to abstract interface types. (Valid_Tagged_Conversion): The conversion of a tagged type to an abstract interface type is always valid. (Valid_Conversion): Modified to give support to abstract interface types (Resolve_Actuals): Enable full error reporting on view conversions between unrelated by_reference array types. The rule for view conversions of arrays with aliased components is weakened in Ada 2005. Call to obsolescent subprogram is now considered to be a violation of pragma Restrictions (No_Obsolescent_Features). (Check_Direct_Boolean_Operator): If the boolean operation has been constant-folded, there is nothing to check. (Resolve_Comparison_Op, Resolve_Equality_Op, Resolve_Boolean_Op): Defer check on possible violation of restriction No_Direct_Boolean_Operators until after expansion of operands, to prevent spurious errors when operation is constant-folded. * sem_type.ads, sem_type.adb (Covers, Intersect_Types, Specific_Type, Has_Compatible_Type): Modified to give support to abstract interface types. (Interface_Present_In_Ancestor): New function to theck if some ancestor of a given type implements a given interface * sem_ch4.adb (Analyze_Call): Handle properly an indirect call whose prefix is a parameterless function that returns an access_to_procedure. (Transform_Object_Operation): Handle properly function calls of the form Obj.Op (X), which prior to analysis appear as indexed components. (Analyze_One_Call): Complete the error notification to help new Ada 2005 users. (Analyze_Allocator): For an allocator without an initial value, where the designated type has a constrained partial view, a discriminant constraint is illegal. From-SVN: r101024
2005-03-29sem_ch4.adb (Analyze_Selected_Component): Do not generate an actual subtype ↵Ed Schonberg1-26/+55
if code is being pre-analyzed... 2005-03-29 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Do not generate an actual subtype if code is being pre-analyzed, to prevent un-expanded references to protected formals, among others. (Analyze_Explicit_Dereference): If the overloaded prefix includes some interpretation that can be a call, include the result of the call as a possible interpretation of the dereference. * sem_ch5.adb (Process_Bounds): Determine type of range by pre-analyzing a copy of the original range, and then analyze the range with the expected type. * sem_res.adb (Check_Parameterless_Call): For an explicit dereference with an overloaded prefix where not all interpretations yield an access to subprogram, do not rewrite node as a call. (Resolve_Explicit_Dereference): Recognize the previous case and rewrite the node as a call once the context identifies the interpretation of the prefix whose call yields the context type. (Valid_Conversion): For the case of a conversion between local access-to-subprogram types, check subtype conformance using Check_Subtype_Conformant instead of Subtype_Conformant, to have a more detailed error message. From-SVN: r97184
2005-03-18sem_ch4.adb (Try_Primitive_Operation, [...]): Analyze the object that is ↵Javier Miranda1-3/+10
accessible through the prefix of the subprogram call... 2005-03-17 Javier Miranda <miranda@adacore.com> * sem_ch4.adb (Try_Primitive_Operation, Class_Wide_Operation and Try_Object_Operation): Analyze the object that is accessible through the prefix of the subprogram call before we apply the transformation of the object-operation notation. From-SVN: r96674
2005-03-15sem_ch4.adb (Analyze_Concatenation): Do not consider operators marked ↵Ed Schonberg1-6/+16
Eliminated as candidates for resolution. 2005-03-08 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Concatenation): Do not consider operators marked Eliminated as candidates for resolution. Both efficient, and avoids anomalies with operators declared in deleted code. (Process_Implicit_Dereference_Prefix): Use this procedure whenever expansion is disabled (as when compiling a generic) to prevent spurious warnings on prefixes of selected components. From-SVN: r96505
2005-02-10sem_ch4.adb (Analyze_Selected_Component): Create Actual_Subtype even with ↵Arnaud Charlet1-12/+17
expansion disabled. * sem_ch4.adb (Analyze_Selected_Component): Create Actual_Subtype even with expansion disabled. The actual subtype is needed among other places when the selected component appears in the context of a loop bound, and denotes a packed array. (Operator_Check): Always use the first subtype in the error message, to avoid the appearance of internal base types. (Transform_Object_Operation): Copy each actual in full to the parameter associations of the constructed call, rather than using the shallow copy mechanism of New_Copy_List. This ensures that the chaining of named associations is done properly. (Complete_Object_Operation): Rewrite node, rather than replacing it, so that we can trace back to the original selected component. * sem_elab.adb (Set_Elaboration_Constraint): For initialization calls, and calls that use object notation, if the called function is not declared in a withed unit, place the elaboration constraint on the unit in the context that makes the function accessible. (Check_Elab_Subtype_Declaration): Check whether a subtype declaration imposes an elaboration constraint between two packages. From-SVN: r94820
2005-01-03sem_ch4.adb (Has_Fixed_Op): New predicate in Check_Arithmetic_Pair...Arnaud Charlet1-15/+78
* sem_ch4.adb (Has_Fixed_Op): New predicate in Check_Arithmetic_Pair, to determine whether one of the operands is a fixed-point type for which a user-defined multiplication or division operation might be defined. * sem_res.adb (Valid_Conversion): The legality rules for conversions of access types are symmetric in Ada 2005: either designated type can be unconstrained. From-SVN: r92849
2004-12-08sem_ch4.adb (Process_Implicit_Dereference_Prefix): New subprogram used to ↵Arnaud Charlet1-43/+68
record an implicit dereference as a read operation on... * sem_ch4.adb (Process_Implicit_Dereference_Prefix): New subprogram used to record an implicit dereference as a read operation on its prefix when operating under -gnatc. Necessary to avoid spurious 'variable assigned but never read' warnings in that mode. (Process_Indexed_Component, Analyze_Selected_Component): When the prefix is a non-overloaded implicit dereference, call the above subprogram to ensure proper recording of references. From-SVN: r91892
2004-11-19exp_ch4.adb (Expand_N_Selected_Component): If the component is the ↵Arnaud Charlet1-6/+24
discriminant of a constrained subtype... * exp_ch4.adb (Expand_N_Selected_Component): If the component is the discriminant of a constrained subtype, analyze the copy of the corresponding constraint, because in some cases it may be only partially analyzed. Removes long-lived ??? comments. * exp_ch7.adb (Establish_Transient_Scope): Remove complex code that handled controlled or secondary-stack expressions within the iteration_scheme of a loop. * sem_ch5.adb (Analyze_Iteration_Scheme): Build a block to evaluate bounds that may contain functions calls, to prevent memory leaks when the bound contains a call to a function that uses the secondary stack. (Check_Complex_Bounds): Subsidiary of Analyze_Iteration_Scheme, to generate temporaries for loop bounds that might contain function calls that require secondary stack and/or finalization actions. * sem_ch4.adb (Analyze_Indexed_Component_Form): If the prefix is a selected component and the selector is overloadable (not just a function) treat as function call, Analyze_Call will disambiguate if necessary. (Analyze_Selected_Component): Do not generate an actual subtype for the selected component if expansion is disabled. The actual subtype is only needed for constraint checks. (Analyze_Allocator): If restriction No_Streams is set, then do not permit objects to be declared of a stream type, or of a composite type containing a stream. * restrict.ads: Remove the a-stream entry from Unit_Array, since No_Streams no longer prohibits with'ing this package. * sem_ch3.adb (Build_Derived_Record_Type): If the parent type has discriminants, but the parent base has unknown discriminants, there is no discriminant constraint to inherit. Such a discrepancy can arise when the actual for a formal type with unknown discriminants is a similar private type whose full view has discriminants. (Analyze_Object_Declaration): If restriction No_Streams is set, then do not permit objects to be declared of a stream type, or of a composite type containing a stream. From-SVN: r90906
2004-10-27a-filico.ads, [...]: fix incorrect header.Arnaud Charlet1-1/+1
* a-filico.ads, a-filico.adb: fix incorrect header. * a-ststio.ads: Fix typo in identifier * sem_ch4.adb: Minor reformatting. From-SVN: r89644
2004-10-04sem_ch4.adb (Try_Object_Operation): Reformat the code to expand in-line the ↵Javier Miranda1-36/+19
code corresponding to subprogram... 2004-10-04 Javier Miranda <miranda@gnat.com> * sem_ch4.adb (Try_Object_Operation): Reformat the code to expand in-line the code corresponding to subprogram Analyze_Actuals. In addition, analyze the actuals only in case of subprogram call. From-SVN: r88506
2004-08-16[multiple changes]Arnaud Charlet1-340/+404
2004-08-16 Pascal Obry <obry@gnat.com> * adaint.c (__gnat_prj_add_obj_files): Set to 0 only on Win32 for GCC backend prior to GCC 3.4. With GCC 3.4 we are using the GCC's shared option and not mdll anymore. Update comment. 2004-08-16 Pascal Obry <obry@gnat.com> * bld.adb (Put_Include_Project): Properly handle directory separators on Windows. 2004-08-16 Ed Schonberg <schonberg@gnat.com> * sem_ch4.adb (Try_Object_Operation): Restructure code. Optimize by decreasing the number of allocated junk nodes while searching for the appropriate subprogram. From-SVN: r86049
2004-08-09[multiple changes]Arnaud Charlet1-29/+39
2004-08-09 Thomas Quinot <quinot@act-europe.fr> * g-socket.adb (Abort_Selector): Initialize Buf to prevent valgrind from complaining on potential uninitialized reference. Change calls to GNAT.Sockets.Thin.Is_Socket_In_Set to account for new specification and test explicitly for non-zero return value. * g-socthi.ads (Is_Socket_In_Set): Declare imported function as returning C.int, to avoid using a derived boolean type. * exp_ch5.adb (Make_Tag_Ctrl_Assignments): Use Duplicate_Subexpr_No_Checks in preference to direct use of Remove_Side_Effects and New_Copy_Tree. Clear Comes_From_Source on prefix of 'Size attribute reference. * g-socthi.adb, g-socthi-vms.adb, g-socthi-mingw.adb, g-socthi-vxworks.adb: Change calls to GNAT.Sockets.Thin.Is_Socket_In_Set to account for new specification and test explicitly for non-zero return value. * g-socthi-vms.ads, g-socthi-mingw.ads, g-socthi-vxworks.ads: (Is_Socket_In_Set): Declare imported function as returning C.int, to avoid using a derived boolean type. 2004-08-09 Albert Lee <lee@gnat.com> * system-irix-n32.ads: Refine tasking priority constants for IRIX. 2004-08-09 Pascal Obry <obry@gnat.com> * gnat_ugn.texi: Document new way to build DLLs on Windows using GCC's -shared option. * mlib-tgt-mingw.adb (Build_Dynamic_Library): Pass GCC's options into Options_2 parameter (options put after object files). 2004-08-09 Olivier Hainque <hainque@act-europe.fr> * decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Adjust condition to ignore overflows on low and high bounds of an index to also account for differences in signedness between sizetype and gnu_index_subtype. These are as legitimate as the ones caused by a lower TYPE_PRECISION on sizetype. 2004-08-09 Robert Dewar <dewar@gnat.com> * s-solita.ads, s-solita.adb: Minor reformatting * gnat_rm.texi: Add documentation for pragma Profile (Restricted) Move pragma Restricted_Run_Time, No_Run_Time, Ravenscar to new obsolescent section Add note that No_Implicit_Conditionals does not suppress run time constraint checks. * vms_conv.ads: Minor reformatting * s-secsta.adb: Use SS_Ptr instead of Mark_Id as stack pointer (cleanup and necessary for following change). (Mark): Return new format Mark_Id containing sec stack address (Release): Use sec stack address from Mark_Id avoiding Self call * s-secsta.ads: Define SS_Ptr to be used instead of Mark_Id as stack pointer (cleanup and necessary for following change). Define Mark_Id as record containing address of secondary stack, that way Release does not need to find the stack again, decreasing the number of calls to Self and improving efficiency. * sem_util.ads: Add a ??? comment for Is_Local_Variable_Reference * sem_ch5.adb (Analyze_Case_Statement): Add circuitry to track value of case variable into the individual case branches when possible. * sem_ch11.adb: Minor reformatting * prj.ads: Correct spelling of suffixs * prj-nmsc.adb: Minor reformatting Correct spelling suffixs throughout (also in identifiers) * freeze.adb: Minor spelling correction * exp_ch2.adb: Cleanups to handling of Current_Value (no functional effect). * bld.adb: Correct spelling of suffixs * einfo.adb (Enclosing_Dynamic_Scope): Defend against junk argument 2004-08-09 Ed Schonberg <schonberg@gnat.com> PR ada/15408 * sem_ch7.adb (Install_Private_Declarations): In the body of the package or of a child, private entities are both immediately_visible and not hidden. 2004-08-09 Ed Schonberg <schonberg@gnat.com> * sem_eval.adb (Eval_Integer_Literal): If the context is Any_Integer, there are no range checks on the value of the literal. * exp_ch7.adb (Insert_Actions_In_Scope_Around): If the node being wrapped is the triggering alternative of an asynchronous select, action statements mustbe inserted before the select itself. * sem_attr.adb (Analyze_Attribute, case 'Size): Handle properly the case where the prefix is a protected function call. (Resolve_Attribute, case 'Access): The attribute reference on a subprogram is legal in a generic body if the subprogram is declared elsewhere. 2004-08-09 Vincent Celier <celier@gnat.com> * makegpr.adb (Build_Library): Link with g++ if C++ is one of the languages, otherwise building the library may fail with unresolved symbols. (Compile_Sources): Do not build libraries if -c switch is used * gnatlink.adb (Process_Args): New switches -M and -Mmap (Write_Usage): If map file creation is supported, output new switches -M and -Mmap. (Gnatlink): When -M is specified, add the necessary switch(es) to the gcc call, when supported. * Makefile.in: Added indepsw.o to the object list for gnatlink Specified the AIX, GNU/Linux and Windows versions of indepsw.adb * indepsw-aix.adb, indepsw-linux.adb, indepsw-mingw.adb, indepsw.adb, indepsw.ads: New files. 2004-08-09 Bernard Banner <banner@gnat.com> * system-vxworks-x86.ads, s-vxwork-x86.ads: New files. * Makefile.in: add section for vxworks x86 2004-08-09 Hristian Kirtchev <kirtchev@gnat.com> * exp_ch3.adb (Build_Init_Statements): Add extra condition to deal with per-object constrained components where the discriminant is of an Access type. (Build_Record_Init_Proc): Add condition to prevent the inheritance of the parent initialization procedure for derived Unchecked_Unions. Instead, derived Unchecked_Unions build their own initialization procedure. (Build_Variant_Record_Equality): Implement Unchecked_Union equality. Check the body of the subprogram for details. (Freeze_Record_Type): Prevent the inheritance of discriminant checking functions for derived Unchecked_Union types by introducing a condition. Allow the creation of TSS equality functions for Unchecked_Unions. (Make_Eq_Case): Rename formal parameter Node to E in function signature. Add formal parameter Discr to function signature. Discr is used to control the generated case statement for Unchecked_Union types. (Make_Eq_If): Rename formal parameter Node to E in function signature. * exp_ch4.adb (Build_Equality_Call): Implement equality calls for Unchecked_Unions. Check the body of the subprogram for details. (Expand_Composite_Equality): Augment composite type equality to include correct handling of Unchecked_Union components. (Expand_N_In): Add condition to detect illegal membership tests when the subtype mark is a constrained Unchecked_Union and the expression lacks inferable discriminants, and build a Raise_Program_Error node. (Expand_N_Op_Eq): Add function Has_Unconstrained_UU_Component. Used to detect types that contain components of unconstrained Unchecked_Union subtype. Add condition to detect equality between types that have an unconstrained Unchecked_Union component, and build a Raise_Program_Error node. Add condition to detect equality between Unchecked_Union types that lack inferable discriminants, and build a Raise_Program_Error node. Otherwise build a TSS equality function call. (Expand_N_Type_Conversion): Add condition to detect illegal conversions from a derived Unchecked_Union to an unconstrained non-Unchecked_Union with the operand lacking inferable discriminants, and build a Raise_ Program_Error node. (Expand_Record_Equality): Remove guard that prevents Unchecked_Union composite equality. (Has_Inferable_Discriminants): Implement new predicate for objects and expressions of Unchecked_Union type. Check the body of subprogram for details. (Has_Unconstrained_UU_Components): Add function Component_Is_Unconstrained_UU. It is used to detect whether a single component is of an unconstrained Unchecked_Union subtype. Add function Variant_Is_Unconstrained_UU. It is used to detect whether a single component inside a variant is of an unconstrained Unchecked_Union type. * exp_ch5.adb (Expand_Assign_Record): Add condition to copy the inferred discriminant values. Add condition to generate a case statement with an inferred discriminant as the switch. (Make_Component_List_Assign): Introduce a Boolean flag that determines the behaviour of the subprogram in the presence of an Unchecked_Union. Add condition to trigger the usage of the inferred discriminant value as the generated case statement switch. (Make_Field_Assign): Introduce a Boolean flag that determines the behaviour of the subprogram in the presence of an Unchecked_Union. Add condition to trigger the usage of the inferred discriminant value as the right-hand side of the generated assignment. * exp_ch6.adb (Expand_Call): Add condition to skip extra actual parameter generation when dealing with Unchecked_Unions. * checks.adb (Apply_Discriminant_Check): Do not apply discriminant checks for Unchecked_Unions. * einfo.ads: Update comment on usage of flag Has_Per_Object_Constraint * exp_attr.adb (Expand_N_Attribute_Reference): Produce Raise_Program_Error nodes for the execution of Read and Write attributes of Unchecked_Union types and the execution of Input and Output attributes of Unchecked_Union types that lack default discriminant values. * sem_prag.adb (Analyze_Pragma): Remodel the analysis of pragma Unchecked_Union. Add procedure Check_Component. It is used to inspect per-object constrained components of Unchecked_Unions for being Unchecked_Unions themselves. Add procedure Check_Variant. It is used to check individual components withing a variant. * sem_res.adb (Resolve_Comparison_Op): Remove guard that prevents comparison of Unchecked_Unions. (Resolve_Equality_OP): Remove guard that prevents equality between Unchecked_Unions. * sem_util.adb (Build_Component_Subtype): Add guard to prevent creation of component subtypes for Unchecked_Union components. (Get_Actual_Subtype): Add condition that returs the Unchecked_Union type since it is the actual subtype. * sem_ch12.adb (Instantiate_Type): Add condition to detect the correct pass of Unchecked_Union subtypes as generic actuals to formal types that lack known_discriminant_parts or that are derived Unchecked_Union types, and do nothing. In any other case, produce an error message. * sem_ch3.adb (Analyze_Component_Declaration): Add function Contains_POC. It determines whether a constraint uses the discriminant of an enclosing record type. Add condition to detect per-object constrained component and set the appropriate flag. (Derived_Type_Declaration): Remove guard that prevents derivation from Unchecked_Union types. (Process_Subtype): Remove quard that prevents the creation of Unchecked_ Union subtypes. * sem_ch4.adb (Analyze_Selected_Component): Correct the detection of references to Unchecked_Union discriminants. * sem_ch6.adb (Create_Extra_Formals): Add condition to skip extra formal generation when dealing with Unchecked_Unions. (Set_Actual_Subtypes): Add condition to prevent generation of actual subtypes for Unchecked_Unions. * sem_ch7.adb (Analyze_Package_Specification): Add procedure Inspect_Unchecked_Union_Completion. It is used to detect incorrect completions of discriminated partial views by Unchecked_Unions and produce an error message. 2004-08-09 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c (struct stmt_group): New field, GLOBAL. (global_stmt_group, gnu_elab_proc_decl, build_unit_elab): Deleted. (struct elab_info): New struct. (elab_info_list, gnu_elab_proc_stack): New variables. (Compilation_Unit_to_gnu): New procedure. (gigi): Call it and also handle elaboration procs we've saved. (gnat_init_stmt_group): Don't set global_stmt_group; instead initialize global field from parent. (gnat_to_gnu): Get decl from gnu_elab_proc_stack. (gnat_to_gnu, case N_Compilation_Unit): Call Compilation_Unit_to_gnu. (start_stmt_group): Initialize global field from parent. (add_decl_expr): Set to global for current statement group. (gnat_gimplify_expr, case NULL_EXPR): Add operand 0 to pre list, not post. * utils.c (global_bindings_p): True when no current_function_decl; no longer check current_binding_level. 2004-08-09 Ben Brosgol <brosgol@gnat.com> * xgnatugn.adb: Added logic to deal with @ifset/@ifclear for edition choice. * gnat_rm.texi, gnat_ugn.texi: Added edition conditionalization logic. From-SVN: r85714
2004-07-20[multiple changes]Arnaud Charlet1-0/+318
2004-07-20 Olivier Hainque <hainque@act-europe.fr> * a-elchha.adb (Last_Chance_Handler): Remove the bogus buffer dynamic allocation and potentially overflowing update with Tailored_Exception_Information. Use the sec-stack free procedural interface to output Exception_Information instead. * a-except.adb (To_Stderr): New subprogram for character, and string version moved from a-exextr to be visible from other separate units. (Tailored_Exception_Information): Remove the procedural version, previously used by the default Last_Chance_Handler and not any more. Adjust various comments. * a-exexda.adb: Generalize the exception information procedural interface, to minimize the use of secondary stack and the need for local buffers when the info is to be output to stderr: (Address_Image): Removed. (Append_Info_Character): New subprogram, checking for overflows and outputing to stderr if buffer to fill is of length 0. (Append_Info_String): Output to stderr if buffer to fill is of length 0. (Append_Info_Address, Append_Info_Exception_Name, Append_Info_Exception_Message, Append_Info_Basic_Exception_Information, Append_Info_Basic_Exception_Traceback, Append_Info_Exception_Information): New subprograms. (Append_Info_Nat, Append_Info_NL): Use Append_Info_Character. (Basic_Exception_Info_Maxlength, Basic_Exception_Tback_Maxlength, Exception_Info_Maxlength, Exception_Name_Length, Exception_Message_Length): New subprograms. (Exception_Information): Use Append_Info_Exception_Information. (Tailored_Exception_Information): Use Append_Info_Basic_Exception_Information. Export services for the default Last_Chance_Handler. * a-exextr.adb (To_Stderr): Remove. Now in a-except to be usable by other separate units. 2004-07-20 Vincent Celier <celier@gnat.com> * clean.adb, mlib-utl.adb, osint.adb, makegpr.adb: Minor reformatting. 2004-07-20 Ed Schonberg <schonberg@gnat.com> * freeze.adb (Freeze_Entity): If entity is a discriminated record type, emit itype references for the designated types of component types that are declared outside of the full record declaration, and that may denote a partial view of that record type. 2004-07-20 Ed Schonberg <schonberg@gnat.com> PR ada/15607 * sem_ch3.adb (Build_Discriminated_Subtype): Do not attach a subtype which is the designated type in an access component declaration, to the list of incomplete dependents of the parent type, to avoid elaboration issues with out-of-scope subtypes. (Complete_Private_Subtype): Recompute Has_Unknown_Discriminants from the full view of the parent. 2004-07-20 Ed Schonberg <schonberg@gnat.com> PR ada/15610 * sem_ch8.adb (Find_Expanded_Name): If name is overloaded, reject entities that are hidden, such as references to generic actuals outside an instance. 2004-07-20 Javier Miranda <miranda@gnat.com> * sem_ch4.adb (Try_Object_Operation): New subprogram that gives support to the new notation. (Analyze_Selected_Component): Add call to Try_Object_Operation. 2004-07-20 Jose Ruiz <ruiz@act-europe.fr> * s-taprob.adb: Adding the elaboration code required for initializing the tasking soft links that are common to the full and the restricted run times. * s-tarest.adb (Init_RTS): Tasking soft links that are shared with the restricted run time has been moved to the package System.Soft_Links.Tasking. * s-tasini.adb (Init_RTS): Tasking soft links that are shared with the restricted run time has been moved to the package System.Soft_Links.Tasking. * Makefile.rtl: Add entry for s-solita.o in run-time library list. * s-solita.ads, s-solita.adb: New files. 2004-07-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * trans.c (Identifier_to_gnu, Pragma_to_gnu, Attribute_to_gnu, Case_Statement_to_gnu): Split off from gnat_to_gnu. (Loop_Statement_to_gnu, Subprogram_Body_to_gnu, call_to_gnu, Handled_Sequence_Of_Statements_to_gnu, Exception_Handler_to_gnu_sjlj, Exception_Handler_to_gnu_zcx): Likewise. From-SVN: r84948
2004-07-15[multiple changes]Arnaud Charlet1-5/+1
2004-07-15 Robert Dewar <dewar@gnat.com> * makegpr.adb, s-secsta.ads, sem_ch3.adb, sem_case.adb: Minor reformatting * gnat_ugn.texi: Add instantiation of direct_io or sequential_io with access values as an example of a warning. * gnat_rm.texi: Document new attribute Has_Access_Values * gnat-style.texi: Document that box comments belong on nested subprograms * sem_util.ads (Has_Access_Values): Improved documentation * s-finimp.ads, s-finimp.adb: Fix spelling error in comment * sem_prag.adb (Check_Duplicated_Export_Name): New procedure (Process_Interface_Name): Call to this new procedure (Set_Extended_Import_Export_External_Name): Call to this new procedure * s-mastop-x86.adb, 9drpc.adb: Fix spelling error in comment * a-direio.ads, a-sequio.ads: Warn if Element_Type has access values * einfo.ads: Minor comment typo fixed 2004-07-15 Jose Ruiz <ruiz@act-europe.fr> * snames.adb: Add _atcb. * snames.ads: Add Name_uATCB. * s-tarest.adb (Create_Restricted_Task): ATCBs are always preallocated (in the expanded code) when using the restricted run time. * s-tarest.ads (Create_Restricted_Task): Created_Task transformed into a in parameter in order to allow ATCBs to be preallocated (in the expanded code). * s-taskin.adb (Initialize_ATCB): T converted into a in parameter in order to allow ATCBs to be preallocated. In case of error, the ATCB is deallocated in System.Tasking.Stages. * s-taskin.ads (Initialize_ATCB): T converted into a in parameter in order to allow ATCBs to be preallocated. * s-tassta.adb (Create_Task): In case of error the ATCB is deallocated here. It was previously done in Initialize_ATCB. * rtsfind.ads: Make the Ada_Task_Control_Block visible. * exp_ch9.adb: Preallocate the Ada_Task_Control_Block when using the Restricted run time. * exp_ch3.adb: When using the Restricted run time, pass the preallocated Ada_Task_Control_Block when creating a task. 2004-07-15 Ed Schonberg <schonberg@gnat.com> * sem_util.adb (Normalize_Actuals): If there are no actuals on a function call that is itself an actual in an enclosing call, diagnose problem here rather than assuming that resolution will catch it. * sem_ch7.adb (Analyze_Package_Specification): If the specification is the local copy of a generic unit for a formal package, and the generic is a child unit, install private part of ancestors before compiling private part of spec. * sem_cat.adb (Validate_Categorization_Dependency): Simplify code to use scope entities rather than tree structures, to handle properly parent units that are instances rewritten as bodies for inlining purposes. * sem_ch10.adb (Get_Parent_Entity, Implicit_With_On_Parent, Remove_Parents): Handle properly a parent unit that is an instantiation, when the unit has been rewritten as a body for inlining purposes. * par.adb (Goto_List): Global variable to collect goto statements in a given unit, for use in detecting natural loops. * par-ch5.adb (P_Goto_Statement): Add goto to global Goto_List, for use in detecting natural loops. * par-labl.adb (Find_Natural_Loops): Recognize loops create by backwards goto's, and rewrite as a infinite loop, to improve locality of temporaries. * exp_util.adb (Force_Evaluation): Recognize a left-hand side subcomponent that includes an indexed reference, to prevent the generation of copies that would miscompile the desired assignment statement. (Build_Task_Image_Decls): Add a numeric suffix to generated name for string variable, to avoid spurious conflicts with the name of the type of a single protected object. * exp_ch4.adb (Expand_Array_Equality): If indices are distinct, use a loop with an explicit exit statement, to avoid generating an out-of-range value with 'Succ leading to spurious constraint_errors when compiling with -gnatVo. 2004-07-15 Thomas Quinot <quinot@act-europe.fr> * sem_ch4.adb (Analyze_Slice): Always call Analyze on the prefix: it might not be analyzed yet, even if its Etype is already set (case of an unchecked conversion built using Unchecked_Convert_To, for example). If the prefix has already been analyzed, this will be a nop anyway. * exp_ch5.adb (Make_Tag_Ctrl_Assignment): For an assignment of a controller type, or an assignment of a record type with controlled components, copy only user data, and leave the finalization chain pointers untouched. 2004-07-15 Vincent Celier <celier@gnat.com> * make.adb (Collect_Arguments): Improve error message when attempting to compile a source not part of any project, when -x is not used. * prj.ads: (Defined_Variable_Kind): New subtype * prj-attr.adb (Register_New_Package): Two new procedures to register a package with or without its attributes. (Register_New_Attribute): Mew procedure to register a new attribute in a package. New attribute oriented subprograms: Attribute_Node_Id_Of, Attribute_Kind_Of, Set_Attribute_Kind_Of, Attribute_Name_Of, Variable_Kind_Of, Set_Variable_Kind_Of, Optional_Index_Of, Next_Attribute. New package oriented subprograms: Package_Node_Id_Of, Add_Unknown_Package, First_Attribute_Of, Add_Attribute. * prj-attr.ads (Attribute_Node_Id): Now a private, self initialized type. (Package_Node_Id): Now a private, self initialized type (Register_New_Package): New procedure to register a package with its attributes. New attribute oriented subprograms: Attribute_Node_Id_Of, Attribute_Kind_Of, Set_Attribute_Kind_Of, Attribute_Name_Of, Variable_Kind_Of, Set_Variable_Kind_Of, Optional_Index_Of, Next_Attribute. New package oriented subprograms: Package_Node_Id_Of, Add_Unknown_Package, First_Attribute_Of, Add_Attribute. * prj-dect.adb (Parse_Attribute_Declaration, Parse_Package_Declaration): Adapt to new spec of Prj.Attr. * prj-makr.adb (Make): Parse existing project file before creating other files. Fail if there was an error during parsing. * prj-proc.adb (Add_Attributes, Process_Declarative_Items): Adapt to new spec of Prj.Attr. * prj-strt.adb (Attribute_Reference, Parse_Variable_Reference): Adapt to new spec of Prj.Attr. 2004-07-15 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * utils2.c: Fix typo in comment. From-SVN: r84774
2004-07-06[multiple changes]Arnaud Charlet1-6/+6
2004-07-06 Vincent Celier <celier@gnat.com> * vms_conv.ads: Minor reformatting. Alphabetical order for enumerated values of type Command_Type, to have the command in alphabetical order for the usage. * vms_conv.adb (Process_Argument): Set Keep_Temporary_Files to True for the special qualifier /KEEP_TEMPORARY_FILES (minimum 6 characters). * gnat_ugn.texi: Document new switch -dn for the GNAT driver. * makegpr.adb (Global_Archive_Exists): New global Boolean variable (Add_Archive_Path): Only add the global archive if there is one. (Build_Global_Archive): Set Global_Archive_Exists depending if there is or not any object file to put in the global archive, and don't build a global archive if there is none. (X_Switches): New table (Compile_Link_With_Gnatmake): Pass to gnatmake the -X switches stored in the X_Switches table, if any. (Initialize): Make sure the X_Switches table is empty (Scan_Arg): Record -X switches in table X_Switches * opt.ads (Keep_Temporary_Files): New Boolean flag, defaulted to False. * make.adb: Minor comment fix * gnatname.adb (Gnatname): When not on VMS, and gnatname has been invoked with directory information, add the directory in front of the path. * gnatchop.adb (Gnatchop): When not on VMS, and gnatchop has been invoked with directory information, add the directory in front of the path. * gnatcmd.adb (Delete_Temp_Config_Files): Only delete temporary files when Keep_Temporary_Files is False. (GNATCmd): When not on VMS, and the GNAT driver has been invoked with directory information, add the directory in front of the path. When not on VMS, handle new switch -dn before the command to set Keep_Temporary_Files to True. (Non_VMS_Usage): Use lower case for the non VMS usage: this is valid everywhere. * gnatlink.adb (Gnatlink): When not on VMS, and gnatlink has been invoked with directory information, add the directory in front of the path. 2004-07-06 Thomas Quinot <quinot@act-europe.fr> * snames.ads, snames.adb (Name_Stub): New name for the distributed systems annex. * rtsfind.ads: New RTE TC_Object, for DSA/PolyORB. New RTEs RAS_Proxy_Type and RAS_Proxy_Type_Access, for DSA. * g-socket.adb (To_Timeval): Fix incorrect conversion of Selector_Duration to Timeval for the case of 0.0. * exp_util.ads (Evolve_Or_Else): Fix overenthusiastic copy/paste of documentation from Evolve_And_Then. 2004-07-06 Jose Ruiz <ruiz@act-europe.fr> * s-taprop-tru64.adb, s-taprop-os2.adb, s-taprop-mingw.adb, s-taprop-posix.adb: Update comment. 2004-07-06 Robert Dewar <dewar@gnat.com> * s-osinte-hpux.ads, s-osinte-freebsd.ads, s-osinte-lynxos.ads, s-taprop-lynxos.adb, s-osinte-tru64.ads, s-osinte-aix.ads, s-osinte-irix.ads, s-taprop-irix.adb, s-interr-sigaction.adb, s-taprop-irix-athread.adb, s-osinte-hpux-dce.adb, s-taprop-hpux-dce.adb, s-taprop-linux.adb, s-taprop-dummy.adb, s-taprop-solaris.adb, s-interr-vms.adb, s-osinte-vms.ads, s-taprop-vms.adb, s-osinte-vxworks.ads, s-osprim-vxworks.adb, a-numaux-x86.adb, a-except.adb, a-exexpr.adb, a-intsig.adb, a-tags.adb, a-tags.ads, bindgen.ads, checks.adb, checks.adb, csets.ads, einfo.ads, einfo.ads, elists.adb, exp_ch4.adb, exp_ch7.adb, exp_dist.adb, exp_util.adb, freeze.adb, g-dynhta.adb, gnatmem.adb, g-regexp.adb, inline.adb, i-os2thr.ads, osint.adb, prj.adb, scng.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch4.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb, sem_prag.adb, sem_res.adb, sem_type.adb, sem_type.ads, sem_warn.adb, s-ficobl.ads, s-finimp.adb, s-htable.adb, sinfo.ads, sinput-l.ads, s-interr.adb, s-interr.ads, sprint.adb, s-tarest.adb, s-tasini.ads, s-taskin.ads, s-taskin.ads, uname.adb, vms_data.ads: Minor reformatting, Fix bad box comment format. * gnat_rm.texi: Fix minor grammatical error * sem_attr.adb, exp_attr.adb: New attribute Has_Access_Values * sem_util.ads, sem_util.adb (Requires_Transient_Scope): Allow many more cases of discriminated records to be recognized as not needing a secondary stack. (Has_Access_Values): New function. * snames.h, snames.adb, snames.ads: New attribute Has_Access_Values * cstand.adb, layout.ads, layout.adb, sem_ch13.ads: Change name Set_Prim_Alignment to Set_Elem_Alignment (more accurate correspondence with LRM terminology). Change terminology in comments primitive type => elementary type. 2004-07-06 Ed Schonberg <schonberg@gnat.com> PR ada/15602 * sem_ch7.adb (Unit_Requires_Body): For a generic package, the formal parameters do not impose any requirements on the presence of a body. 2004-07-06 Ed Schonberg <schonberg@gnat.com> PR ada/15593 * sem_ch12.adb (Analyze_Package_Instantiation): If the generic is not a compilation unit and is in an open scope at the point of instantiation, assume that a body may be present later. 2004-07-06 Ed Schonberg <schonberg@gnat.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case 'Size): Improve error message when specified size is not supported. * sem_ch6.adb (Maybe_Primitive_Operation): A library-level subprogram is never a primitive operation. From-SVN: r84152