-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception, --
+-- version 3.1, as published by the Free Software Foundation. --
+-- --
+-- You should have received a copy of the GNU General Public License and --
+-- a copy of the GCC Runtime Library Exception along with this program; --
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- package provides a basic tree structure. Sinfo describes how this structure
-- is used to represent the syntax of an Ada program.
--- The grammar in the RM is followed very closely in the tree
--- design, and is repeated as part of this source file.
+-- The grammar in the RM is followed very closely in the tree design, and is
+-- repeated as part of this source file.
-- The tree contains not only the full syntactic representation of the
-- program, but also the results of semantic analysis. In particular, the
-- In the following node definitions, all fields, both syntactic and
-- semantic, are documented. The one exception is in the case of entities
- -- (defining indentifiers, character literals and operator symbols), where
+ -- (defining identifiers, character literals and operator symbols), where
-- the usage of the fields depends on the entity kind. Entity fields are
-- fully documented in the separate package Einfo.
-- Present in N_Freeze_Entity nodes for Incomplete or private types.
-- Contains the list of access types which may require specific treatment
-- when the nature of the type completion is completely known. An example
- -- of such treatement is the generation of the associated_final_chain.
+ -- of such treatment is the generation of the associated_final_chain.
-- Actions (List1-Sem)
-- This field contains a sequence of actions that are associated with the
-- elements.
-- All_Others (Flag11-Sem)
- -- Present in an N_Others_Choice node. This flag is set in the case of an
- -- others exception where all exceptions are to be caught, even those
- -- that are not normally handled (in particular the tasking abort
- -- signal). This is used for translation of the at end handler into a
- -- normal exception handler.
+ -- Present in an N_Others_Choice node. This flag is set for an others
+ -- exception where all exceptions are to be caught, even those that are
+ -- not normally handled (in particular the tasking abort signal). This
+ -- is used for translation of the at end handler into a normal exception
+ -- handler.
-- Assignment_OK (Flag15-Sem)
-- This flag is set in a subexpression node for an object, indicating
-- that the associated object can be modified, even if this would not
-- normally be permissible (either by direct assignment, or by being
-- passed as an out or in-out parameter). This is used by the expander
- -- for a number of purposes, including initialzation of constants and
+ -- for a number of purposes, including initialization of constants and
-- limited type objects (such as tasks), setting discriminant fields,
-- setting tag values, etc. N_Object_Declaration nodes also have this
-- flag defined. Here it is used to indicate that an initialization
- -- expression is valid, even where it would normally not be allowed (e.g.
- -- where the type involved is limited).
+ -- expression is valid, even where it would normally not be allowed
+ -- (e.g. where the type involved is limited).
-- Associated_Node (Node4-Sem)
-- Present in nodes that can denote an entity: identifiers, character
-- literals, operator symbols, expanded names, operator nodes, and
- -- attribute reference nodes (all these nodes have an Entity field). This
- -- field is also present in N_Aggregate, N_Selected_Component, and
+ -- attribute reference nodes (all these nodes have an Entity field).
+ -- This field is also present in N_Aggregate, N_Selected_Component, and
-- N_Extension_Aggregate nodes. This field is used in generic processing
- -- to create links between the generic template and the generic copy. See
- -- Sem_Ch12.Get_Associated_Node for full details. Note that this field
- -- overlaps Entity, which is fine, since, as explained in Sem_Ch12, the
- -- normal function of Entity is not required at the point where the
+ -- to create links between the generic template and the generic copy.
+ -- See Sem_Ch12.Get_Associated_Node for full details. Note that this
+ -- field overlaps Entity, which is fine, since, as explained in Sem_Ch12,
+ -- the normal function of Entity is not required at the point where the
-- Associated_Node is set. Note also, that in generic templates, this
-- means that the Entity field does not necessarily point to an Entity.
-- Since the back end is expected to ignore generic templates, this is
-- harmless.
-- At_End_Proc (Node1)
- -- This field is present in an N_Handled_Sequence_Of_Statements node. It
- -- contains an identifier reference for the cleanup procedure to be
+ -- This field is present in an N_Handled_Sequence_Of_Statements node.
+ -- It contains an identifier reference for the cleanup procedure to be
-- called. See description of this node for further details.
-- Backwards_OK (Flag6-Sem)
- -- A flag present in the N_Assignment_Statement node. It is used only if
- -- the type being assigned is an array type, and is set if analysis
+ -- A flag present in the N_Assignment_Statement node. It is used only
+ -- if the type being assigned is an array type, and is set if analysis
-- determines that it is definitely safe to do the copy backwards, i.e.
- -- starting at the highest addressed element. Note that if neither of the
- -- flags Forwards_OK or Backwards_OK is set, it means that the front end
- -- could not determine that either direction is definitely safe, and a
- -- runtime check may be required if the backend cannot figure it out.
+ -- starting at the highest addressed element. This is the case if either
+ -- the operands do not overlap, or they may overlap, but if they do,
+ -- then the left operand is at a higher address than the right operand.
+ --
+ -- Note: If neither of the flags Forwards_OK or Backwards_OK is set, it
+ -- means that the front end could not determine that either direction is
+ -- definitely safe, and a runtime check may be required if the backend
+ -- cannot figure it out. If both flags Forwards_OK and Backwards_OK are
+ -- set, it means that the front end can assure no overlap of operands.
-- Body_To_Inline (Node3-Sem)
-- present in subprogram declarations. Denotes analyzed but unexpanded
-- which is used directly in later calls to the original subprogram.
-- Body_Required (Flag13-Sem)
- -- A flag that appears in the N_Compilation_Unit node indicating that the
- -- corresponding unit requires a body. For the package case, this
+ -- A flag that appears in the N_Compilation_Unit node indicating that
+ -- the corresponding unit requires a body. For the package case, this
-- indicates that a completion is required. In Ada 95, if the flag is not
-- set for the package case, then a body may not be present. In Ada 83,
-- if the flag is not set for the package case, then body is optional.
-- permitted (in Ada 83 or Ada 95).
-- By_Ref (Flag5-Sem)
- -- A flag present in N_Simple_Return_Statement and
- -- N_Extended_Return_Statement.
- -- It is set when the returned expression is already allocated on the
- -- secondary stack and thus the result is passed by reference rather
+ -- Present in N_Simple_Return_Statement and N_Extended_Return_Statement,
+ -- this flag is set when the returned expression is already allocated on
+ -- the secondary stack and thus the result is passed by reference rather
-- than copied another time.
-- Check_Address_Alignment (Flag11-Sem)
-- Comes_From_Extended_Return_Statement (Flag18-Sem)
-- Present in N_Simple_Return_Statement nodes. True if this node was
- -- constructed as part of the expansion of an
- -- N_Extended_Return_Statement.
+ -- constructed as part of the N_Extended_Return_Statement expansion.
+ -- .
-- Compile_Time_Known_Aggregate (Flag18-Sem)
-- Present in N_Aggregate nodes. Set for aggregates which can be fully
-- Condition_Actions (List3-Sem)
-- This field appears in else-if nodes and in the iteration scheme node
-- for while loops. This field is only used during semantic processing to
- -- temporarily hold actions inserted into the tree. In the tree passed to
- -- gigi, the condition actions field is always set to No_List. For
+ -- temporarily hold actions inserted into the tree. In the tree passed
+ -- to gigi, the condition actions field is always set to No_List. For
-- details on how this field is used, see the routine Insert_Actions in
-- package Exp_Util, and also the expansion routines for the relevant
-- nodes.
-- Controlling_Argument (Node1-Sem)
- -- This field is set in procedure and function call nodes if the call is
- -- a dispatching call (it is Empty for a non-dispatching call). It
+ -- This field is set in procedure and function call nodes if the call
+ -- is a dispatching call (it is Empty for a non-dispatching call). It
-- indicates the source of the call's controlling tag. For procedure
-- calls, the Controlling_Argument is one of the actuals. For function
-- that has a dispatching result, it is an entity in the context of the
- -- call that can provide a tag, or else it is the tag of the root type of
- -- the class. It can also specify a tag directly rather than being a
+ -- call that can provide a tag, or else it is the tag of the root type
+ -- of the class. It can also specify a tag directly rather than being a
-- tagged object. The latter is needed by the implementations of AI-239
-- and AI-260.
-- Conversion_OK (Flag14-Sem)
- -- A flag set on type conversion nodes to indicate that the conversion is
- -- to be considered as being valid, even though it is the case that the
- -- conversion is not valid Ada. This is used for Enum_Rep, Fixed_Value
- -- and Integer_Value attributes, for internal conversions done for
+ -- A flag set on type conversion nodes to indicate that the conversion
+ -- is to be considered as being valid, even though it is the case that
+ -- the conversion is not valid Ada. This is used for attributes Enum_Rep,
+ -- Fixed_Value and Integer_Value, for internal conversions done for
-- fixed-point operations, and for certain conversions for calls to
-- initialization procedures. If Conversion_OK is set, then Etype must be
-- set (the analyzer assumes that Etype has been set). For the case of
-- Corresponding_Spec (Node5-Sem)
-- This field is set in subprogram, package, task, and protected body
-- nodes, where it points to the defining entity in the corresponding
- -- spec. The attribute is also set in N_With_Clause nodes, where it
- -- points to the defining entity for the with'ed spec, and in a
- -- subprogram renaming declaration when it is a Renaming_As_Body. The
- -- field is Empty if there is no corresponding spec, as in the case of a
- -- subprogram body that serves as its own spec.
+ -- spec. The attribute is also set in N_With_Clause nodes where it points
+ -- to the defining entity for the with'ed spec, and in a subprogram
+ -- renaming declaration when it is a Renaming_As_Body. The field is Empty
+ -- if there is no corresponding spec, as in the case of a subprogram body
+ -- that serves as its own spec.
-- Corresponding_Stub (Node3-Sem)
-- This field is present in an N_Subunit node. It holds the node in
- -- the parent unit that is the stub declaration for the subunit. it is
+ -- the parent unit that is the stub declaration for the subunit. It is
-- set when analysis of the stub forces loading of the proper body. If
-- expansion of the proper body creates new declarative nodes, they are
-- inserted at the point of the corresponding_stub.
-- See also the description of Do_Range_Check for this case. The only
-- attribute references which use this flag are Pred and Succ, where it
-- means that the result should be checked for going outside the base
- -- range.
+ -- range. Note that this flag is not set for modular types.
-- Do_Range_Check (Flag9-Sem)
- -- This flag is set on an expression which appears in a context where
- -- a range check is required. The target type is clear from the
- -- context. The contexts in which this flag can appear are limited to
- -- the following.
+ -- This flag is set on an expression which appears in a context where a
+ -- range check is required. The target type is clear from the context.
+ -- The contexts in which this flag can appear are the following:
-- Right side of an assignment. In this case the target type is
-- taken from the left side of the assignment, which is referenced
-- desirable for correct elaboration for this unit.
-- Elaboration_Boolean (Node2-Sem)
- -- This field is present in function and procedure specification
- -- nodes. If set, it points to the entity for a Boolean flag that
- -- must be tested for certain calls to check for access before
- -- elaboration. See body of Sem_Elab for further details. This
- -- field is Empty if no elaboration boolean is required.
+ -- This field is present in function and procedure specification nodes.
+ -- If set, it points to the entity for a Boolean flag that must be tested
+ -- for certain calls to check for access before elaboration. See body of
+ -- Sem_Elab for further details. This field is Empty if no elaboration
+ -- boolean is required.
-- Else_Actions (List3-Sem)
-- This field is present in conditional expression nodes. During code
-- always set to No_List.
-- Enclosing_Variant (Node2-Sem)
- -- This field is present in the N_Variant node and identifies the
- -- Node_Id corresponding to the immediately enclosing variant when
- -- the variant is nested, and N_Empty otherwise. Set during semantic
- -- processing of the variant part of a record type.
+ -- This field is present in the N_Variant node and identifies the Node_Id
+ -- corresponding to the immediately enclosing variant when the variant is
+ -- nested, and N_Empty otherwise. Set during semantic processing of the
+ -- variant part of a record type.
-- Entity (Node4-Sem)
-- Appears in all direct names (identifiers, character literals, and
-- Expansion_Delayed (Flag11-Sem)
-- Set on aggregates and extension aggregates that need a top-down rather
- -- than bottom up expansion. Typically aggregate expansion happens bottom
+ -- than bottom-up expansion. Typically aggregate expansion happens bottom
-- up. For nested aggregates the expansion is delayed until the enclosing
-- aggregate itself is expanded, e.g. in the context of a declaration. To
-- delay it we set this flag. This is done to avoid creating a temporary
-- left-hand side of individual assignment to each sub-component.
-- First_Inlined_Subprogram (Node3-Sem)
- -- Present in the N_Compilation_Unit node for the main program. Points to
- -- a chain of entities for subprograms that are to be inlined. The
+ -- Present in the N_Compilation_Unit node for the main program. Points
+ -- to a chain of entities for subprograms that are to be inlined. The
-- Next_Inlined_Subprogram field of these entities is used as a link
- -- pointer with Empty marking the end of the list. This field is Empty if
- -- there are no inlined subprograms or inlining is not active.
+ -- pointer with Empty marking the end of the list. This field is Empty
+ -- if there are no inlined subprograms or inlining is not active.
-- First_Named_Actual (Node4-Sem)
-- Present in procedure call statement and function call nodes, and also
-- First_Subtype_Link (Node5-Sem)
-- Present in N_Freeze_Entity node for an anonymous base type that is
- -- implicitly created by the declaration of a first subtype. It points to
- -- the entity for the first subtype.
+ -- implicitly created by the declaration of a first subtype. It points
+ -- to the entity for the first subtype.
-- Float_Truncate (Flag11-Sem)
-- A flag present in type conversion nodes. This is used for float to
-- with rounding (see Expand_N_Type_Conversion).
-- Forwards_OK (Flag5-Sem)
- -- A flag present in the N_Assignment_Statement node. It is used only if
- -- the type being assigned is an array type, and is set if analysis
+ -- A flag present in the N_Assignment_Statement node. It is used only
+ -- if the type being assigned is an array type, and is set if analysis
-- determines that it is definitely safe to do the copy forwards, i.e.
- -- starting at the lowest addressed element. Note that if neither of the
- -- flags Forwards_OK or Backwards_OK is set, it means that the front end
- -- could not determine that either direction is definitely safe, and a
- -- runtime check is required.
+ -- starting at the lowest addressed element. This is the case if either
+ -- the operands do not overlap, or they may overlap, but if they do,
+ -- then the left operand is at a lower address than the right operand.
+ --
+ -- Note: If neither of the flags Forwards_OK or Backwards_OK is set, it
+ -- means that the front end could not determine that either direction is
+ -- definitely safe, and a runtime check may be required if the backend
+ -- cannot figure it out. If both flags Forwards_OK and Backwards_OK are
+ -- set, it means that the front end can assure no overlap of operands.
-- From_At_End (Flag4-Sem)
-- This flag is set on an N_Raise_Statement node if it corresponds to
-- declarations if the visibility at instantiation is different from the
-- visibility at generic definition.
+ -- Has_Relative_Deadline_Pragma (Flag9-Sem)
+ -- A flag present in N_Subprogram_Body and N_Task_Definition nodes to
+ -- flag the presence of a pragma Relative_Deadline.
+
-- Has_Self_Reference (Flag13-Sem)
-- Present in N_Aggregate and N_Extension_Aggregate. Indicates that one
-- of the expressions contains an access attribute reference to the
-- This flag is set in the N_With_Clause node that is implicitly
-- generated for runtime units that are loaded by the expander, and also
-- for package System, if it is loaded implicitly by a use of the
- -- 'Address or 'Tag attribute.
+ -- 'Address or 'Tag attribute. ???There are other implicit with clauses
+ -- as well.
-- Includes_Infinities (Flag11-Sem)
-- This flag is present in N_Range nodes. It is set for the range of
-- unconstrained float types defined in Standard, which include not only
- -- the given range of values, but also legtitimately can include infinite
+ -- the given range of values, but also legitimately can include infinite
-- values. This flag is false for any float type for which an explicit
-- range is given by the programmer, even if that range is identical to
-- the range for Float.
-- that the reference occurs within a discriminant check. The
-- significance is that optimizations based on assuming that the
-- discriminant check has a correct value cannot be performed in this
- -- case (or the disriminant check may be optimized away!)
+ -- case (or the discriminant check may be optimized away!)
-- Is_Machine_Number (Flag11-Sem)
-- This flag is set in an N_Real_Literal node to indicate that the value
-- Is_Null_Loop (Flag16-Sem)
-- This flag is set in an N_Loop_Statement node if the corresponding loop
- -- can be determined to be null at compile time. This is used to suppress
- -- any warnings that would otherwise be issued inside the loop since they
- -- are probably not useful.
+ -- can be determined to be null at compile time. This is used to remove
+ -- the loop entirely at expansion time.
-- Is_Overloaded (Flag5-Sem)
-- A flag present in all expression nodes. Used temporarily during
-- Is_Power_Of_2_For_Shift (Flag13-Sem)
-- A flag present only in N_Op_Expon nodes. It is set when the
- -- exponentiation is of the forma 2 ** N, where the type of N is an
+ -- exponentiation is of the form 2 ** N, where the type of N is an
-- unsigned integral subtype whose size does not exceed the size of
-- Standard_Integer (i.e. a type that can be safely converted to
-- Natural), and the exponentiation appears as the right operand of an
-- Is_Protected_Subprogram_Body (Flag7-Sem)
-- A flag set in a Subprogram_Body block to indicate that it is the
- -- implemenation of a protected subprogram. Such a body needs cleanup
+ -- implementation of a protected subprogram. Such a body needs cleanup
-- handler to make sure that the associated protected object is unlocked
-- when the subprogram completes.
-- A flag set in a Block_Statement node to indicate that it is the
-- expansion of a task allocator, or the allocator of an object
-- containing tasks. Such a block requires a cleanup handler to call
- -- Expunge_Unactivted_Tasks to complete any tasks that have been
+ -- Expunge_Unactivated_Tasks to complete any tasks that have been
-- allocated but not activated when the allocator completes abnormally.
-- Is_Task_Master (Flag5-Sem)
--
-- In a compilation unit node, the usage depends on the unit type:
--
- -- For a subprogram body, Library_Unit points to the compilation unit
- -- node of the corresponding spec, unless Acts_As_Spec is set, in which
- -- case it points to itself.
- --
- -- For a package body, Library_Unit points to the compilation unit of
- -- the corresponding package spec.
- --
- -- For a subprogram spec to which pragma Inline applies, Library_Unit
- -- points to the compilation unit node of the corresponding body, if
- -- inlining is active.
+ -- For a library unit body, Library_Unit points to the compilation unit
+ -- node of the corresponding spec, unless it's a subprogram body with
+ -- Acts_As_Spec set, in which case it points to itself.
--
- -- For a generic declaration, Library_Unit points to the compilation
- -- unit node of the corresponding generic body.
+ -- For a spec, Library_Unit points to the compilation unit node of the
+ -- corresponding body, if present. The body will be present if the spec
+ -- is or contains generics that we needed to instantiate. Similarly, the
+ -- body will be present if we needed it for inlining purposes. Thus, if
+ -- we have a spec/body pair, both of which are present, they point to
+ -- each other via Library_Unit.
--
-- For a subunit, Library_Unit points to the compilation unit node of
-- the parent body.
-- points to the explicit actual parameter itself, not to the
-- N_Parameter_Association node (its parent).
+ -- Next_Pragma (Node1-Sem)
+ -- Present in N_Pragma nodes. Used to create a linked list of pragma
+ -- nodes. Currently used for two purposes:
+ --
+ -- Create a list of linked Check_Policy pragmas. The head of this list
+ -- is stored in Opt.Check_Policy_List (which has further details).
+ --
+ -- Used by processing for Pre/Postcondition pragmas to store a list of
+ -- pragmas associated with the spec of a subprogram (see Sem_Prag for
+ -- details).
+
-- Next_Rep_Item (Node5-Sem)
-- Present in pragma nodes and attribute definition nodes. Used to link
-- representation items that apply to an entity. See description of
-- is undefined and should not be read).
-- No_Ctrl_Actions (Flag7-Sem)
- -- Present in N_Assignment_Statement to indicate that no finalize nor nor
- -- adjust should take place on this assignment eventhough the rhs is
+ -- Present in N_Assignment_Statement to indicate that no finalize nor
+ -- adjust should take place on this assignment even though the rhs is
-- controlled. This is used in init procs and aggregate expansions where
-- the generated assignments are more initialisations than real
-- assignments.
-- full details)
-- No_Initialization (Flag13-Sem)
- -- Present in N_Object_Declaration & N_Allocator to indicate that the
+ -- Present in N_Object_Declaration and N_Allocator to indicate that the
-- object must not be initialized (by Initialize or call to an init
-- proc). This is needed for controlled aggregates. When the Object
-- declaration has an expression, this flag means that this expression
-- should not be taken into account (needed for in place initialization
- -- with aggregates)
+ -- with aggregates).
-- No_Truncation (Flag17-Sem)
-- Present in N_Unchecked_Type_Conversion node. This flag has an effect
-- package specification. This field is Empty for library bodies (the
-- parent spec in this case can be found from the corresponding spec).
+ -- PPC_Enabled (Flag5-Sem)
+ -- Present in N_Pragma nodes. This flag is relevant only for precondition
+ -- and postcondition nodes. It is true if the check corresponding to the
+ -- pragma type is enabled at the point where the pragma appears.
+
-- Present_Expr (Uint3-Sem)
-- Present in an N_Variant node. This has a meaningful value only after
-- Gigi has back annotated the tree with representation information. At
-- and N_Extended_Return_Statement nodes. References the entity for the
-- storage pool to be used for the allocate or free call or for the
-- allocation of the returned value from function. Empty indicates that
- -- the global default default pool is to be used. Note that in the case
+ -- the global default pool is to be used. Note that in the case
-- of a return statement, this field is set only if the function returns
-- value of a type whose size is not known at compile time on the
-- secondary stack.
+ -- Suppress_Loop_Warnings (Flag17-Sem)
+ -- Used in N_Loop_Statement node to indicate that warnings within the
+ -- body of the loop should be suppressed. This is set when the range
+ -- of a FOR loop is known to be null, or is probably null (loop would
+ -- only execute if invalid values are present).
+
-- Target_Type (Node2-Sem)
-- Used in an N_Validate_Unchecked_Conversion node to point to the target
-- type entity for the unchecked conversion instantiation which gigi must
-- on fixed-point operands. It indicates that the operands are to be
-- treated as integer values, ignoring small values. This flag is only
-- set as a result of expansion of fixed-point operations. Typically a
- -- fixed-point multplication in the source generates subsidiary
+ -- fixed-point multiplication in the source generates subsidiary
-- multiplication and division operations that work with the underlying
-- integer values and have this flag set. Note that this flag is not
- -- needed on other arithmetic operations (add, neg, subtract etc) since
+ -- needed on other arithmetic operations (add, neg, subtract etc.) since
-- in these cases it is always the case that fixed is treated as integer.
-- The Etype field MUST be set if this flag is set. The analyzer knows to
-- leave such nodes alone, and whoever makes them must set the correct
-- Zero_Cost_Handling (Flag5-Sem)
-- This flag is set in all handled sequence of statement and exception
- -- handler nodes if eceptions are to be handled using the zero-cost
+ -- handler nodes if exceptions are to be handled using the zero-cost
-- mechanism (see Ada.Exceptions and System.Exceptions in files
-- a-except.ads/adb and s-except.ads for full details). What gigi needs
-- to do for such a handler is simply to put the code in the handler
-- N_Pragma
-- Sloc points to pragma identifier
+ -- Next_Pragma (Node1-Sem)
-- Pragma_Argument_Associations (List2) (set to No_List if none)
-- Debug_Statement (Node3) (set to Empty if not Debug, Assert)
-- Pragma_Identifier (Node4)
-- Next_Rep_Item (Node5-Sem)
+ -- PPC_Enabled (Flag5-Sem)
-- Note: we should have a section on what pragmas are passed on to
-- the back end to be processed. This section should note that pragma
-- Note: the back end places some restrictions on the form of the
-- Expression field. If the object being declared is Atomic, then
-- the Expression may not have the form of an aggregate (since this
- -- might cause the back end to generate separate assignments). It
- -- also cannot be a reference to an object marked as a true constant
- -- (Is_True_Constant flag set), where the object is itself initalized
- -- with an aggregate. If necessary the front end must generate an
- -- extra temporary (with Is_True_Constant set False), and initialize
+ -- might cause the back end to generate separate assignments). In this
+ -- case the front end must generate an extra temporary and initialize
-- this temporary as required (the temporary itself is not atomic).
-- Note: there is not node kind for object definition. Instead, the
-- N_Access_Function_Definition
-- Sloc points to ACCESS
-- Null_Exclusion_Present (Flag11)
+ -- Null_Exclusion_In_Return_Present (Flag14)
-- Protected_Present (Flag6)
-- Parameter_Specifications (List3) (set to No_List if no formal part)
-- Result_Definition (Node4) result subtype (subtype mark or access def)
-- limited types for which no stream routines exist officially. In such
-- case, the result is to use the stream attribute for the underlying
-- full type, or in the case of a protected type, the components
- -- (including any disriminants) are merely streamed in order.
+ -- (including any discriminants) are merely streamed in order.
-- See Exp_Attr for a complete description of which attributes are
-- passed onto Gigi, and which are handled entirely by the front end.
-- node (which appears as a singleton list). Box_Present gives support
-- to Ada 2005 (AI-287).
- -----------------------------------
- -- 4.3.1 Commponent Choice List --
- -----------------------------------
+ ----------------------------------
+ -- 4.3.1 Component Choice List --
+ ----------------------------------
-- COMPONENT_CHOICE_LIST ::=
-- component_SELECTOR_NAME {| component_SELECTOR_NAME}
-- No nodes are generated for any of these constructs. Instead, the
-- node for the operator appears directly. When we refer to an
-- expression in this description, we mean any of the possible
- -- consistuent components of an expression (e.g. identifier is
+ -- constituent components of an expression (e.g. identifier is
-- an example of an expression).
------------------
-- subexpression node (it is actually present in all nodes, but only
-- used in subexpression nodes). This count records the number of
-- levels of parentheses. If the number of levels in the source exceeds
- -- the maximum accomodated by this count, then the count is simply left
- -- at the maximum value. This means that there are some pathalogical
+ -- the maximum accommodated by this count, then the count is simply left
+ -- at the maximum value. This means that there are some pathological
-- cases of failure to detect conformance failures (e.g. an expression
-- with 500 levels of parens will conform with one with 501 levels),
-- but we do not need to lose sleep over this.
-- Is_Dynamic_Coextension (Flag18-Sem)
-- plus fields for expression
+ -- Note: like all nodes, the N_Allocator has the Comes_From_Source flag.
+ -- This flag has a special function in conjunction with the restriction
+ -- No_Implicit_Heap_Allocations, which will be triggered if this flag
+ -- is not set. This means that if a source allocator is replaced with
+ -- a constructed allocator, the Comes_From_Source flag should be copied
+ -- to the newly created allocator.
+
---------------------------------
-- 5.1 Sequence Of Statements --
---------------------------------
-- Note: Although the parser will not accept a declaration as a
-- statement, the semantic analyzer may insert declarations (e.g.
-- declarations of implicit types needed for execution of other
- -- statements) into a sequence of statements, so the code genmerator
+ -- statements) into a sequence of statements, so the code generator
-- should be prepared to accept a declaration where a statement is
-- expected. Note also that pragmas can appear as statements.
-- 5.1 Statement Identifier --
-------------------------------
- -- STATEMENT_INDENTIFIER ::= DIRECT_NAME
+ -- STATEMENT_IDENTIFIER ::= DIRECT_NAME
-- The IDENTIFIER of a STATEMENT_IDENTIFIER shall be an identifier
-- (not an OPERATOR_SYMBOL)
-- Note: the back end places some restrictions on the form of the
-- Expression field. If the object being assigned to is Atomic, then
-- the Expression may not have the form of an aggregate (since this
- -- might cause the back end to generate separate assignments). It
- -- also cannot be a reference to an object marked as a true constant
- -- (Is_True_Constant flag set), where the object is itself initalized
- -- with an aggregate. If necessary the front end must generate an
- -- extra temporary (with Is_True_Constant set False), and initialize
+ -- might cause the back end to generate separate assignments). In this
+ -- case the front end must generate an extra temporary and initialize
-- this temporary as required (the temporary itself is not atomic).
-----------------------
-- End_Label (Node4)
-- Has_Created_Identifier (Flag15)
-- Is_Null_Loop (Flag16)
+ -- Suppress_Loop_Warnings (Flag17)
--------------------------
-- 5.5 Iteration Scheme --
-- Is_Entry_Barrier_Function (Flag8-Sem)
-- Is_Task_Master (Flag5-Sem)
-- Was_Originally_Stub (Flag13-Sem)
+ -- Has_Relative_Deadline_Pragma (Flag9-Sem)
-----------------------------------
-- 6.4 Procedure Call Statement --
-- TASK_TYPE_DECLARATION ::=
-- task type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
- -- [is [new INTERFACE_LIST with] TASK_DEFINITITION];
+ -- [is [new INTERFACE_LIST with] TASK_DEFINITION];
-- N_Task_Type_Declaration
-- Sloc points to TASK
-- SINGLE_TASK_DECLARATION ::=
-- task DEFINING_IDENTIFIER
- -- [is [new INTERFACE_LIST with] TASK_DEFINITITION];
+ -- [is [new INTERFACE_LIST with] TASK_DEFINITION];
-- N_Single_Task_Declaration
-- Sloc points to TASK
-- Has_Storage_Size_Pragma (Flag5-Sem)
-- Has_Task_Info_Pragma (Flag7-Sem)
-- Has_Task_Name_Pragma (Flag8-Sem)
+ -- Has_Relative_Deadline_Pragma (Flag9-Sem)
--------------------
-- 9.1 Task Item --
-- GUARD ::= when CONDITION =>
-- As noted above, the CONDITION that is part of a GUARD is included
- -- in the node for the select alernative for convenience.
+ -- in the node for the select alternative for convenience.
-------------------------------
-- 9.7.1 Select Alternative --
-- There is no explicit node in the tree for a compilation, since in
-- general the compiler is processing only a single compilation unit
-- at a time. It is possible to parse multiple units in syntax check
- -- only mode, but they the trees are discarded in any case.
+ -- only mode, but the trees are discarded in that case.
------------------------------
-- 10.1.1 Compilation Unit --
-- CONTEXT_CLAUSE LIBRARY_ITEM
-- | CONTEXT_CLAUSE SUBUNIT
- -- The N_Compilation_Unit node itself respresents the above syntax.
+ -- The N_Compilation_Unit node itself represents the above syntax.
-- However, there are two additional items not reflected in the above
-- syntax. First we have the global declarations that are added by the
-- code generator. These are outer level declarations (so they cannot
-- There is no explicit node in the tree for library item, instead
-- the declaration or body, and the flag for private if present,
- -- appear in the N_Compilation_Unit clause.
+ -- appear in the N_Compilation_Unit node.
- ----------------------------------------
- -- 10.1.1 Library Unit Declararation --
- ----------------------------------------
+ --------------------------------------
+ -- 10.1.1 Library Unit Declaration --
+ --------------------------------------
-- LIBRARY_UNIT_DECLARATION ::=
-- SUBPROGRAM_DECLARATION | PACKAGE_DECLARATION
-- | GENERIC_DECLARATION | GENERIC_INSTANTIATION
- -------------------------------------------------
- -- 10.1.1 Library Unit Renaming Declararation --
- -------------------------------------------------
+ -----------------------------------------------
+ -- 10.1.1 Library Unit Renaming Declaration --
+ -----------------------------------------------
-- LIBRARY_UNIT_RENAMING_DECLARATION ::=
-- PACKAGE_RENAMING_DECLARATION
-- EXCEPTION_DECLARATION ::= DEFINING_IDENTIFIER_LIST : exception;
- -- For consistency with object declarations etc, the parser converts
+ -- For consistency with object declarations etc., the parser converts
-- the case of multiple identifiers being declared to a series of
-- declarations in which the expression is copied, using the More_Ids
- -- and Prev_Ids flags to remember the souce form as described in the
+ -- and Prev_Ids flags to remember the source form as described in the
-- section on "Handling of Defining Identifier Lists".
-- N_Exception_Declaration
-- Note: overriding indicator is an Ada 2005 feature
- ------------------------------
- -- 12.3 Generic Actual Part --
- ------------------------------
+ -------------------------------
+ -- 12.3 Generic Actual Part --
+ -------------------------------
-- GENERIC_ACTUAL_PART ::=
-- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
-- [generic_formal_parameter_SELECTOR_NAME =>]
-- Note: unlike the procedure call case, a generic association node
- -- is generated for every association, even if no formal is present.
- -- In this case the parser will leave the Selector_Name field set
- -- to Empty, to be filled in later by the semantic pass.
+ -- is generated for every association, even if no formal parameter
+ -- selector name is present. In this case the parser will leave the
+ -- Selector_Name field set to Empty, to be filled in later by the
+ -- semantic pass.
-- In Ada 2005, a formal may be associated with a box, if the
-- association is part of the list of actuals for a formal package.
-- in the declarations of the innermost enclosing block as specified
-- in RM section 5.1 (3).
- -- The Defining_Identifier is the actual identifier for the
- -- statement identifier. Note that the occurrence of the label
- -- is a reference, NOT the defining occurrence. The defining
- -- occurrence occurs at the head of the innermost enclosing
- -- block, and is represented by this node.
+ -- The Defining_Identifier is the actual identifier for the statement
+ -- identifier. Note that the occurrence of the label is a reference, NOT
+ -- the defining occurrence. The defining occurrence occurs at the head
+ -- of the innermost enclosing block, and is represented by this node.
-- Note: from the grammar, this might better be called an implicit
-- statement identifier declaration, but the term we choose seems
-- called labels in both cases (i.e. when used in labels, and when
-- used as the identifiers of blocks and loops).
- -- Note: although this is logically a semantic node, since it does
- -- not correspond directly to a source syntax construction, these
- -- nodes are actually created by the parser in a post pass done just
- -- after parsing is complete, before semantic analysis is started (see
- -- the Par.Labl subunit in file par-labl.adb).
+ -- Note: although this is logically a semantic node, since it does not
+ -- correspond directly to a source syntax construction, these nodes are
+ -- actually created by the parser in a post pass done just after parsing
+ -- is complete, before semantic analysis is started (see Par.Labl).
-- Sprint syntax: labelname : label;
-- Itype_Reference --
---------------------
- -- This node is used to create a reference to an Itype. The only
- -- purpose is to make sure that the Itype is defined if this is the
- -- first reference.
+ -- This node is used to create a reference to an Itype. The only purpose
+ -- is to make sure the Itype is defined if this is the first reference.
-- A typical use of this node is when an Itype is to be referenced in
- -- two branches of an if statement. In this case it is important that
- -- the first use of the Itype not be inside the conditional, since
- -- then it might not be defined if the wrong branch of the if is
- -- taken in the case where the definition generates elaboration code.
+ -- two branches of an IF statement. In this case it is important that
+ -- the first use of the Itype not be inside the conditional, since then
+ -- it might not be defined if the other branch of the IF is taken, in
+ -- the case where the definition generates elaboration code.
-- The Itype field points to the referenced Itype
- -- sprint syntax: reference itype-name
+ -- Sprint syntax: reference itype-name
-- N_Itype_Reference
-- Sloc points to the node generating the reference
-- the exception to be raised (i.e. it is equivalent to a raise
-- statement that raises the corresponding exception). This use
-- is distinguished by the fact that the Etype in this case is
- -- Standard_Void_Type, In the subexprssion case, the Etype is the
+ -- Standard_Void_Type, In the subexpression case, the Etype is the
-- same as the type of the subexpression which it replaces.
-- If Condition is empty, then the raise is unconditional. If the
-- The following is the definition of the Node_Kind type. As previously
-- discussed, this is separated off to allow rearrangement of the order
- -- to facilitiate definition of subtype ranges. The comments show the
+ -- to facilitate definition of subtype ranges. The comments show the
-- subtype classes which apply to each set of node kinds. The first
-- entry in the comment characterizes the following list of nodes.
N_Null_Statement,
N_Raise_Statement,
N_Requeue_Statement,
- N_Return_Statement, -- renamed as N_Simple_Return_Statement in Sem_Util
+ N_Return_Statement, -- renamed as N_Simple_Return_Statement below
N_Extended_Return_Statement,
N_Selective_Accept,
N_Timed_Entry_Call,
function Has_Private_View
(N : Node_Id) return Boolean; -- Flag11
+ function Has_Relative_Deadline_Pragma
+ (N : Node_Id) return Boolean; -- Flag9
+
function Has_Self_Reference
(N : Node_Id) return Boolean; -- Flag13
function Next_Named_Actual
(N : Node_Id) return Node_Id; -- Node4
+ function Next_Pragma
+ (N : Node_Id) return Node_Id; -- Node1
+
function Next_Rep_Item
(N : Node_Id) return Node_Id; -- Node5
function Null_Exclusion_Present
(N : Node_Id) return Boolean; -- Flag11
+ function Null_Exclusion_In_Return_Present
+ (N : Node_Id) return Boolean; -- Flag14
+
function Null_Record_Present
(N : Node_Id) return Boolean; -- Flag17
function Parent_Spec
(N : Node_Id) return Node_Id; -- Node4
+ function PPC_Enabled
+ (N : Node_Id) return Boolean; -- Flag5
+
function Position
(N : Node_Id) return Node_Id; -- Node2
function Subtype_Marks
(N : Node_Id) return List_Id; -- List2
+ function Suppress_Loop_Warnings
+ (N : Node_Id) return Boolean; -- Flag17
+
function Synchronized_Present
(N : Node_Id) return Boolean; -- Flag7
procedure Set_Has_Private_View
(N : Node_Id; Val : Boolean := True); -- Flag11
+ procedure Set_Has_Relative_Deadline_Pragma
+ (N : Node_Id; Val : Boolean := True); -- Flag9
+
procedure Set_Has_Self_Reference
(N : Node_Id; Val : Boolean := True); -- Flag13
procedure Set_Next_Named_Actual
(N : Node_Id; Val : Node_Id); -- Node4
+ procedure Set_Next_Pragma
+ (N : Node_Id; Val : Node_Id); -- Node1
+
procedure Set_Next_Rep_Item
(N : Node_Id; Val : Node_Id); -- Node5
procedure Set_Null_Exclusion_Present
(N : Node_Id; Val : Boolean := True); -- Flag11
+ procedure Set_Null_Exclusion_In_Return_Present
+ (N : Node_Id; Val : Boolean := True); -- Flag14
+
procedure Set_Null_Record_Present
(N : Node_Id; Val : Boolean := True); -- Flag17
procedure Set_Parent_Spec
(N : Node_Id; Val : Node_Id); -- Node4
+ procedure Set_PPC_Enabled
+ (N : Node_Id; Val : Boolean := True); -- Flag5
+
procedure Set_Position
(N : Node_Id; Val : Node_Id); -- Node2
procedure Set_Subtype_Marks
(N : Node_Id; Val : List_Id); -- List2
+ procedure Set_Suppress_Loop_Warnings
+ (N : Node_Id; Val : Boolean := True); -- Flag17
+
procedure Set_Synchronized_Present
(N : Node_Id; Val : Boolean := True); -- Flag7
-- Node_Kind Membership Tests --
--------------------------------
- -- The following functions allow a convenient notation for testing wheter
+ -- The following functions allow a convenient notation for testing whether
-- a Node_Kind value matches any one of a list of possible values. In each
-- case True is returned if the given T argument is equal to any of the V
-- arguments. Note that there is a similar set of functions defined in
5 => False), -- Etype (Node5-Sem)
N_Pragma =>
- (1 => True, -- Chars (Name1)
+ (1 => False, -- Next_Pragma (Node1-Sem)
2 => True, -- Pragma_Argument_Associations (List2)
3 => True, -- Debug_Statement (Node3)
4 => True, -- Pragma_Identifier (Node4)
pragma Inline (Has_No_Elaboration_Code);
pragma Inline (Has_Priority_Pragma);
pragma Inline (Has_Private_View);
+ pragma Inline (Has_Relative_Deadline_Pragma);
pragma Inline (Has_Storage_Size_Pragma);
pragma Inline (Has_Task_Info_Pragma);
pragma Inline (Has_Task_Name_Pragma);
pragma Inline (Names);
pragma Inline (Next_Entity);
pragma Inline (Next_Named_Actual);
+ pragma Inline (Next_Pragma);
pragma Inline (Next_Rep_Item);
pragma Inline (Next_Use_Clause);
pragma Inline (No_Ctrl_Actions);
pragma Inline (No_Truncation);
pragma Inline (Null_Present);
pragma Inline (Null_Exclusion_Present);
+ pragma Inline (Null_Exclusion_In_Return_Present);
pragma Inline (Null_Record_Present);
pragma Inline (Object_Definition);
pragma Inline (Original_Discriminant);
pragma Inline (Parameter_List_Truncated);
pragma Inline (Parameter_Type);
pragma Inline (Parent_Spec);
+ pragma Inline (PPC_Enabled);
pragma Inline (Position);
pragma Inline (Pragma_Argument_Associations);
pragma Inline (Pragma_Identifier);
pragma Inline (Subtype_Indication);
pragma Inline (Subtype_Mark);
pragma Inline (Subtype_Marks);
+ pragma Inline (Suppress_Loop_Warnings);
pragma Inline (Synchronized_Present);
pragma Inline (Tagged_Present);
pragma Inline (Target_Type);
pragma Inline (Set_Has_No_Elaboration_Code);
pragma Inline (Set_Has_Priority_Pragma);
pragma Inline (Set_Has_Private_View);
+ pragma Inline (Set_Has_Relative_Deadline_Pragma);
pragma Inline (Set_Has_Storage_Size_Pragma);
pragma Inline (Set_Has_Task_Info_Pragma);
pragma Inline (Set_Has_Task_Name_Pragma);
pragma Inline (Set_Names);
pragma Inline (Set_Next_Entity);
pragma Inline (Set_Next_Named_Actual);
+ pragma Inline (Set_Next_Pragma);
+ pragma Inline (Set_Next_Rep_Item);
pragma Inline (Set_Next_Use_Clause);
pragma Inline (Set_No_Ctrl_Actions);
pragma Inline (Set_No_Elaboration_Check);
pragma Inline (Set_No_Truncation);
pragma Inline (Set_Null_Present);
pragma Inline (Set_Null_Exclusion_Present);
+ pragma Inline (Set_Null_Exclusion_In_Return_Present);
pragma Inline (Set_Null_Record_Present);
pragma Inline (Set_Object_Definition);
pragma Inline (Set_Original_Discriminant);
pragma Inline (Set_Parameter_List_Truncated);
pragma Inline (Set_Parameter_Type);
pragma Inline (Set_Parent_Spec);
+ pragma Inline (Set_PPC_Enabled);
pragma Inline (Set_Position);
pragma Inline (Set_Pragma_Argument_Associations);
pragma Inline (Set_Pragma_Identifier);
pragma Inline (Set_Subtype_Indication);
pragma Inline (Set_Subtype_Mark);
pragma Inline (Set_Subtype_Marks);
+ pragma Inline (Set_Suppress_Loop_Warnings);
pragma Inline (Set_Synchronized_Present);
pragma Inline (Set_Tagged_Present);
pragma Inline (Set_Target_Type);