diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:35:26 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:35:26 +0000 |
commit | 9f373bb8832c6f7b52c057ab7db0f09433c9f222 (patch) | |
tree | 91e1755b20c022b6125eab58f540040f0dac13ed /gcc/ada/sinfo.ads | |
parent | 833fb39207d50a1970c50e332349afe7423fde27 (diff) | |
download | gcc-9f373bb8832c6f7b52c057ab7db0f09433c9f222.tar.gz |
2005-06-14 Ed Schonberg <schonberg@adacore.com>
Javier Miranda <miranda@adacore.com>
Thomas Quinot <quinot@adacore.com>
Robert Dewar <dewar@adacore.com>
Hristian Kirtchev <kirtchev@adacore.com>
Gary Dismukes <dismukes@adacore.com>
* einfo.ads, einfo.adb (Is_Local_Anonymous_Access): New flag on
anonymous access types, to indicate that the accessibility level of
the type is determined by that of the enclosing declaration.
(Has_Persistent_BSS): New flag
(Set_Is_Primitive_Wrapper): Upgrade the barrier to allow the usage
of this attribute with functions.
(Is_Primitive_Wrapper): Remove the barrier.
(Has_Specified_Stream_Input, Has_Specified_Stream_Output,
Has_Specified_Stream_Read, Has_Specified_Stream_Write):
New subprograms.
(Set_Has_Specified_Stream_Input, Set_Has_Specified_Stream_Output,
Set_Has_Specified_Stream_Read, Set_Has_Specified_Stream_Write):
New subprograms.
(Is_Pure_Unit_Access_Type): New flag
(Abstract_Interfaces): Complete the assertion to cover all usages.
(Set_Is_Interface): Complete the assertion to cover all usages.
(Is_Primitive_Wrapper): New attribute.
(Is_Obsolescent): Now applies to all entities (though it is only set
for subprograms currently)
New flag: Has_Constrained_Partial_View, to implemente Ada 2005 AI-363,
which solves various problems concerning access subtypes.
(Has_Persistent_BSS): New flag
(Is_Primitive_Wrapper, Set_Primitive_Wrapper): Code cleanup.
Remove these subprograms because this attribute is currently
not used.
New entity flags:
Has_Specified_Stream_Input (Flag190)
Has_Specified_Stream_Output (Flag191)
Has_Specified_Stream_Read (Flag192)
Has_Specified_Stream_Write (Flag193)
Present in all type and subtype entities. Set for a given view if the
corresponding stream-oriented attribute has been defined by an
attribute definition clause. When such a clause occurs, a TSS is set
on the underlying full view; the flags are used to track visibility of
the attribute definition clause for partial or incomplete views.
(Is_Pure_Unit_Access_Type): New flag
Clarify use of Is_Internal.
(Is_Primitive_Wrapper): New attribute present in primitive subprograms
internally generated to wrap the invocation of tasks and protected
types that implement interfaces.
(Implementation_Base_Type): Documentation correction
(Is_Obsolescent): Now applies to all entities (though it is only set
for subprograms currently)
New flag: Has_Constrained_Partial_View, to implement Ada 2005 AI-363,
which solves various problems concerning access subtypes.
* exp_ch9.adb (Type_Conformant_Parameters): Introduce mode conformance
for examined parameters. Identify unequal parameter list lengths as
non-conformant parameters.
(Overriding_Possible): Do not check for "All" qualifier in declaration
of controlling access parameter, following prescription of AI-404.
(Build_Entry_Wrapper_Spec, Build_Entry_Wrapper_Body): New subprograms
that build the procedure body that wraps an entry invocation
(Build_Corresponding_Record, Build_Protected_Sub_Specification,
Expand_N_Protected_Body, Expand_N_Protected_Type_Declaration,
Expand_N_Task_Body, Expand_N_Task_Type_Declaration): Modified to
give support to abstract interface types
* freeze.adb (Freeze_Entity): Issue error message if
Is_Pure_Unit_Access_Type set, unless we are in Ada 2005 mode and the
type has no storage pool (Ada 2005) AI-366.
Also modified to give support to abstract interface types
(Freeze_Subprogram): Issue an error for a dispatching subprogram with an
Inline_Always pragma.
* par-ch9.adb (P_Task_Items): Reserved words "not" or "overriding" may
now begin an entry declaration.
(P_Entry_Or_Subprogram_With_Indicator): New procedure in
P_Protected_Operation_Declaration_Opt. Parse an entry declaration or
a subprogram declaration preceded by an overriding indicator.
(P_Protected_Operation_Declaration_Opt): Add case for parsing entry
declarations or subprogram declarations preceded by reserved words
"not" or "overriding".
(P_Entry_Declaration): Update comment. Parse and check overriding
indicator, set semantic flags of entry declarations.
(P_Task): New error message in case of private applied
to a task type declaration.
(P_Protected): New error message in case of private applied
to a task type declaration.
* sem_ch7.adb (Preserve_Full_Attributes): Modified to handle the case
in which the full view of a type implementing an interface is a
concurrent type.
(Has_Overriding_Pragma): Remove obsolete implementation of AI-218.
Declare_Inherited_Private_Subprograms): If an explicit operation
overrides an operation that is inherited in the private part, mark the
explicit one as overriding, to enable overriding indicator checks.
(Preserve_Full_Attributes): Propagate Is_Unchecked_Union attribute from
full view to partial view, to simplify handling in back-end.
* sprint.adb: Print interface lists where needed: derived types,
protected types, task types.
output "is null" for null procedures. Part of implementation of
* sem_cat.adb (Validate_Access_Type_Declaration): Implement AI-366
relaxation of rules for access types in pure, shared passive partitions.
* exp_strm.adb (Build_Mutable_Record_Read_Procedure): Reorganize to
first read discriminants into temporary objects, performing checks on
the read values, then possibly performing discriminant checks on the
actual (if it is constrained), and only finally reading the components
into a constrained temporary object.
(Build_Elementary_Input_Call): Adjust the specific circuitry for the
case of reading discriminants of a mutable record type to recognize
the new form of the code generated by
Build_Mutable_Record_Read_Procedure.
* exp_tss.ads, exp_tss.adb (Make_Init_Proc_Name): Reimplement in terms
of a simple call to Make_TSS_Name.
(Make_TSS_Name_Local): Add the TSS name as the last thing in the name
buffer, in order for Is_TSS to work correctly on local TSS names.
* sem_attr.ads, sem_attr.adb (Resolve_Attribute, case 'Access): Use flag
Is_Local_Anonymous_Access to check legaliy of attributes in the
context of access components and stand-alone access objects.
(Stream_Attribute_Available): In Ada 95 mode, a stream attribute is
treated as available for a limited private type if there is an
attribute_definition_clause that applies to its full view, but not in
other cases where the attribute is available for the full view
(specifically, the sole fact that the full view is non-limited does not
make the attribute available for the partial view).
(Build_Access_Subprogram_Type): Diagnose attempt to apply 'access to a
non-overloaded intrinsic subprogram.
(Check_Stream_Attribute): Reject an attribute reference for an
unavailable stream attribute even if the prefix is not a limited type
(case of a 'Input attribute reference for an abstract, non-classwide
type)
(Stream_Attribute_Available): New function to determine whether a stream
attribute is available at a place.
(Check_Attribute): Use Stream_Attribute_Available instead of just
testing for TSS presence on the implementation base type.
(Analyze_Attribute): Modified to give support to task interfaces.
(Analyze_Access_Attribute): Add error check for use of an Access (or
Unrestricted_Access) attribute with a subprogram marked as
Inline_Always.
(Analyze_Attribute, case Attribute_Address): Add error check for use of
an Address attribute with a subprogram marked as Inline_Always.
Update Eval_Attribute to handle new value of Width from AI-395
* sem_ch13.adb (Analyze_Stream_TSS_Definition): New subprogram.
(Analyze_Attribute_Definition_Clause, cases Input, Output, Read, Write):
Factor common code across the stream-oriented attribute circcuits into
a new subprogram, Analyze_Stream_TSS_Definition. The new uniform
processing is functionally identical to the previous duplicated one,
except that an expression that denotes an abstract subprogram will now
be rejected, as mandated by AI-195 item 5.
* sem_util.ads, sem_util.adb (Type_Access_Level): Use flag
Is_Local_Anonymous_Access to apply accessibility checks to access
components and stand-alone access objects.
(Has_Discriminant_Dependent_Constraint): Moved to spec for use
elsewhere.
(Is_Potentially_Persistent_Type): New function
(Is_Dependent_Component_Of_Mutable_Object): If the enclosing object is
a heap-object whose type has a constrained partial view, the object is
unconstrained and the component may depend on a discriminant, making its
renaming illegal.
* sinfo.ads, sinfo.adb
(Must_Not_Override): Flag applicable to N_Entry_Declaration.
(Must_Override): Flag applicable to N_Entry_Declaration.
Indicate that interface_list can appear in single task and single
protected declarations.
Replace Is_Overriding and Not_Overriding with Must_Override and
Must_Not_Override, to better express intent of AI.
Is_Overriding, Not_Overriding: Ada2005 flags that indicate the presence
of an overriding indicator in a subprogram or instance.
Ada 2005 (AI-248) Null_Present can appear in a procedure specification.
Add the overriding indicator [[not] overriding] construct to the
following grammar productions:
ENTRY_DECLARATION
GENERIC_INSTANTIATION
SUBPROGRAM_SPECIFICATION
* par-ch10.adb (P_Compilation_Unit): Subprogram declaration or body
can start with an overriding indicator.
* par-ch6.adb (P_Subprogram): Recognize overriding indicator, and set
flags accordingly on subrogram specifications or instances.
* sem_ch8.adb:
(Analyze_Subprogram_Renaming): For a renaming_as_body, verify that the
overriding_indicator, if present, is consistent with status of spec.
Improve error message for null-excluding checks on controlling access
parameters.
(Check_In_Previous_With_Clause): Protect the frontend against
previously reported critical errors in the context clauses.
Save and restore Ada_Version_Explicit, for implementation of AI-362
(Analyze_Subprogram_Renaming): If the new entity is a dispatching
operation verify that controlling formals of the renamed entity that
are access parameters are explicitly non-null.
(Find_Expanded_Name): Improve error message when prefix is an illegal
reference to a private child unit.
* exp_imgv.adb, s-imgwch.ads, s-imgwch.adb, s-valwch.adb,
s-valwch.ads, s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdwch.adb:
Rewrite to correspond to new wide character names in AI-395
* par-ch12.adb (P_Formal_Subprogram_Declaration): Recognize null
default procedures.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r-- | gcc/ada/sinfo.ads | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index c7df4dbd8d3..d5da73cb42c 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1958,6 +1958,8 @@ package Sinfo is -- DEFINING_IDENTIFIER_LIST : [aliased] [constant] -- [NULL_EXCLUSION] SUBTYPE_INDICATION [:= EXPRESSION]; -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant] + -- ACCESS_DEFINITION [:= EXPRESSION]; + -- | DEFINING_IDENTIFIER_LIST : [aliased] [constant] -- ARRAY_TYPE_DEFINITION [:= EXPRESSION]; -- | SINGLE_TASK_DECLARATION -- | SINGLE_PROTECTED_DECLARATION @@ -1994,13 +1996,17 @@ package Sinfo is -- extra temporary (with Is_True_Constant set False), and initialize -- this temporary as required (the temporary itself is not atomic). + -- Note: there is not node kind for object definition. Instead, the + -- corresponding field holds a subtype indication, an array type + -- definition, or (Ada 2005, AI-406) an access definition. + -- N_Object_Declaration -- Sloc points to first identifier -- Defining_Identifier (Node1) -- Aliased_Present (Flag4) set if ALIASED appears -- Constant_Present (Flag17) set if CONSTANT appears -- Null_Exclusion_Present (Flag11) - -- Object_Definition (Node4) subtype indication/array type definition + -- Object_Definition (Node4) subtype indic./array type def./ access def. -- Expression (Node3) (set to Empty if not present) -- Handler_List_Entry (Node2-Sem) -- Corresponding_Generic_Association (Node5-Sem) @@ -3893,8 +3899,10 @@ package Sinfo is ----------------------------------- -- SUBPROGRAM_SPECIFICATION ::= + -- [[not] overriding] -- procedure DEFINING_PROGRAM_UNIT_NAME PARAMETER_PROFILE - -- | function DEFINING_DESIGNATOR PARAMETER_AND_RESULT_PROFILE + -- | [[not] overriding] + -- function DEFINING_DESIGNATOR PARAMETER_AND_RESULT_PROFILE -- Note: there are no separate nodes for the profiles, instead the -- information appears directly in the following nodes. @@ -3906,6 +3914,8 @@ package Sinfo is -- Parameter_Specifications (List3) (set to No_List if no formal part) -- Subtype_Mark (Node4) for return type -- Generic_Parent (Node5-Sem) + -- Must_Override (Flag14) set if overriding indicator present + -- Must_Not_Override (Flag15) set if not_overriding indicator present -- N_Procedure_Specification -- Sloc points to PROCEDURE @@ -3913,6 +3923,11 @@ package Sinfo is -- Elaboration_Boolean (Node2-Sem) -- Parameter_Specifications (List3) (set to No_List if no formal part) -- Generic_Parent (Node5-Sem) + -- Null_Present (Flag13) set for null procedure case (Ada 2005 feature) + -- Must_Override (Flag14) set if overriding indicator present + -- Must_Not_Override (Flag15) set if not_overriding indicator present + + -- Note: overriding indicator is an Ada 2005 feature --------------------- -- 6.1 Designator -- @@ -4470,11 +4485,13 @@ package Sinfo is ---------------------------------- -- SINGLE_TASK_DECLARATION ::= - -- task DEFINING_IDENTIFIER [is TASK_DEFINITION]; + -- task DEFINING_IDENTIFIER + -- [is [new INTERFACE_LIST with] TASK_DEFINITITION]; -- N_Single_Task_Declaration -- Sloc points to TASK -- Defining_Identifier (Node1) + -- Interface_List (List2) (set to No_List if none) -- Task_Definition (Node3) (set to Empty if not present) -------------------------- @@ -4553,13 +4570,15 @@ package Sinfo is --------------------------------------- -- SINGLE_PROTECTED_DECLARATION ::= - -- protected DEFINING_IDENTIFIER is PROTECTED_DEFINITION; + -- protected DEFINING_IDENTIFIER + -- is [new INTERFACE_LIST with] PROTECTED_DEFINITION; -- Note: single protected declarations are not allowed in Ada 83 mode -- N_Single_Protected_Declaration -- Sloc points to PROTECTED -- Defining_Identifier (Node1) + -- Interface_List (List2) (set to No_List if none) -- Protected_Definition (Node3) ------------------------------- @@ -4631,6 +4650,7 @@ package Sinfo is ------------------------------ -- ENTRY_DECLARATION ::= + -- [[not] overriding] -- entry DEFINING_IDENTIFIER -- [(DISCRETE_SUBTYPE_DEFINITION)] PARAMETER_PROFILE; @@ -4640,6 +4660,10 @@ package Sinfo is -- Discrete_Subtype_Definition (Node4) (set to Empty if not present) -- Parameter_Specifications (List3) (set to No_List if no formal part) -- Corresponding_Body (Node5-Sem) + -- Must_Override (Flag14) set if overriding indicator present + -- Must_Not_Override (Flag15) set if not_overriding indicator present + + -- Note: overriding indicator is an Ada 2005 feature ----------------------------- -- 9.5.2 Accept statement -- @@ -5489,9 +5513,11 @@ package Sinfo is -- GENERIC_INSTANTIATION ::= -- package DEFINING_PROGRAM_UNIT_NAME is -- new generic_package_NAME [GENERIC_ACTUAL_PART]; - -- | procedure DEFINING_PROGRAM_UNIT_NAME is + -- | [[not] overriding] + -- procedure DEFINING_PROGRAM_UNIT_NAME is -- new generic_procedure_NAME [GENERIC_ACTUAL_PART]; - -- | function DEFINING_DESIGNATOR is + -- | [[not] overriding] + -- function DEFINING_DESIGNATOR is -- new generic_function_NAME [GENERIC_ACTUAL_PART]; -- N_Package_Instantiation @@ -5512,6 +5538,8 @@ package Sinfo is -- Generic_Associations (List3) (set to No_List if no -- generic actual part) -- Instance_Spec (Node5-Sem) + -- Must_Override (Flag14) set if overriding indicator present + -- Must_Not_Override (Flag15) set if not_overriding indicator present -- ABE_Is_Certain (Flag18-Sem) -- N_Function_Instantiation @@ -5522,8 +5550,12 @@ package Sinfo is -- generic actual part) -- Parent_Spec (Node4-Sem) -- Instance_Spec (Node5-Sem) + -- Must_Override (Flag14) set if overriding indicator present + -- Must_Not_Override (Flag15) set if not_overriding indicator present -- ABE_Is_Certain (Flag18-Sem) + -- Note: overriding indicator is an Ada 2005 feature + ------------------------------ -- 12.3 Generic Actual Part -- ------------------------------ @@ -7565,6 +7597,12 @@ package Sinfo is function Must_Not_Freeze (N : Node_Id) return Boolean; -- Flag8 + function Must_Not_Override + (N : Node_Id) return Boolean; -- Flag15 + + function Must_Override + (N : Node_Id) return Boolean; -- Flag14 + function Name (N : Node_Id) return Node_Id; -- Node2 @@ -8366,6 +8404,12 @@ package Sinfo is procedure Set_Must_Not_Freeze (N : Node_Id; Val : Boolean := True); -- Flag8 + procedure Set_Must_Not_Override + (N : Node_Id; Val : Boolean := True); -- Flag15 + + procedure Set_Must_Override + (N : Node_Id; Val : Boolean := True); -- Flag14 + procedure Set_Name (N : Node_Id; Val : Node_Id); -- Node2 @@ -8828,6 +8872,8 @@ package Sinfo is pragma Inline (More_Ids); pragma Inline (Must_Be_Byte_Aligned); pragma Inline (Must_Not_Freeze); + pragma Inline (Must_Not_Override); + pragma Inline (Must_Override); pragma Inline (Name); pragma Inline (Names); pragma Inline (Next_Entity); @@ -9092,6 +9138,8 @@ package Sinfo is pragma Inline (Set_More_Ids); pragma Inline (Set_Must_Be_Byte_Aligned); pragma Inline (Set_Must_Not_Freeze); + pragma Inline (Set_Must_Not_Override); + pragma Inline (Set_Must_Override); pragma Inline (Set_Name); pragma Inline (Set_Names); pragma Inline (Set_Next_Entity); |