1. 06 Jun, 2007 40 commits
    • exp_ch6.ads, [...] (Expand_Call): When adding an extra accessibility actual... · 7888a6ae
      2007-04-20  Gary Dismukes  <dismukes@adacore.com>
      	    Ed Schonberg  <schonberg@adacore.com>
      
      	* exp_ch6.ads, exp_ch6.adb (Expand_Call): When adding an extra
      	accessibility actual, check for the case of an aliased object that has
      	been rewritten as an Access attribute, and assign Prev to Prev_Orig so
      	we fall into processing for the attribute rather than the name of the
      	object.
      	(Expand_Inline_Call): If an actual is a literal, and the corresponding
      	formal has its address taken in the body, create a temporary to capture
      	value.  If the return type is a limited interface, do not treat the
      	return value as Controlled.
      	(Is_In_Place_Function):  If the return type is a limited interface,
      	treat as returning in place. The actual returned object may not always
      	be limited, but the caller has to assume that it is returned in place.
      	(Add_Final_List_Actual_To_Build_In_Place_Call): If the call is the
      	context of an allocator, use the correct finalization chain (that is,
      	the chain belonging to the access type, rather than the chain belonging
      	to the current scope).
      	(Add_Alloc_Form_Actual_To_Build_In_Place_Call): Test for a tagged
      	result type rather than a controlling result as a precondition for
      	adding an allocation form actual to a build-in-place call.
      	(Add_Final_List_Actual_To_Build_In_Place_Call): Ditto.
      	(Freeze_Subprogram): Code cleanup. Remove all the code that register the
      	primitive in the dispatch tables. This work is now done by Make_DT when
      	the type is frozen.
      	(Register_Predefined_DT_Entry): Removed.
      	(Add_Return): If end label is not present, use sloc of last statement
      	for generated return statement in procedure, for better gdb behavior
      	on expanded code.
      	(Add_Access_Actual_To_Build_In_Place_Call): Set parent fields of the
      	object address nodes to ensure proper processing by routines like
      	Insert_After*.
      	(Expand_Call): Fix generation of validity check for parameter
      	(Add_Alloc_Form_Actual_To_Build_In_Place_Call): Return without passing
      	the allocation form parameter if the result subtype is constrained,
      	except when the function has a controlling result.
      	(Add_Final_List_Actual_To_Build_In_Place_Call): Test Controlled_Type
      	rather than Is_Controlled and Has_Controlled_Component, since we want to
      	include class-wide result types in this treatment. Also test for a
      	controlling result, since that also requires passing a finalization
      	list.
      	(Make_Build_In_Place_Call_In_Allocator): Call Add_Alloc_Form_Actual_*
      	even when the result subtype is constrained, to handle calls involving
      	controlling results.
      	(Make_Build_In_Place_Call_In_Anonymous_Context): Add_Alloc_Form_Actual_*
      	is now called even when the result subtype is constrained, to handle
      	calls involving controlling results.
      	(Make_Build_In_Place_Call_In_Assignment): Remove test for Is_Constrained
      	on call to Add_Alloc_Form_Actual_To_Build_In_Place_Call (that procedure
      	now performs the test).
      	(Make_Build_In_Place_Call_In_Object_Declaration):
      	Add_Alloc_Form_Actual_* is now called even when the result subtype is
      	constrained, to handle calls involving controlling results.
      	(Add_Return): Accomodate rewritten pattern from local raise to goto
      	transformation, so that we still recognize an transfer statement
      	and do the right thing here in that case.
      	(Expand_N_Subprogram_Body): Add dummy Push/Pop_xxx_Label nodes at start
      	and end of subprogram code.
      	(Register_Interface_DT_Entry, Register_Predefined_DT_Entry): Add missing
      	support for primitives that are functions (without formals) with a
      	controlling result.
      	(Inherited_From_Formal): If the actual subtype has not generic parent
      	type, it is not an actual for a formal derived type, and there is no
      	operation to inherit from the formal.
      
      From-SVN: r125399
      Gary Dismukes committed
    • exp_ch5.adb (Expand_N_Assignment_Statement): For the assignment of a controlled type... · a79ec8c5
      2007-04-20  Ed Schonberg  <schonberg@adacore.com>
      	    Gary Dismukes  <dismukes@adacore.com>
      	    Javier Miranda  <miranda@adacore.com>
      
      	* exp_ch5.adb (Expand_N_Assignment_Statement): For the assignment of a
      	controlled type, use Make_Handler_For_Ctrl_Operation to construct the
      	required exception handler.
      	(Expand_Simple_Function_Return, Expand_N_Return_Statement): Handle
      	properly the case of a function whose return type is a limited
      	class-wide interface type. Modify the code of the accessibility
      	check to handle class-wide interface objects. In this case we need to
      	displace "this" to reference the primary dispatch table to get access
      	to the TSD of the object (to evaluate its accessibility level).
      	(Expand_N_Extended_Return_Statement): Test for a tagged result type
      	rather than a controlling result as one of the conditions for
      	generating tests of the implicit BIP_Alloc_Form formal. The
      	initialization assignment is also handled according to whether the
      	result is tagged instead of controlling.
      	In the case where the init assignment is inserted in the "then" part of
      	the allocation conditional, rewrite the target to be a dereference of
      	the implicit BIP_Object_Access formal.
      	If the returned value is unconstrained and created on the secondary
      	stack, mark the enclosing block and function so that the secondary
      	stack is not reclaimed on return.
      	Treat returns from functions with controlling results similarly to
      	returns from functions with unconstrained result subtypes.
      	If the object returned is unconstrained, and an allocator must be
      	created for it, analyze the allocator once the block for the extended
      	return is installed, to ensure that finalizable components
      	of the expression use the proper finalization list. Guard the call to
      	Move_Final_List with a check that there is something to finalize.
      	(Make_Tag_Ctrl_Assignment): Use "old" handling
      	of controlled type assignment for virtual machines, since new code uses
      	unsupported features (such as direct access to bytes in memory).
      
      From-SVN: r125398
      Ed Schonberg committed
    • exp_ch4.adb (Complete_Coextension_Finalization): Add machinery to handle the… · 26bff3d9
      exp_ch4.adb (Complete_Coextension_Finalization): Add machinery to handle the creation of finalization lists and calls for nested...
      
      2007-04-20  Javier Miranda  <miranda@adacore.com>
      	    Hristian Kirtchev  <kirtchev@adacore.com>
      	    Bob Duff  <duff@adacore.com>
      
      	* exp_ch4.adb (Complete_Coextension_Finalization): Add machinery to
      	handle the creation of finalization lists and calls for nested
      	coextensions when the root of the chains is part of a return statement.
      	(Inside_A_Return_Statement): New function inside Complete_Coextension_
      	Finalization.
      	(Expand_Record_Equality): Skip components that are interface types.
      	(Displace_Allocator_Pointer): Add missing support for interface subtypes
      	(Expand_N_Allocator): Replace invocation of Is_Local_Access_Discriminant
      	with Rewrite_Coextension. Change the condition for detecting coextension
      	root nodes.
      	(Is_Local_Access_Discriminant): Removed.
      	(Rewrite_Coextension): New routine which rewrites a static coextension
      	as a temporary and uses its unrestricted access in the construction of
      	the outer object.
      	(Complete_Coextension_Finalization): New routine. Generate finalization
      	attachment calls to all delayed coextensions.
      	(Expand_N_Allocator): Call Complete_Coextension_Finalization whenever
      	the allocator is not a coextension itself and has delayed coextensions.
      	If the current allocator is controlled, but also a coextension, delay
      	the generation of the finalization attachment call.
      	Rename local variable "Node" to "Nod" in order to avoid confusion with
      	"Elists.Node".
      	(Expand_Allocator_Expression): Call Adjust for initialized allocators of
      	limited types that are not inherently limited. Such an allocator is
      	illegal, but is generated by the expander for a return statement, to
      	copy the result onto the secondary stack. This is the only case where a
      	limited object can be copied. Generate code to displace the pointer
      	to the object if the qualified expression is a class-wide interface
      	object. Such displacement was missing and hence the copy of the object
      	was wrong.
      	(Apply_Accessibility_Check): Handle allocated objects initialized in
      	place.
      	(Displace_Allocator_Pointer): Subsidiary procedure to Expand_N_Allocator
      	and Expand_Allocator_Expression. Allocating class-wide interface objects
      	this routine displaces the pointer to the allocated object to reference
      	the component referencing the corresponding secondary dispatch table.
      	Expand_Allocator_Expression): Add missing support to allocate class-wide
      	interface objects initialized with a qualified expression.
      	(Get_Allocator_Final_List): Test for an anonymous access type that is a
      	function result type, and use the finalization list associated with the
      	function scope in that case (such an anonymous type should not be
      	treated like an access parameter's type).
      
      From-SVN: r125397
      Javier Miranda committed
    • exp_ch3.adb (Make_Controlling_Function_Wrappers): generate wrapper a wrapper… · 47cc8d6b
      exp_ch3.adb (Make_Controlling_Function_Wrappers): generate wrapper a wrapper when the full view of the controlling type of an...
      
      2007-04-20  Ed Schonberg  <schonberg@adacore.com>
      	    Javier Miranda  <miranda@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      
      	* exp_ch3.adb (Make_Controlling_Function_Wrappers): generate wrapper a
      	wrapper when the full view of the controlling type of an inherited
      	function that dispatches on result implements interfaces.
      	(Expand_N_Object_Declaration): In cases where the type of the
      	declaration is anonymous access, create finalization list for it.
      	(Expand_N_Object_Declaration): Generate a persistent_bss directive only
      	if the object has no explicit initialization, to match description of
      	functionality of pragam Persistent_BSS.
      	(Build_Equivalent_Array_Aggregate, Build_Equivalent_Record_Aggregate):
      	new function to build static aggregates, to replace initialization call
      	when static initialization is desired.
      	(Freeze_Type): Generate a list controller for an access type whenever
      	its designated type has controlled anonymous access discriminants.
      	(Build_Equivalent_Aggregate): New procedure to compute a static
      	aggregate to be used as default initialization for composite types,
      	instead of a generating a call to the initialization procedure for the
      	type.
      	(Build_Initialization_Call): When available, replace a call to the
      	initialization procedure with a copy of the equivalent static aggregate
      	for the type.
      	(Expand_N_Object_Declaration):  Use New_Occurrence_Of in generated
      	declarations for objects of a class-wide interface type, rather than
      	just identifiers, to prevent visibility problems.
      	(Expand_N_Object_Declaration): When expanding the declaration for an
      	object of a class-wide interface type, preserve the homonym chain of
      	the original entity before exchanging it with that of the generated
      	renaming declaration.
      	(Freeze_Enumeration_Type): Don't raise CE if No_Exception_Propagation
      	active, because there is no way to handle the exception.
      	(Freeze_Record_Type): In case of CPP_Class types add a call to Make_DT
      	to do a minimum decoration of the Access_Disp_Table list.
      	(Expand_Record_Controller): Avoid the addition of the controller between
      	the component containing the tag of a secondary dispatch table and its
      	adjacent component that stores the offset to the base of the object.
      	This latter component is only generated when the parent type has
      	discriminants ---documented in Add_Interface_Tag_Components).
      	(Apply_Array_Size_Check): Removed, no longer needed.
      	(Expand_N_Full_Type_Declaration): If the type has anonymous access
      	components, create a Master_Entity for it only if it contains tasks.
      	(Build_Init_Procedure): Suppress the tag assignment compiling under
      	no run-time mode.
      	(Freeze_Record_Type): Remove code associated with creation of dispatch
      	table.
      	(Init_Secondary_Tags): Update type of actuals when generating calls to
      	Ada.Tags.Set_Offset_To_Top
      	(Stream_Operation_OK): Disable use of streams compiling under no
      	run-time mode
      	(Expand_N_Object_Declaration): Don't do Initialize_Scalars initalization
      	if Has_Init_Expression set.
      	(Build_Init_Procedure): Replace call to Fill_DT_Entry by call to
      	Register_Primitive, which provides the same functionality.
      	(Requires_Init_Proc): Return false in case of interface types.
      	(Add_Secondary_Tables): Use the new attribute Related_Interface to
      	cleanup the code.
      	(Predefined_Primitive_Freeze): Do not assume that an internal entity
      	is always associated with a predefined primitive because the internal
      	entities associated with interface types are not predefined primitives.
      	Therefore, the call to Is_Internal is replaced by a call to the
      	function Is_Predefined_Dispatching_Operation.
      	(Make_Eq_If): When generating the list of comparisons for the
      	components of a given variant, omit the controller component that is
      	present if the variant has controlled components.
      
      From-SVN: r125396
      Ed Schonberg committed
    • exp_ch2.adb: Remove "with" and "use" clauses for Namet and Snames. · 822033eb
      2007-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      	    Ed Schonberg  <schonberg@adacore.com>
      	    Gary Dismukes  <dismukes@adacore.com>
      
      	* exp_ch2.adb: Remove "with" and "use" clauses for Namet and Snames.
      	Add "with" and "use" clauses for Sem_Attr.
      	(Expand_Current_Value): Do not replace occurences of attribute
      	references where the prefix must be a simple name.
      
      	* sem_attr.ads, sem_attr.adb: Remove "with" and "use" clauses for
      	Namet. Add new arrays Attribute_Name_Modifies_Prefix and
      	Attribute_Requires_Simple_Name_Prefix.
      	(Name_Modifies_Prefix): Body of new function.
      	(Requires_Simple_Name_Prefix): Body of new function.
      	(Resolve_Attribute, case Access): Improve error message for case of
      	mismatched conventions.
      	(Analyze_Attribute, case 'Tag): The prefix the attribute cannot be of an
      	incomplete type.
      	(Analyze_Attribute, case 'Access): If the type of the prefix is a
      	constrained subtype for a nominal unconstrained type, use its base type
      	to check for conformance with the context.
      	(Resolve_Attribute): Remove test of the access type being associated
      	with a return statement from condition for performing accessibility
      	checks on access attributes, since this case is now captured by
      	Is_Local_Anonymous_Access.
      	(Analyze_Access_Attribute): Set Address_Taken on entity
      	(Analyze_Attribute, case Address): Set Address_Taken on entity
      	(OK_Self_Reference): Traverse tree to locate enclosing aggregate when
      	validating an access attribute whose prefix is a current instance.
      	(Resolve_Attribute): In case of attributes 'Code_Address and 'Address
      	applied to dispatching operations, if freezing is required then we set
      	the attribute Has_Delayed_Freeze in the prefix's entity.
      	(Check_Local_Access): Set flag Suppress_Value_Tracking_On_Call in
      	current scope if access of local subprogram taken
      	(Analyze_Access_Attribute): Check legality of self-reference even if the
      	expression comes from source, as when a single component association in
      	an aggregate has a box association.
      	(Resolve_Attribute, case 'Access): Do not apply accessibility checks to
      	the prefix if it is a protected operation and the attribute is
      	Unrestricted_Access.
      	(Resolve_Attribute, case 'Access): Set the Etype of the attribute
      	reference to the base type of the context, to force a constraint check
      	when the context is an access subtype with an explicit constraint.
      	(Analyze_Attribute, case 'Class): If the prefix is an interface and the
      	node is rewritten as an interface conversion. leave unanalyzed after
      	resolution, to ensure that type checking against the context will take
      	place.
      
      From-SVN: r125395
      Hristian Kirtchev committed
    • exp_ch13.adb (Expand_N_Attribute_Definition_Clause, [...]): If the… · 33160237
      exp_ch13.adb (Expand_N_Attribute_Definition_Clause, [...]): If the initialization is the equivalent aggregate of the initialization...
      
      2007-04-20  Ed Schonberg  <schonberg@adacore.com>
      	    Gary Dismukes  <dismukes@adacore.com>
      
      	* exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case 'Address):
      	If the initialization is the equivalent aggregate of the initialization
      	procedure of the type, do not remove it.
      	(Expand_N_Attribute_Definition_Clause): Exclude access variables
      	initialized to null from having their expression reset to empty and
      	note this exception in the comment.
      
      From-SVN: r125394
      Ed Schonberg committed
    • exp_attr.adb (Expand_N_Attribute_Reference): Case Callable and Terminated... · 31104818
      2007-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
      	    Javier Miranda  <miranda@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      
      	* exp_attr.adb (Expand_N_Attribute_Reference): Case Callable and
      	Terminated: Add unchecked type conversion from System.Address to
      	System.Tasking.Task_Id when calling the predefined primitive
      	_disp_get_task_id.
      	Disable new Ada 05 accessibility check for JVM.NET targets, which
      	cannot be implemented in a practical way.
      	(Expand_N_Attribute_Reference: case Attribute_Tag): The use of 'Tag in
      	the sources always references the tag of the actual object. Therefore,
      	if 'Tag is applied in the sources to class-wide interface objects we
      	generate code that displaces "this" to reference the base of the object.
      	(Expand_N_Attribute_Reference, case Size): Return specified size if
      	known to front end.
      	(Expand_N_Attribute_Reference): The expansion of the 'Address attribute
      	has code that displaces the pointer of the object to manage interface
      	types. However this code must not be executed when the prefix is a
      	subprogram. This bug caused the wrong expansion of the internally
      	generated assignment that fills the dispatch table when the primitive
      	is a function returning a class-wide interface type.
      	(Expand_N_Attribute_Reference:Attribute_Valid): Remove incorrect call to
      	Set_Attribute_Name for Name_Unaligned_Valid.
      
      From-SVN: r125393
      Hristian Kirtchev committed
    • exp_aggr.ads, [...]: · 0f95b178
      2007-04-20  Javier Miranda  <miranda@adacore.com>
      	    Ed Schonberg  <schonberg@adacore.com>
      	    Bob Duff  <duff@adacore.com>
      	    Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* exp_aggr.ads, exp_aggr.adb: 
      	(Build_Record_Aggr_Code): Add missing initialization of secondary tags
      	in extension aggregates.
      	(Flatten): Other conditions being met, an aggregate is static if the
      	low bound given by component associations is different from the low
      	bound of the base index type.
      	(Packed_Array_Aggregate_Handled): If the component type is itself a
      	packed array or record, the front-end must expand into assignments.
      	(Gen_Ctrl_Actions_For_Aggr): In call to Init_Controller, pass False to
      	Init_Pr, instead of Ancestor_Is_Expression.
      	(Gen_Ctrl_Actions_For_Aggr): When processing an aggregate of a
      	coextension chain root, either generate a list controller or use the
      	already existing one.
      	(Static_Array_Aggregate): New procedure to construct a positional
      	aggregate that can be handled by the backend, when all bounds and
      	components are compile-time known constants.
      	(Expand_Record_Aggregate): Force conversion of aggregates of tagged
      	types covering interface types into assignments.
      	(Replace_Type): move to Build_Record_Aggr_Code.
      	(Expand_Record_Aggr_Code): if the target of the aggregate is an
      	interface type, convert to the definite type of the aggregate itself,
      	so that needed components are visible.
      	(Convert_Aggr_In_Object_Decl): If the aggregate has controlled
      	components and the context is an extended return statement do not
      	create a transient block for it, to prevent premature finalization
      	before the return is executed.
      	(Gen_Assign): Do not generate a call to deep adjust routine if the
      	component type is itself an array of controlled (sub)-components
      	initialized with an inner aggregate.
      	(Component_Check): New name for Static_Check. This name is now more
      	appropriate, and documentation is added which was missing.
      	(Component_Check): Add test for bit aligned component value
      	(Component_Not_OK_For_Backend): Renames Has_Delayed_Nested_Aggregate_Or_
      	Tagged_Comps, name is more appropriate given added function below.
      	(Component_Not_OK_For_Backend): Check for bit aligned component ref.
      
      From-SVN: r125392
      Javier Miranda committed
    • sinput.ads, [...] (Unlock): New procedure. · 1c28fe3a
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* sinput.ads, sinput.adb, uintp.ads, urealp.adb, stringt.adb,
      	sem_elim.adb, prj-strt.adb, repinfo.ads, repinfo.adb, namet.ads,
      	elists.ads, elists.adb, lib.ads, lib.adb (Unlock): New procedure.
      	Fix lower bound of tables.
      	Add rep clauses.
      
      	* nlists.adb: Ditto.
      	(Prev_Node, Next_Node): Change index type to Int so that it properly
      	covers the range First_Node_Id - 1 up.
      
      From-SVN: r125391
      Robert Dewar committed
    • einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable to… · 0a36105d
      einfo.ads, einfo.adb (Available_View): New synthesized attribute applicable 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
      Javier Miranda committed
    • clean.adb (Clean_Archive): Use untouched casing for the archive name and the… · 109949cd
      clean.adb (Clean_Archive): Use untouched casing for the archive name and the corresponding .deps file.
      
      2007-04-20  Pascal Obry  <obry@adacore.com>
      
      	* clean.adb (Clean_Archive): Use untouched casing for the archive name
      	and the corresponding .deps file.
      	(Clean_Interface_Copy_Directory): Use untouched casing for the library
      	src directory. Minor code-clean-up. Use untouched casing for files
      	read into the library src dir.
      	(Clean_Library_Directory): Idem.
      	(Parse_Cmd_Line): Accept new switch -aP
      
      From-SVN: r125389
      Pascal Obry committed
    • checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in which the… · 11b4899f
      checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in which the address-clause is applied to in-mode actuals (allowed...
      
      2007-04-20  Javier Miranda  <miranda@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      	    Ed Schonberg  <schonberg@adacore.com>
      
      	* checks.ads, checks.adb (Apply_Address_Clause_Check): Handle case in
      	which the address-clause is applied to in-mode actuals (allowed by
      	13.1(22)).
      	(Apply_Discriminant_Check): Do not generate a check if the type is
      	constrained by a current instance.
      	(Activate_Division_Check): New procedure
      	(Activate_Overflow_Check): New procedure
      	(Activate_Range_Check): New procedure
      	Call these new Activate procedures instead of setting flags directly
      	(Apply_Array_Size_Check): Removed, no longer needed.
      	Code clean up: remove obsolete code related to GCC 2.
      	(Get_E_Length): Protect against bomb in case scope is standard
      	(Selected_Range_Checks): If the node to be checked is a conversion to
      	an unconstrained array type, and the expression is a slice, use the
      	bounds of the slice to construct the required constraint checks.
      	Improve NOT NULL error messages
      	(Apply_Constraint_Check): If the context is a null-excluding access
      	type, diagnose properly the literal null.
      
      From-SVN: r125388
      Javier Miranda committed
    • bindusg.adb: Add line for @<response file> Add lines for new switches -R and -Z · 47eb2d8d
      2007-04-20  Vincent Celier  <celier@adacore.com>
      
      	* bindusg.adb: Add line for @<response file>
      	Add lines for new switches -R and -Z
      
      	* gnatbind.adb (Gnatbind): Do not include sources from the GNAT
      	hierarchy in the list of files of the closure when -R is used
      	(Gnatbind): Accept arguments starting with '@' to indicate response
      	files and take the arguments from the response files.
      	If List_Closure is set, display the referenced files
      
      From-SVN: r125387
      Vincent Celier committed
    • bindgen.adb (Gen_Output_File_Ada): Generate pragma No_Run_Time when needed. · 6644b368
      2007-04-20  Arnaud Charlet  <charlet@adacore.com>
      	    Vincent Celier  <celier@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      
      	* bindgen.adb (Gen_Output_File_Ada): Generate pragma No_Run_Time when
      	needed.
      	(Gen_Output_File_Ada, Gen_Output_File_C): Never use __attribute
      	((destructor)) for adafinal, even when switch -a is used.
      	Do not issue pragma Linker_Destructor for adafinal when switch -a is
      	used.
      	(Gen_Object_Files_Options): Add formatting of Linker Options, when
      	Output_Linker_Option_List is set. Suppress this formatting when
      	Zero_Formatting is set.
      	Add case for CLI_Target.
      	(System_Restrictions_Used): New flag, used to avoid generating with of
      	System_Restrictions and initialization of the data unless there is
      	some use of System.Restrictions in the partition.
      	(Check_System_Restrictions_Used): New procedure
      
              * s-stalib.adb: Remove with of System.Restrictions. No longer needed
      	since we only with this unit in the binder file if it is used elsewhere
      	in the partition.
      
      From-SVN: r125386
      Arnaud Charlet committed
    • a-tigeau.ads, [...]: (Store_Char): Change Buf to IN OUT · b51711b5
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* a-tigeau.ads, a-tigeau.adb: (Store_Char): Change Buf to IN OUT
      
      From-SVN: r125385
      Robert Dewar committed
    • a-ztflau.adb, [...] (Load_Real): Do not parse "." in the case of nnn.xxx when… · a01f0296
      a-ztflau.adb, [...] (Load_Real): Do not parse "." in the case of nnn.xxx when nnn terminates with an underscore.
      
      2007-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
      
      	* a-ztflau.adb, a-wtflau.adb, a-tiflau.adb (Load_Real): Do not parse
      	"." in the case of nnn.xxx when nnn terminates with an underscore.
      	Parse the remaining "#" or ":" in the case of nnn#.xxx#
      
      From-SVN: r125384
      Hristian Kirtchev committed
    • utils2.c (build_allocator): Provide the extra arguments to make_aligning_type… · f2f4ef82
      utils2.c (build_allocator): Provide the extra arguments to make_aligning_type for super-aligned objects...
      
      2007-04-20  Olivier Hainque  <hainque@adacore.com>
      	    Eric Botcazou  <ebotcazou@adacore.com>
      
      	* utils2.c (build_allocator): Provide the extra arguments to
      	make_aligning_type for super-aligned objects allocated from the default
      	pool. Leave enough room for a pointer before the aligning field, and
      	store the system's allocator return value there.
      	(build_call_alloc_dealloc): When releasing a super-aligned object,
      	retrieve the system's allocator return value from where build_allocator
      	has stored it, just ahead of the adjusted address we are passed.
      	(build_call_raise): Handle properly the generation of line numbers when
      	the node is marked No_Location.
      	(compare_elmt_bitpos): Use tree_int_cst_compare.  Stabilize the sort
      	by using DECL_UID on ties.
      	(build_binary_op) <EQ_EXPR>: Accept fat pointer types with the same
      	main variant.
      	(build_call_raise): Handle converting exception into goto; support new
      	argument KIND.
      	(build_component_ref): Add new arg to build_call_raise.
      
      From-SVN: r125383
      Olivier Hainque committed
    • a-tifiio.adb (Put, internal): For negative numbers... · b3a22f38
      2007-04-20  Vincent Celier  <celier@adacore.com>
      
      	* a-tifiio.adb (Put, internal): For negative numbers, check that there
      	is room for at least one digit and the minus sign.
      	(Put.Put_Character): Never put a character outside of the range of
      	string To.
      
      From-SVN: r125382
      Vincent Celier committed
    • a-tienio.adb (Get): Adjust buffer size to accomodate one extra character · cc9e83af
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* a-tienio.adb (Get): Adjust buffer size to accomodate one extra
      	character
      
      From-SVN: r125381
      Robert Dewar committed
    • a-textio.ads, [...] (Write): Add explicit size clause for the C imported variable. · 0ebb72c8
      2007-04-20  Thomas Quinot  <quinot@adacore.com>
      
      	* a-textio.ads, a-textio.adb (Write): Add explicit size clause for the
      	C imported variable.
      	(Skip_Line): Do not reset Before_LM_PM immediately when Before_LM is set
      	on entry.
      
      From-SVN: r125380
      Thomas Quinot committed
    • a-tags.ads, a-tags.adb (Tag_Size): This constant is now internal to the package. · d0dd5209
      2007-04-20  Javier Miranda  <miranda@adacore.com>
      
      	* a-tags.ads, a-tags.adb (Tag_Size): This constant is now internal to
      	the package.
      	(Object_Specific_Data_Array): This is now internal to the package.
      	(Object_Specific_Data): This is now internal to the package.
      	(Select_Specific_Data_Element): This is now internal to the package.
      	(Select_Specific_Data_Array): This is now internal to the package.
      	(Select_Specific_Data): This is now internal to the package.
      	(Offset_To_Top_Function_Ptr): This is now public.
      	(To_Offset_To_Top_Function_Ptr): Removed.
      	(Storage_Offset_Ptr,To_Storage_Offset_Ptr): These declarations are now
      	 local to subprogram Offset_To_Top.
      	(Predefined_DT): Removed.
      	(Typeinfo_Ptr): Removed.
      	(OSD): This function is now internal to this package.
      	(SSD): This function is now internal to this package.
      	(DT): New function that displaces the pointer to the table of primitives
      	 to get access to the enclosing wrapper record.
      	(IW_Membership): Code cleanup.
      	(Offset_To_Top): Code cleanup.
      	(Predefined_DT): Removed.
      	(Register_Interface_Tag): Removed.
      	(Set_Interface_Table): Removed.
      	(Set_Offset_Index): Removed.
      	(Set_Offset_To_Top): Code cleanup.
      	(Set_OSD): Removed.
      	(Set_Signature): Removed.
      	(Set_SSD): Removed.
      	(Set_Tagged_Kind): Removed.
      	(Typeinfo_Ptr): Removed.
      	(TSD): Removed.
      	(Displace): Add missing check on null actual.
      
      	* exp_disp.ads, exp_disp.adb
      	(Select_Expansion_Utilities): Removed.
      	(Build_Common_Dispatching_Select_Statements): Moved to exp_atags.
      	(Expand_Dispatching_Call): Update calls to Get_Prim_Op_Address because
      	the interface requires a new parameter.
      	(Make_Disp_Asynchronous_Select_Spec, Make_Disp_Conditional_Select_Spec,
      	Make_Disp_Get_Prim_Op_Kind_Spec, Make_Disp_Timed_Select_Spec): Replace
      	calls to subprograms Build_T, Build_S, etc. by the corresponding code.
      	Done to remove package Select_Expansion_Utilities.
      	(Make_DT): New implementation for statically allocated dispatch tables.
      	(Make_Secondary_DT): Moved to the scope of Make_DT.
      	(Register_Primitive): Code cleanup plus incoporate the use of the new
      	function DT_Address_Attribute.
      	(Expand_Interface_Thunk): The profile of this subprogram has been
      	changed to return the Thunk_Id and the corresponding code.
      	(Fill_DT_Entry): Removed. Its functionality is now provided by
      	subprogram Register_Primitive.
      	(Fill_Secondary_DT_Entry): Removed. Its functionality is now provided by
      	subprogram Register_Primitive.
      	(Register_Primitive): New subprogram that incorporates the previous
      	functionalities of Fill_DT_Entry and Fill_Secondary_DT_Entry.
      	(Build_Common_Dispatching_Select_Statements): Remove formal Typ. This
      	was only required to call Make_DT_Access_Action, which is now removed.
      	(Ada_Actions): Removed
      	(Action_Is_Proc): Removed
      	(Action_Nb_Arg): Removed
      	Replace all the calls to Make_DT_Access_Action by direct calls to
      	Make_Procedure_Call_Statement or Make_Function_Call.
      	(Set_DTC_Entity_Value): New subprogram.
      	(Set_All_DT_Position): Add call to new subprogram Set_DTC_Entity_Value.
      	(Expand_Interface_Thunk): Add missing support for primitives that are
      	functions with a controlling result (case in which there is no need
      	to generate the thunk).
      
      	* exp_atag.ads, exp_atag.adb
      	(Build_DT): New subprogram that displaces the pointer to reference the
      	base of the wrapper record.
      	(Build_Typeinfo_Offset): Removed.
      	(RTE_Tag_Node): Removed.
      	(Build_Common_Dispatching_Select_Statements): Moved here from exp_disp
      	(Build_Get_RC_Offset): Removed.
      	(Build_Inherit_Predefined_Prims): Removed.
      	(Build_Inherit_TSD: Removed.
      	(Build_New_TSD): Removed.
      	(Build_Set_External_Tag): Removed.
      	(Build_Set_Predefined_Prim_Op_Address): Add documentation.
      	(Build_Set_Prim_Op_Address): Add documentation.
      	(Build_Set_TSD): Removed.
      
      	* rtsfind.ads, rtsfind.adb
      	(Load_Fail): If load fails and we are not in configurable run-time
      	mode, then raise Unrecoverable_Error.
      	(Text_IO_Kludge): Generate an error message if a run-time library is
      	not available in a given run-time (ie. zfp run-time).
      	(RTE_Record_Component): Add code to check that the component we search
      	for is not found in two records in the given run-time package.
      	(RE_DT_Offset_To_Top_Size, RE_DT_Predef_Prims_Size): Removed
      	(RE_DT_Predef_Prims_Offset): New entity
      	(RE_Static_Offset_To_Top): New entity
      	(RE_HT_Link): New entity.
      	(System_Address_Image): Addition of this run-time package.
      	(RE_Address_Image): New entity.
      	(RE_Abstract_Interface): Removed.
      	(RE_Default_Prim_Op_Count): Removed.
      	(RE_DT_Entry_Size): Removed.
      	(RE_DT_Min_Prologue_Size): Removed.
      	(RE_DT_Prologue_Size): Removed.
      	(RE_Ifaces_Table_Ptr): Removed.
      	(RE_Interface_Data_Ptr): Removed.
      	(RE_Type_Specific_Data): Removed.
      	(RE_Primary_DT): Removed.
      	(RE_Register_Interface_Tag): Removed.
      	(RE_Set_Offset_Index): Removed.
      	(RE_Set_OSD): Removed.
      	(RE_Set_SSD): Removed.
      	(RE_Set_Signature): Removed.
      	(RE_Set_Tagged_Kind): Removed.
      	(RE_Address_Array): New entity.
      	(RE_DT): New entity.
      	(RE_Iface_Tag): New entity.
      	(RE_Interfaces_Table): New entity.
      	(RE_No_Dispatch_Table): New entity.
      	(RE_NDT_Prims_Ptr): New entity.
      	(RE_NDT_TSD): New entity.
      	(RE_Num_Prims): New entity.
      	(RE_Offset_To_Top_Function_Ptr): New entity.
      	(RE_OSD_Table): New entity.
      	(RE_OSD_Num_Prims): New entity.
      	(RE_Predef_Prims): New entity
      	(RE_Predef_Prims_Table_Ptr): New entity.
      	(RE_Primary_DT): New entity.
      	(RE_Signature): New entity.
      	(RE_SSD): New entity.
      	(RE_TSD): New entity.
      	(RE_Type_Specific_Data): New entity.
      	(RE_Tag_Kind): New entity.
      
      From-SVN: r125379
      Javier Miranda committed
    • a-stzunb.adb, [...]: (Insert): Use 'Length instead of 'Size. · dc1f64ac
      2007-04-20  Arnaud Charlet  <charlet@adacore.com>
      
      	* a-stzunb.adb, a-stwiun.adb, a-strunb.adb: (Insert): Use 'Length
      	instead of 'Size.
      
      	* a-stwifi.ads, a-stzfix.ads: Minor reformatting
      
      From-SVN: r125378
      Arnaud Charlet committed
    • bcheck.adb, [...]: Move Name_Id, File_Name_Type and Unit_Name_Type from package… · 39f4e199
      bcheck.adb, [...]: Move Name_Id, File_Name_Type and Unit_Name_Type from package Types to package Namet.
      
      2007-04-20  Vincent Celier  <celier@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      
      	* bcheck.adb, binde.adb, binderr.adb, binderr.ads, butil.adb, 
      	butil.ads, erroutc.adb, erroutc.ads, errutil.adb, errutil.ads, 
      	err_vars.ads, exp_tss.adb, exp_tss.ads, fmap.adb, fmap.ads, 
      	fname.adb, fname.ads, fname-sf.adb, fname-uf.adb, fname-uf.ads, 
      	lib-sort.adb, lib-util.adb, lib-util.ads, lib-xref.adb, makeutl.ads, 
      	makeutl.adb, nmake.adt, osint.adb, osint.ads, osint-b.adb, 
      	par-load.adb, prj-attr.adb, prj-dect.adb, prj-err.adb, prj-makr.adb, 
      	prj-part.adb, prj-pp.adb, prj-proc.adb, prj-tree.adb, prj-tree.ads, 
      	prj-util.adb, prj-util.ads, scans.adb, scans.ads, sem_ch2.adb, 
      	sinput-c.adb, styleg-c.adb, tempdir.adb, tempdir.ads, uname.adb, 
      	uname.ads, atree.h, atree.ads, atree.adb, ali-util.ads, ali-util.adb,
      	ali.ads, ali.adb: 
      	Move Name_Id, File_Name_Type and Unit_Name_Type from package Types to
      	package Namet. Make File_Name_Type and Unit_Name_Type types derived from
      	Mame_Id. Add new type Path_Name_Type, also derived from Name_Id.
      	Use variables of types File_Name_Type and Unit_Name_Type in error
      	messages.
      	(Get_Name): Add parameter Ignore_Special, and set it reading file name
      	(New_Copy): When debugging the compiler, call New_Node_Debugging_Output
      	here.
      	Define flags Flag217-Flag230 with associated subprograms
      	(Flag_Word5): New record type.
      	(Flag_Word5_Ptr): New access type.
      	(To_Flag_Word5): New unchecked conversion.
      	(To_Flag_Word5_Ptr): Likewise.
      	(Flag216): New function.
      	(Set_Flag216): New procedure.
      
      From-SVN: r125377
      Vincent Celier committed
    • a-finali.ads (Ada.Finalization): Add missing pragma Remote_Types. · 379ec904
      2007-04-20  Thomas Quinot  <quinot@adacore.com>
      
      	* a-finali.ads (Ada.Finalization): Add missing pragma Remote_Types. The
      	presence of this categorization pragma is mandated by the language.
      	(Limited_Controlled): Add missing pragma Preelaborable_Initialization
      	for this type.
      
      From-SVN: r125376
      Thomas Quinot committed
    • a-except.ads, [...]: (Rmsg_28): Fix description for E.4(18) check. · 6c5290ce
      2007-04-20  Thomas Quinot  <quinot@adacore.com>
      	    Olivier Hainque  <hainque@adacore.com>
      	    Robert Dewar  <dewar@adacore.com>
      
      	* a-except.ads, a-except.adb: (Rmsg_28): Fix description for E.4(18)
      	check.
      	(Raise_Current_Excep): Call Debug_Raise_Exception just before
      	propagation starts, to let debuggers know about the event in a reliable
      	fashion.
      	(Local_Raise): Moved to System.Exceptions
      	More convenient to have this as a separate unit
      
      	* s-except.adb, s-except.ads: New files.
      
      	* a-exextr.adb (Unhandled_Exception): Delete - replaced by
      	Debug_Unhandled_Exception in System.Exceptions where it belongs
      	together with a couple of other debug helpers.
      	(Notify_Unhandled_Exception): Use Debug_Unhandled_Exception instead of
      	the former Unhandled_Exception.
      
      	* exp_ch11.ads, exp_ch11.adb: (Possible_Local_Raise): New procedure
      	(Warn_No_Exception_Propagation): New procedure
      	(Warn_If_No_Propagation): Rewritten for new warning generation
      	(Expand_Exception_Handlers): New warning generation
      	(Expand_N_Raise_xxx_Error): Rewritten for new warnings
      	(Add_Exception_Label): Use Special_Exception_Package_Used for test
      	instead of Most_Recent_Exception_Used (accomodates Exception_Traces)
      	(Expand_Local_Exception_Handlers): Unconditionally add extra block wrap
      	even if restriction is set (makes life easier in Check_Returns)
      	(Expand_Local_Exception_Handlers): Follow renamed entity chain when
      	checking exception identities.
      	(Expand_Local_Exception_Handlers): Do not optimize when all others case
      	(Expand_Local_Exception_Handlers): Set Exception_Junk flag on generated
      	block for handler (used by Check_Returns)
      	(Expand_Local_Exception_Handlers): Local_Raise now takes an address
      	(Expand_N_Handled_Sequence_Of_Statements): Properly handle -gnatd.x to
      	remove all exception handlers when optimizing local raise statements.
      	(Find_Local_Handler): Use Get_Renamed_Entity
      	(Expand_N_Handled_Sequence_Of_Statements): If the handled sequence is
      	marked analyzed after expanding exception handlers, do not generate
      	redundant cleanup actions, because they have been constructed already.
      
      From-SVN: r125375
      Thomas Quinot committed
    • comperr.adb (Compiler_Abort): New Finalize/Output_Messages interface for Errout · 107cd232
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* comperr.adb (Compiler_Abort): New Finalize/Output_Messages interface
      	for Errout
      
      	* errout.adb: New Finalize/Compilation_Errors/Output_Messages
      	implementation
      
      	* errout.ads (Finalize): Changed interface
      	(Output_Messages): New procedure
      	(Compilation_Errors): New Interface
      
      	* prepcomp.ads, prepcomp.adb (Parse_Preprocessing_Data_File): New
      	Finalize/Output_Messages interface for Errout
      	(Prepare_To_Preprocess): New Finalize/Output_Messages interface for
      	Errout.
      
      From-SVN: r125374
      Robert Dewar committed
    • a-chahan.ads: Remove obsolescent pragmas · 4378d234
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* a-chahan.ads: Remove obsolescent pragmas
      
      	* a-chlat1.ads: Minor reformatting
      
      From-SVN: r125373
      Robert Dewar committed
    • s-intman-vxworks.ads, [...] (Abort_Task_Signal): Rename to Abort_Task_Interrupt… · 094c3b47
      s-intman-vxworks.ads, [...] (Abort_Task_Signal): Rename to Abort_Task_Interrupt to be able to keep the same interface as the...
      
      2007-04-20  Jose Ruiz  <ruiz@adacore.com>
      
      	* s-intman-vxworks.ads, s-intman-vxworks.adb (Abort_Task_Signal):
      	Rename to Abort_Task_Interrupt to be able to keep the same interface
      	as the rest of the targets.
      
      	* s-osinte-vxworks.ads s-osinte-vxworks.adb
      	(To_VxWorks_Priority): Remove explicit "in" mode indicator
      
      	* s-osinte-vxworks6.ads, s-vxwork-arm.ads, system-vxworks-arm.ads:
      	New files.
      
      From-SVN: r125372
      Jose Ruiz committed
    • gigi.h, trans.c (Identifier_to_gnu): Change test for deferred constant by adding… · 09ef48fe
      gigi.h, trans.c (Identifier_to_gnu): Change test for deferred constant by adding guard that the entity is an...
      
      2007-04-20  Gary Dismukes  <dismukes@adacore.com>
      	    Eric Botcazou  <ebotcazou@adacore.com>
      	    Tristan Gingold  <gingold@adacore.com>
      	    Olivier Hainque  <hainque@adacore.com>
      
      	* gigi.h, trans.c (Identifier_to_gnu): Change test for deferred
      	constant by adding guard that the entity is an E_Constant before
      	testing presence of Full_view (and remove now-unnecessary test that
      	entity is not a type).
      	For a CONST_DECL used by reference, manually retrieve
      	the DECL_INITIAL.  Do not invoke fold in the other DECL_P cases either.
      	(struct language_function): Move from utils.c to here.
      	(struct parm_attr): New structure.
      	(parm_attr, parm_attr vector, parm_attr GC vector): New types.
      	(f_parm_attr_cache): New macro.
      	(Attribute_to_gnu) <Attr_Length>: When not optimizing, cache the
      	expressions for the 'First, 'Last and 'Length attributes of the
      	unconstrained array IN parameters.
      	(Subprogram_Body_to_gnu): Use gnu_subprog_decl throughout.
      	Allocate the information structure for the function earlier, as well
      	as the language-specific part.
      	If the parameter attributes cache has been populated, evaluate the
      	cached expressions on entry.
      	(takes_address): Add OPERAND_TYPE parameter.  Handle N_Function_Call,
      	N_Procedure_Call_Statement and N_Indexed_Component.
      	(Pragma_to_gnu): Translate inspection_point to an asm statement
      	containaing a comment and a reference to the object (either its address
      	for BLKmode or its value).
      	(Identifier_to_gnu): Use TREE_CONSTANT instead of CONST_DECL to decide
      	to go to DECL_INITIAL. Together with the size constraint relaxation
      	in create_var_decl, enlarges the set of situations in which an
      	identifier may be used as an initializer without implying elaboration
      	code.
      	(Subprogram_Body_to_gnu): Do not fiddle with the debug interface but set
      	DECL_IGNORED_P on the function if Needs_Debug_Info is not set on the
      	node.
      	(maybe_stabilize_reference): Remove lvalues_only parameter.
      	(gnat_stabilize_reference): Adjust for above change.
      	(gnat_to_gnu): Do not set location information on the result
      	if it is a reference.
      	(add_cleanup): Add gnat_node parameter and set the location of the
      	cleanup to it.
      	(Handled_Sequence_Of_Statements_to_gnu): Adjust calls to add_cleanup.
      	(Exception_Handler_to_gnu_zcx): Likewise.
      	(gigi): Remove the cgraph node if the elaboration procedure is empty.
      	(Subprogram_Body_to_gnu): If a stub is attached to the subprogram, emit
      	the former right after the latter.
      	(start_stmt_group): Make global.
      	(end_stmt_group): Likewise.
      	(gnu_constraint_error_label_stack, gnu_storage_error_label_stack): New
      	vars.
      	(gnu_program_error_label_stack): Likewise.
      	(gigi): Initialize them.
      	(call_to_gnu, gnat_to_gnu, emit_check): Add new arg to build_call_raise.
      	(gnat_to_gnu, N_{Push,Pop}_{Constraint,Storage,Program}_Error_Label):
      	New cases.
      	(push_exception_label_stack): New function.
      	(takes_address): New function.
      
      	* utils.c (struct language_function): Move to trans.c from here.
      	(unchecked_convert): Do not wrap up integer constants in
      	VIEW_CONVERT_EXPRs.
      	(create_var_decl_1): Decouple TREE_CONSTANT from CONST_DECL. Prevent
      	the latter for aggregate types, unexpected by later passes, and relax an
      	arbitrary size constraint on the former.
      	(create_field_decl): Use tree_int_cst_equal instead of operand_equal_p
      	to compare the sizes.
      	(convert_vms_descriptor): When converting to a fat pointer type, be
      	prepared for a S descriptor at runtime in spite of a SB specification.
      	(shift_unc_components_for_thin_pointers): New function.
      	(write_record_type_debug_info): For variable-sized fields, cap the
      	alignment of the pointer to the computed alignment.
      	(finish_record_type): Change HAS_REP parameter into REP_LEVEL.
      	If REP_LEVEL is 2, do not compute the sizes.
      	(build_vms_descriptor): Adjust for new prototype of finish_record_type.
      	(build_unc_object_type): Likewise.
      	(declare_debug_type): New function.
      
              * ada-tree.def: USE_STMT: removed (not emitted anymore).
      
              * misc.c (gnat_expand_expr): Call to gnat_expand_stmt removed because
              no statement is expandable anymore.
              (gnat_init_gcc_eh): Do not initialize the DWARF-2 CFI machinery twice.
              (gnat_handle_option): Only allow flag_eliminate_debug_types to be set
              when the user requested it explicitely.
              (gnat_post_options): By default, set flag_eliminate_unused_debug_types
              to 0 for Ada.
              (get_alias_set): Return alias set 0 for a type if
              TYPE_UNIVERSAL_ALIASING_P is set on its main variant.
      
              * ada-tree.h: (TYPE_UNIVERSAL_ALIASING_P): New macro.
              (DECL_FUNCTION_STUB): New accessor macro.
              (SET_DECL_FUNCTION_STUB): New setter macro.
      
              * lang.opt (feliminate-unused-debug-types): Intercept this flag for Ada.
      
      	* fe.h (Get_Local_Raise_Call_Entity, Get_RT_Exception_Entity): New
      	declarations.
      
      From-SVN: r125371
      Gary Dismukes committed
    • decl.c (gnat_to_gnu_entity): Manually mark the top of the renamed expression of… · fce2526f
      decl.c (gnat_to_gnu_entity): Manually mark the top of the renamed expression of a full renaming at toplevel.
      
      2007-04-20  Eric Botcazou  <ebotcazou@adacore.com>
      	    Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
      	    Olivier Hainque  <hainque@adacore.com>
      
      	* decl.c (gnat_to_gnu_entity) <object>: Manually mark the top of the
      	renamed expression of a full renaming at toplevel.
      	(gnat_to_gnu_entity, case object): If not defining, do not look inside
      	the values the constant is initialized to if it is an N_Allocator.
      	(gnat_to_gnu_entity) <E_Array_Subtype>: Manually mark the top of the
      	TYPE_SIZE_UNIT of inner types after the stride is elaborated.
      	(make_aligning_type): Accept an extra ROOM argument for storage to be
      	made available before the aligned field, and an extra BASE_ALIGN
      	argument for callers to pass the alignment guaranteed to be honored for
      	the whole aligning object. Avoid call to finish_record_type, which only
      	interferes with the sizes we want to set.
      	(gnat_to_gnu_entity) <E_Variable>: Pass the required extra arguments to
      	make_aligning_type for super-aligned objects on stack.
      	(components_to_record): Pass the adjusted size of the type when creating
      	fields in the qualified union for the variant part.
      	(gnat_substitute_in_type): Copy TYPE_USER_ALIGN.
      	(gnat_to_gnu_entity, case E_Signed_Integer_Subtype): Likewise for
      	packed array type.
      	(maybe_pad_type): Set TYPE_USER_ALIGN.
      	(make_aligning_type): Likewise.
      	ALIGN argument is unsigned int.
      	(gnat_to_gnu_entity, case E_Function): Back annotate return mechanism.
      	(gnat_to_gnu_param): Likewise, for parameters.
      	(gnat_to_gnu_entity) <object>: Always instantiate the renaming object
      	if it is constant and stems from a function call.
      	(gnat_to_gnu_entity) <E_Record_Type>: Set packed to -2 if the alignment
      	of the record is specified.  Adjust accordingly.
      	(adjust_packed): New static function.
      	(gnat_to_gnu_field): Use it to adjust the packedness setting.
      	(components_to_record): Likewise.
      	(gnat_to_gnu_entity) <object>: Do not test the renamed expression for
      	side-effects if the object is deemed constant.
      	(gnat_to_gnu_entity) <E_Array_Type>: Create a name for the fat pointer
      	type instead of merely finalizing it.  Tidy.
      	<E_Access_Subprogram_Type>: Retrieve the type from the TYPE_DECL.
      	<E_Access_Type>: Likewise.
      	(defer_debug_incomplete_list): Rename to defer_finalize_list.
      	(defer_debug_level): Delete.
      	(gnat_to_gnu_entity) <debug_deferred>: Likewise
      	<E_Array_Type>: Call rest_of_record_type_compilation on the fat pointer
      	type.
      	<E_Record_Type>: Do not explicitly defer finalizing the type.
      	Adjust for write_record_type_debug_info renaming.
      	<E_Subprogram_Type>: Likewise.
      	Finalize deferred types right after deferred incomplete types are
      	expanded.
      	(rest_of_type_decl_compilation): New global function.
      	(components_to_record): Rename defer_debug parameter to do_not_finalize.
      	(components_to_record): Propagate the packedness to the fields of the
      	qualified union type if there is a variant part.
      	(gnat_to_gnu_entity) <E_Array_Type>: Use new function
      	instead of inline code to adjust the XUT field offsets.
      	(gnat_to_gnu_entity): Adjust for new prototype of finish_record_type.
      	<E_Record_Subtype>: Do not let finish_record_type compute the sizes
      	and write the debug info if the type derives from a discriminated one.
      	(gnat_to_gnu_entity) <E_Array_Type>: Adjust call to create_index_type.
      	<E_Array_Subtype>: Likewise.
      	<E_String_Literal_Subtype>: Likewise.
      	(gnat_to_gnu_entity): Set TYPE_USER_ALIGN on types only if they have
      	an alignment clause.
      	(maybe_pad_type): Update ORIG_SIZE to the minimum required to meet ALIGN
      	before giving warning.
      	(prepend_one_attribute_to): New function, helper to prepend an attribute
      	to an attribute list.
      	(gnat_to_gnu_entity) <E_Procedure>: Use it.
      	(prepend_attributes): Likewise.
      	(gnat_to_gnu_entity) <E_Variable>: Use constants of the proper type.
      	<E_Array_Type>: Declare the padding type for the element type, if any.
      	<E_Array_Subtype>: Likewise.
      	(defer_limited_with): New variable.
      	(Gigi_Equivalent_Type): New function.
      	(gnat_to_gnu_entity): Use it at start and use result throughout.
      	(gnat_to_gnu_entity, case E_Access_Type): Rework to use
      	Gigi_Equivalent_Type, support Limited_With, allow two levels of
      	indirection, precompute if unconstrained array to simplify logic, and
      	use defer_limited_with to defer elaboration of some types from limited
      	with.
      	(finalize_from_with_types): New function.
      
      From-SVN: r125370
      Eric Botcazou committed
    • 2007-04-20 Vasiliy Fofanov <fofanov@adacore.com> · 0cb8d27c
      	* s-osprim-vms.ads, s-osprim-vms.adb
      	(Initialize) New procedure. Noop on VMS, added for interface
      	commonality.
      
      From-SVN: r125369
      Vasiliy Fofanov committed
    • s-osinte-linux.ads (sigset_t): Bump alignment to match more closely its C counterpart. · df862408
      2007-04-20  Arnaud Charlet  <charlet@adacore.com>
      
      	* s-osinte-linux.ads (sigset_t): Bump alignment to match more closely
      	its C counterpart.
      	Remove references to Unchecked_Conversion, and use Ada.xxx instead.
      	Replace Unchecked_Conversion by Ada.Unchecked_Conversion.
      
      From-SVN: r125368
      Arnaud Charlet committed
    • s-osinte-aix.adb: map Ada priorities to target priorities appropriately for different scheduling... · 73d39ad2
      2007-04-20  Matthew Gingell  <gingell@adacore.com>
      
      	* s-osinte-aix.adb: map Ada priorities to target
      	priorities appropriately for different scheduling policies.
      
      From-SVN: r125367
      Matthew Gingell committed
    • mlib-tgt-specific.adb, [...]: New files. · 6bb81bc1
      2007-04-20  Vincent Celier  <celier@adacore.com>
      
      	* mlib-tgt-specific.adb, mlib-tgt-specific.ads,
      	mlib-tgt-vms.adb, mlib-tgt-vms.ads: New files.
      
      	* mlib-tgt.adb, mlib-tgt.ads, mlib-tgt-darwin.adb, 
      	mlib-tgt-vxworks.adb, mlib-tgt-mingw.adb, mlib-tgt-lynxos.adb, 
      	mlib-tgt-linux.adb, mlib-tgt-solaris.adb, mlib-tgt-vms-alpha.adb, 
      	mlib-tgt-vms-ia64.adb, mlib-tgt-aix.adb, mlib-tgt-irix.adb, 
      	mlib-tgt-hpux.adb, mlib-tgt-tru64.adb: Make a common body for package
      	MLib.Tgt, containing the default versions
      	of the exported subprograms. For each platforms, create a specific
      	version of the body of new child package MLib.Tgt.Specific that contains
      	only the bodies of subprograms that are different from the default.
      	(Archive_Builder_Append_Options): New function
      
      From-SVN: r125366
      Vincent Celier committed
    • system-vxworks-sparcv9.ads, [...]: Document mapping between Ada and OS priorities. · a538d226
      2007-04-20  Arnaud Charlet  <charlet@adacore.com>
      
      	* system-vxworks-sparcv9.ads, system-solaris-x86.ads, 
      	system-irix-o32.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, 
      	system-lynxos-x86.ads, system-vxworks-m68k.ads, system-linux-x86.ads, 
      	system-vxworks-mips.ads, system-vxworks-alpha.ads, 
      	system-vxworks-x86.ads, system-linux-ppc.ads, system-mingw.ads, 
      	system-vms-zcx.ads, system-darwin-ppc.ads, system-vxworks-ppc.ads, 
      	system-interix.ads, system-linux-hppa.ads, system-tru64.ads, 
      	system-hpux.ads, system-irix-n32.ads, system-solaris-sparc.ads, 
      	system-solaris-sparcv9.ads, system-vms.ads, system.ads,
      	system-vms_64.ads, system-hpux-ia64.ads, system-linux-x86_64.ads,
      	system-linux-ia64.ads: Document mapping between Ada and OS priorities.
      	This patch changes the largest non-binary modulus from 2**31-1 to
      	2**32-1.
      	(Compiler_System_Version): Removed, no longer used.
      	Clean up system files by removing flags only used on a single target.
      	Also remove obsolete flags, only used during bootstrap from system.ads
      	(Address): Add a pragma Preelaborable_Initialization.
      
      	* system-aix.ads:  Ditto.
      	(GCC_ZCX_Support): Set to true.
      	Update priority range on AIX and map Ada priorities to target
      	priorities appropriately for different scheduling policies.
      
      	* ttypes.ads: set largest non-binary modulus from 2**31-1 to 2**32-1
      
      From-SVN: r125365
      Arnaud Charlet committed
    • s-taprop-vms.adb, [...] (Timed_Delay, [...]): Register the base time when… · dae22b53
      s-taprop-vms.adb, [...] (Timed_Delay, [...]): Register the base time when entering this routine to detect a backward clock...
      
      2007-04-20  Arnaud Charlet  <charlet@adacore.com>
      
      	* s-taprop-vms.adb, s-taprop-hpux-dce.adb, s-taprop-vxworks.adb, 
      	s-osprim-posix.adb, s-taprop-posix.adb, s-osprim-vxworks.adb, 
      	s-taprop-solaris.adb, s-osprim-solaris.adb, s-taprop-dummy.adb, 
      	s-osprim-unix.adb, s-osinte-freebsd.adb, s-osinte-freebsd.ads, 
      	s-osinte-lynxos.adb, s-osinte-lynxos.ads, s-taprop-tru64.adb, 
      	s-taprop-lynxos.adb, s-taprop-irix.adb, s-osinte-tru64.adb, 
      	s-osinte-tru64.ads, s-taprop-linux.adb, s-parame.ads, 
      	s-parame-vms-alpha.ads, s-parame-vms-ia64.ads, s-parame-hpux.ads, 
      	s-parame-vms-restrict.ads, s-parame-ae653.ads, s-parame-vxworks.ads, 
      	s-taprop-mingw.adb, s-osinte-lynxos-3.ads, s-osinte-lynxos-3.adb,
              s-osprim-mingw.adb (Timed_Delay, Timed_Sleep): Register the base
      	time when entering this routine to detect a backward clock setting
      	(manual setting or DST adjustment), to avoid waiting for a longer delay
      	than needed.
      	(Time_Duration, To_Timeval, struct_timeval): Removed when not relevant.
      	Remove handling of deferred priority change, and replace by setting the
      	task priority directly, as required by AI-188.
      	Update comments.
      	(Max_Task_Image_Length): New constant.
      	Replace Warnings (Off) by Unreferenced pragma, cleaner.
      	(Dynamic_Priority_Support): Removed, no longer needed.
      	(Poll_Base_Priority_Change): Ditto.
      	(Set_Ceiling): Add this procedure to change the ceiling priority
      	associated to a lock. This is a dummy implementation because dynamic
      	priority ceilings are not supported by the underlying system.
      
      	* a-dynpri.adb (Set_Priority): Take into account case where Target is
      	accepting a RV with its priority boosted.
      	Remove handling of deferred priority change, and replace by setting the
      	task priority directly, as required by AI-188.
      
      	* s-taenca.adb (Try_To_Cancel_Entry_Call): Remove special case for
      	Succeeded = True.
      	Remove handling of deferred priority change, and replace by setting the
      	task priority directly, as required by AI-188.
      	(Wait_For_Completion, Wait_For_Call, Timed_Selective_Wait): Change state
      	of Self_Id earlier.
      
      	* s-tasini.ads, s-tasini.adb (Wakeup_Entry_Caller): Relax assertion.
      	(Poll_Base_Priority_Change): Removed.
      	Code clean up: use SSL.Current_Target_Exception.
      
      	* s-tasren.adb (Task_Count): Call Yield to let a chance to other tasks
      	to run as this is a potentially dispatching point.
      	(Call_Synchronous): Use Local_Defer_Abort.
      	(Callable): Relax assertion.
      	(Selective_Wait): Relax assertion in case abort is not allowed.
      	Remove handling of deferred priority change, and replace by setting the
      	task priority directly, as required by AI-188.
      
      	* s-tasuti.adb (Make_Passive): Adjust assertions.
      	Remove handling of deferred priority change, and replace by setting the
      	task priority directly, as required by AI-188.
      
      From-SVN: r125364
      Arnaud Charlet committed
    • 2007-04-20 Hristian Kirtchev <kirtchev@adacore.com> · 984d7dd3
      	* a-calend.ads, a-calend.adb, a-calend-vms.ads, a-calend-vms.adb ("-"
      	(Time, Time)): Use To_Relative_Time rather than manual calculation to
      	express the bounds of Duration as Time. Raise Time_Error when the
      	result is greater or equal to the higher bound of Duration (on the
      	margin case).
      	("+" (Time, Duration)): Reorder code. Remove the declaration of constant
      	Ada_High_And_Leaps.
      	("-" (Time, Duration)): Reorder code. Remove the declaration of constant
      	Ada_High_And_Leaps.
      	("-" (Time, Time)): Reorder code.
      	(All_Leap_Seconds): Removed.
      	(Arithmetic_Operations.Add): Remove sign related kludge.
      	(Arithmetic_Operations.Difference): Control the leaps seconds processing
      	with flag Leap_Support.
      	(Arithmetic_Operations.Subtract): Remove sign related kludge.
      	(Check_Within_Time_Bounds): New procedure.
      	(Clock): Control the leap seconds processing with flag Leap_Support.
      	(Cumulative_Leap_Seconds): Assert that the target supports leap seconds.
      	(Formatting_Operations.Split): Control the leap seconds processing with
      	flag Leap_Support.
      	(Formatting_Operations.Time_Of): Control the leaps seconds processing
      	with flag Leap_Support. Adjust the year, month and day (if applicable)
      	when the value of day seconds designates a new day.
      	(Split): Use parameter associations for better readability. Integrate
      	flag Is_Ada_05.
      	(Time_Of): Use parameter associations for better readability. Integrate
      	flag Is_Ada_05.
      
      	* a-calfor.adb (Split): Use parameter associations for better
      	readability. Integrate flag Is_Ada_05.
      	(Time_Of): Remove flag Leap_Checks. Use parameter associations for
      	better readability. Integrate flag Is_Ada_05.
      
      From-SVN: r125363
      Hristian Kirtchev committed
    • a-intnam-aix.ads: Adjust comment to account for SIGADAABORT change (SIGEMT is… · f936abf3
      a-intnam-aix.ads: Adjust comment to account for SIGADAABORT change (SIGEMT is now used instead of...
      
      2007-04-20  Thomas Quinot  <quinot@adacore.com>
      	    Arnaud Charlet  <charlet@adacore.com>
      
      	* a-intnam-aix.ads: 
      	Adjust comment to account for SIGADAABORT change (SIGEMT is now used
      	instead of SIGTERM on AIX).
      
      	* s-osinte-aix.ads (Linker_Options): Use -pthread instead of -lpthreads.
      	(Time_Slice_Supported): Set to True.
      	use SIGEMT instead of SIGTERM as SIGADAABORT.
      
      From-SVN: r125362
      Thomas Quinot committed
    • g-expect-vms.adb: · 11efec4d
      2007-04-20  Bob Duff  <duff@adacore.com>
      
      	* g-expect-vms.adb: 
      	(Send_Signal, Close): Raise Invalid_Process if the process id is invalid.
      	* g-expect.ads, g-expect.adb (Send): Avoid useless copy of the string.
      	(Send_Signal, Close): Raise Invalid_Process if the process id is
      	invalid.
      	(Pattern_Matcher_Access): Is now a general access type to be able to
      	use aliased string.
      
      From-SVN: r125361
      Bob Duff committed
    • g-string.adb, [...]: Replace GNAT.xxx by System.xxx when appropriate. · 30681738
      2007-04-20  Robert Dewar  <dewar@adacore.com>
      
      	* g-string.adb, s-proinf-irix-athread.adb, s-gloloc-mingw.adb,
      	s-tfsetr-default.adb, gnatfind.adb, gnatxref.adb, gprep.adb,
      	g-regexp.adb, g-regexp.ads, g-regpat.ads, g-tasloc.adb, g-tasloc.ads,
      	output.adb, switch-m.ads, tree_in.ads, tree_io.ads, indepsw.ads,
      	g-utf_32.adb, g-utf_32.ads, a-wichun.adb, a-wichun.ads, a-zchuni.adb,
      	a-zchuni.ads: Replace GNAT.xxx by System.xxx when appropriate.
      
      	* s-utf_32.adb, s-utf_32.ads, s-os_lib.adb, s-os_lib.ads, s-regexp.adb,
      	s-regexp.ads, s-regpat.adb, s-regpat.ads, s-string.adb, s-string.ads,
      	s-tasloc.adb, s-tasloc.ads: New files.
      
      From-SVN: r125360
      Robert Dewar committed