-- reasons.
-- Comes_From_Source (Flag2)
- -- This flag is on for any nodes built by the scanner or parser from the
- -- source program, and off for any nodes built by the analyzer or
- -- expander. It indicates that a node comes from the original source.
- -- This flag is defined in Atree.
+ -- This flag is set if the node comes directly from an explicit construct
+ -- in the source. It is normally on for any nodes built by the scanner or
+ -- parser from the source program, with the exception that in a few cases
+ -- the parser adds nodes to normalize the representation (in particular
+ -- a null statement is added to a package body if there is no begin/end
+ -- initialization section.
+ --
+ -- Most nodes inserted by the analyzer or expander are not considered
+ -- as coming from source, so the flag is off for such nodes. In a few
+ -- cases, the expander constructs nodes closely equivalent to nodes
+ -- from the source program (e.g. the allocator built for build-in-place
+ -- case), and the Comes_From_Source flag is deliberately set.
-- Error_Posted (Flag3)
-- This flag is used to avoid multiple error messages being posted on or
-- issues. Used to inhibit multiple redundant messages.
-- Aggregate_Bounds (Node3-Sem)
- -- Present in array N_Aggregate nodes. If the aggregate contains
- -- component associations this field points to an N_Range node whose
- -- bounds give the lowest and highest discrete choice values. If the
- -- named aggregate contains a dynamic or null choice this field is empty.
- -- If the aggregate contains positional elements this field points to an
- -- N_Integer_Literal node giving the number of positional elements. Note
- -- that if the aggregate contains positional elements and an other choice
- -- the N_Integer_Literal only accounts for the number of positional
- -- elements.
+ -- Present in array N_Aggregate nodes. If the bounds of the aggregate are
+ -- known at compile time, this field points to an N_Range node with those
+ -- bounds. Otherwise Empty.
-- All_Others (Flag11-Sem)
-- Present in an N_Others_Choice node. This flag is set for an others
-- Comes_From_Extended_Return_Statement (Flag18-Sem)
-- Present in N_Simple_Return_Statement nodes. True if this node was
-- 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
-- Sem_Aggr for the specific conditions under which an aggregate has this
-- flag set. See also the flag Static_Processing_OK.
+ -- Componentwise_Assignment (Flag14-Sem)
+ -- Present in N_Assignment_Statement nodes. Set for a record assignment
+ -- where all that needs doing is to expand it into component-by-component
+ -- assignments. This is used internally for the case of tagged types with
+ -- rep clauses, where we need to avoid recursion (we don't want to try to
+ -- generate a call to the primitive operation, because this is the case
+ -- where we are compiling the primitive operation). Note that when we are
+ -- expanding component assignments in this case, we never assign the _tag
+ -- field, but we recursively assign components of the parent type.
+
-- 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
-- package Exp_Util, and also the expansion routines for the relevant
-- nodes.
+ -- Context_Pending (Flag16-Sem)
+ -- This field appears in Compilation_Unit nodes, to indicate that the
+ -- context of the unit is being compiled. Used to detect circularities
+ -- that are not otherwise detected by the loading mechanism. Such
+ -- circularities can occur in the presence of limited and non-limited
+ -- with_clauses that mention the same units.
+
-- 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
-- Has_Wide_Character (Flag11-Sem)
-- Present in string literals, set if any wide character (i.e. character
- -- code outside the Character range) appears in the string.
+ -- code outside the Character range but within Wide_Character range)
+ -- appears in the string. Used to implement pragma preference rules.
+
+ -- Has_Wide_Wide_Character (Flag13-Sem)
+ -- Present in string literals, set if any wide character (i.e. character
+ -- code outside the Wide_Character range) appears in the string. Used to
+ -- implement pragma preference rules.
-- Hidden_By_Use_Clause (Elist4-Sem)
-- An entity list present in use clauses that appear within
-- to the node for the spec of the instance, inserted as part of the
-- semantic processing for instantiations in Sem_Ch12.
+ -- Is_Accessibility_Actual (Flag12-Sem)
+ -- Present in N_Parameter_Association nodes. True if the parameter is
+ -- an extra actual that carries the accessibility level of the actual
+ -- for an access parameter, in a function that dispatches on result and
+ -- is called in a dispatching context. Used to prevent a formal/actual
+ -- mismatch when the call is rewritten as a dispatching call.
+
-- Is_Asynchronous_Call_Block (Flag7-Sem)
-- A flag set in a Block_Statement node to indicate that it is the
-- expansion of an asynchronous entry call. Such a block needs cleanup
-- 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.
+ -- Pragma_Enabled (Flag5-Sem)
+ -- Present in N_Pragma nodes. This flag is relevant only for pragmas
+ -- Assert, Check, Precondition, and Postcondition. 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
-- are the result of expansion of rounded fixed-point divide, conversion
-- and multiplication operations.
+ -- SCIL_Entity (Node4-Sem)
+ -- Present in SCIL nodes. Used to reference the tagged type associated
+ -- with the SCIL node.
+
+ -- SCIL_Related_Node (Node1-Sem)
+ -- Present in SCIL nodes. Used to reference a tree node that requires
+ -- special processing in the CodePeer backend.
+
+ -- SCIL_Controlling_Tag (Node5-Sem)
+ -- Present in N_SCIL_Dispatching_Call nodes. Used to reference the
+ -- controlling tag of a dispatching call.
+
+ -- SCIL_Tag_Value (Node5-Sem)
+ -- Present in N_SCIL_Membership_Test nodes. Used to reference the tag
+ -- value that is being tested.
+
+ -- SCIL_Target_Prim (Node2-Sem)
+ -- Present in N_SCIL_Dispatching_Call nodes. Used to reference the tagged
+ -- type primitive associated with the SCIL node.
+
-- Scope (Node3-Sem)
-- Present in defining identifiers, defining character literals and
-- defining operator symbols (i.e. in all entities). The entities of a
-- Sloc points to literal
-- Strval (Str3) contains Id of string value
-- Has_Wide_Character (Flag11-Sem)
+ -- Has_Wide_Wide_Character (Flag13-Sem)
-- Is_Folded_In_Parser (Flag4)
-- plus fields for expression
-- Debug_Statement (Node3) (set to Empty if not Debug, Assert)
-- Pragma_Identifier (Node4)
-- Next_Rep_Item (Node5-Sem)
- -- PPC_Enabled (Flag5-Sem)
+ -- Pragma_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
-- Aliased_Present (Flag4) set if ALIASED appears
-- Constant_Present (Flag17) set if CONSTANT appears
-- Null_Exclusion_Present (Flag11)
- -- Object_Definition (Node4) subtype indic./array type def./ access def.
+ -- 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)
-- are not met, then the front end must translate the aggregate into
-- an appropriate set of assignments into a temporary.
- -- Note: for the record aggregate case, gigi/gcc can handle all cases
- -- of record aggregates, including those for packed, and rep-claused
+ -- Note: for the record aggregate case, gigi/gcc can handle all cases of
+ -- record aggregates, including those for packed, and rep-claused
-- records, and also variant records, providing that there are no
- -- variable length fields whose size is not known at runtime, and
+ -- variable length fields whose size is not known at compile time, and
-- providing that the aggregate is presented in fully named form.
----------------------------------------------
-- Forwards_OK (Flag5-Sem)
-- Backwards_OK (Flag6-Sem)
-- No_Ctrl_Actions (Flag7-Sem)
+ -- Componentwise_Assignment (Flag14-Sem)
-- Note: if a range check is required, then the Do_Range_Check flag
-- is set in the Expression (right hand side), with the check being
-- Selector_Name (Node2) (always non-Empty)
-- Explicit_Actual_Parameter (Node3)
-- Next_Named_Actual (Node4-Sem)
+ -- Is_Accessibility_Actual (Flag13-Sem)
---------------------------
-- 6.4 Actual Parameter --
-- Has_No_Elaboration_Code (Flag17-Sem)
-- Body_Required (Flag13-Sem) set for spec if body is required
-- Acts_As_Spec (Flag4-Sem) flag for subprogram body with no spec
+ -- Context_Pending (Flag16-Sem)
-- First_Inlined_Subprogram (Node3-Sem)
-- N_Compilation_Unit_Aux
-- Note: in the case where a debug source file is generated, the Sloc
-- for this node points to the quote in the Sprint file output.
+ -----------------
+ -- SCIL Nodes --
+ -----------------
+
+ -- SCIL nodes are special nodes added to the tree when the CodePeer
+ -- mode is active. They help the CodePeer backend to locate nodes that
+ -- require special processing.
+
+ -- Major documentation on the general design of the SCIL interface, and
+ -- in particular detailed description of these nodes is missing and is
+ -- to be supplied in the future, when the design has finalized ???
+
+ -- Meanwhile these nodes should be considered in experimental form, and
+ -- should be ignored by all code generating back ends. ???
+
+ -- N_SCIL_Dispatch_Table_Object_Init
+ -- Sloc references a declaration node containing a dispatch table
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Entity (Node4-Sem)
+
+ -- N_SCIL_Dispatch_Table_Tag_Init
+ -- Sloc references a node for a tag initialization
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Entity (Node4-Sem)
+
+ -- N_SCIL_Dispatching_Call
+ -- Sloc references the node of a dispatching call
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Target_Prim (Node2-Sem)
+ -- SCIL_Entity (Node4-Sem)
+ -- SCIL_Controlling_Tag (Node5-Sem)
+
+ -- N_SCIL_Membership_Test
+ -- Sloc references the node of a membership test
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Tag_Value (Node5-Sem)
+ -- SCIL_Entity (Node4-Sem)
+
+ -- N_SCIL_Tag_Init
+ -- Sloc references the node of a tag component initialization
+ -- SCIL_Related_Node (Node1-Sem)
+ -- SCIL_Entity (Node4-Sem)
+
---------------------
-- Subprogram_Info --
---------------------
N_Pop_Program_Error_Label,
N_Pop_Storage_Error_Label,
+ -- SCIL nodes
+
+ N_SCIL_Dispatch_Table_Object_Init,
+ N_SCIL_Dispatch_Table_Tag_Init,
+ N_SCIL_Dispatching_Call,
+ N_SCIL_Membership_Test,
+ N_SCIL_Tag_Init,
+
-- Other nodes (not part of any subtype class)
N_Abortable_Part,
subtype N_Later_Decl_Item is Node_Kind range
N_Task_Type_Declaration ..
N_Generic_Subprogram_Declaration;
- -- Note: this is Ada 83 relevant only (see Ada 83 RM 3.9 (2)) and
- -- includes only those items which can appear as later declarative
- -- items. This also includes N_Implicit_Label_Declaration which is
- -- not specifically in the grammar but may appear as a valid later
- -- declarative items. It does NOT include N_Pragma which can also
- -- appear among later declarative items. It does however include
- -- N_Protected_Body, which is a bit peculiar, but harmless since
- -- this cannot appear in Ada 83 mode anyway.
+ -- Note: this is Ada 83 relevant only (see Ada 83 RM 3.9 (2)) and includes
+ -- only those items which can appear as later declarative items. This also
+ -- includes N_Implicit_Label_Declaration which is not specifically in the
+ -- grammar but may appear as a valid later declarative items. It does NOT
+ -- include N_Pragma which can also appear among later declarative items.
+ -- It does however include N_Protected_Body, which is a bit peculiar, but
+ -- harmless since this cannot appear in Ada 83 mode anyway.
subtype N_Membership_Test is Node_Kind range
N_In ..
N_Attribute_Definition_Clause;
subtype N_Short_Circuit is Node_Kind range
- N_And_Then ..
- N_Or_Else;
+ N_And_Then ..
+ N_Or_Else;
+
+ subtype N_SCIL_Node is Node_Kind range
+ N_SCIL_Dispatch_Table_Object_Init ..
+ N_SCIL_Tag_Init;
subtype N_Statement_Other_Than_Procedure_Call is Node_Kind range
N_Abort_Statement ..
function Component_Name
(N : Node_Id) return Node_Id; -- Node1
+ function Componentwise_Assignment
+ (N : Node_Id) return Boolean; -- Flag14
+
function Condition
(N : Node_Id) return Node_Id; -- Node1
function Context_Installed
(N : Node_Id) return Boolean; -- Flag13
+ function Context_Pending
+ (N : Node_Id) return Boolean; -- Flag16
+
function Context_Items
(N : Node_Id) return List_Id; -- List1
function Has_Wide_Character
(N : Node_Id) return Boolean; -- Flag11
+ function Has_Wide_Wide_Character
+ (N : Node_Id) return Boolean; -- Flag13
+
function Hidden_By_Use_Clause
(N : Node_Id) return Elist_Id; -- Elist4
function Intval
(N : Node_Id) return Uint; -- Uint3
+ function Is_Accessibility_Actual
+ (N : Node_Id) return Boolean; -- Flag13
+
function Is_Asynchronous_Call_Block
(N : Node_Id) return Boolean; -- Flag7
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 Pragma_Argument_Associations
(N : Node_Id) return List_Id; -- List2
+ function Pragma_Enabled
+ (N : Node_Id) return Boolean; -- Flag5
+
function Pragma_Identifier
(N : Node_Id) return Node_Id; -- Node4
function Rounded_Result
(N : Node_Id) return Boolean; -- Flag18
+ function SCIL_Controlling_Tag
+ (N : Node_Id) return Node_Id; -- Node5
+
+ function SCIL_Entity
+ (N : Node_Id) return Node_Id; -- Node4
+
+ function SCIL_Related_Node
+ (N : Node_Id) return Node_Id; -- Node1
+
+ function SCIL_Tag_Value
+ (N : Node_Id) return Node_Id; -- Node5
+
+ function SCIL_Target_Prim
+ (N : Node_Id) return Node_Id; -- Node2
+
function Scope
(N : Node_Id) return Node_Id; -- Node3
procedure Set_Component_Name
(N : Node_Id; Val : Node_Id); -- Node1
+ procedure Set_Componentwise_Assignment
+ (N : Node_Id; Val : Boolean := True); -- Flag14
+
procedure Set_Condition
(N : Node_Id; Val : Node_Id); -- Node1
procedure Set_Context_Items
(N : Node_Id; Val : List_Id); -- List1
+ procedure Set_Context_Pending
+ (N : Node_Id; Val : Boolean := True); -- Flag16
+
procedure Set_Controlling_Argument
(N : Node_Id; Val : Node_Id); -- Node1
procedure Set_Has_Wide_Character
(N : Node_Id; Val : Boolean := True); -- Flag11
+ procedure Set_Has_Wide_Wide_Character
+ (N : Node_Id; Val : Boolean := True); -- Flag13
+
procedure Set_Hidden_By_Use_Clause
(N : Node_Id; Val : Elist_Id); -- Elist4
procedure Set_Intval
(N : Node_Id; Val : Uint); -- Uint3
+ procedure Set_Is_Accessibility_Actual
+ (N : Node_Id; Val : Boolean := True); -- Flag13
+
procedure Set_Is_Asynchronous_Call_Block
(N : Node_Id; Val : Boolean := True); -- Flag7
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_Pragma_Argument_Associations
(N : Node_Id; Val : List_Id); -- List2
+ procedure Set_Pragma_Enabled
+ (N : Node_Id; Val : Boolean := True); -- Flag5
+
procedure Set_Pragma_Identifier
(N : Node_Id; Val : Node_Id); -- Node4
procedure Set_Rounded_Result
(N : Node_Id; Val : Boolean := True); -- Flag18
+ procedure Set_SCIL_Controlling_Tag
+ (N : Node_Id; Val : Node_Id); -- Node5
+
+ procedure Set_SCIL_Entity
+ (N : Node_Id; Val : Node_Id); -- Node4
+
+ procedure Set_SCIL_Related_Node
+ (N : Node_Id; Val : Node_Id); -- Node1
+
+ procedure Set_SCIL_Tag_Value
+ (N : Node_Id; Val : Node_Id); -- Node5
+
+ procedure Set_SCIL_Target_Prim
+ (N : Node_Id; Val : Node_Id); -- Node2
+
procedure Set_Scope
(N : Node_Id; Val : Node_Id); -- Node3
-- End of inserted output from makeisf program
+ -- Entries for SCIL nodes
+
+ N_SCIL_Dispatch_Table_Object_Init =>
+ (1 => False, -- SCIL_Related_Node (Node1-Sem)
+ 2 => False, -- unused
+ 3 => False, -- unused
+ 4 => False, -- SCIL_Entity (Node4-Sem)
+ 5 => False), -- unused
+
+ N_SCIL_Dispatch_Table_Tag_Init =>
+ (1 => False, -- SCIL_Related_Node (Node1-Sem)
+ 2 => False, -- unused
+ 3 => False, -- unused
+ 4 => False, -- SCIL_Entity (Node4-Sem)
+ 5 => False), -- unused
+
+ N_SCIL_Dispatching_Call =>
+ (1 => False, -- SCIL_Related_Node (Node1-Sem)
+ 2 => False, -- SCIL_Target_Prim (Node2-Sem)
+ 3 => False, -- unused
+ 4 => False, -- SCIL_Entity (Node4-Sem)
+ 5 => False), -- SCIL_Controlling_Tag (Node5-Sem)
+
+ N_SCIL_Membership_Test =>
+ (1 => False, -- SCIL_Related_Node (Node1-Sem)
+ 2 => False, -- unused
+ 3 => False, -- unused
+ 4 => False, -- SCIL_Entity (Node4-Sem)
+ 5 => False), -- SCIL_Tag_Value (Node5-Sem)
+
+ N_SCIL_Tag_Init =>
+ (1 => False, -- SCIL_Related_Node (Node1-Sem)
+ 2 => False, -- unused
+ 3 => False, -- unused
+ 4 => False, -- SCIL_Entity (Node4-Sem)
+ 5 => False), -- unused
+
-- Entries for Empty, Error and Unused. Even thought these have a Chars
-- field for debugging purposes, they are not really syntactic fields, so
-- we mark all fields as unused.
pragma Inline (Component_Items);
pragma Inline (Component_List);
pragma Inline (Component_Name);
+ pragma Inline (Componentwise_Assignment);
pragma Inline (Condition);
pragma Inline (Condition_Actions);
pragma Inline (Config_Pragmas);
pragma Inline (Constraints);
pragma Inline (Context_Installed);
pragma Inline (Context_Items);
+ pragma Inline (Context_Pending);
pragma Inline (Controlling_Argument);
pragma Inline (Conversion_OK);
pragma Inline (Corresponding_Body);
pragma Inline (Has_Task_Info_Pragma);
pragma Inline (Has_Task_Name_Pragma);
pragma Inline (Has_Wide_Character);
+ pragma Inline (Has_Wide_Wide_Character);
pragma Inline (Hidden_By_Use_Clause);
pragma Inline (High_Bound);
pragma Inline (Identifier);
pragma Inline (In_Present);
pragma Inline (Instance_Spec);
pragma Inline (Intval);
+ pragma Inline (Is_Accessibility_Actual);
pragma Inline (Is_Asynchronous_Call_Block);
pragma Inline (Is_Component_Left_Opnd);
pragma Inline (Is_Component_Right_Opnd);
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_Enabled);
pragma Inline (Pragma_Identifier);
pragma Inline (Pragmas_After);
pragma Inline (Pragmas_Before);
pragma Inline (Reverse_Present);
pragma Inline (Right_Opnd);
pragma Inline (Rounded_Result);
+ pragma Inline (SCIL_Controlling_Tag);
+ pragma Inline (SCIL_Entity);
+ pragma Inline (SCIL_Related_Node);
+ pragma Inline (SCIL_Tag_Value);
+ pragma Inline (SCIL_Target_Prim);
pragma Inline (Scope);
pragma Inline (Select_Alternatives);
pragma Inline (Selector_Name);
pragma Inline (Set_Component_Items);
pragma Inline (Set_Component_List);
pragma Inline (Set_Component_Name);
+ pragma Inline (Set_Componentwise_Assignment);
pragma Inline (Set_Condition);
pragma Inline (Set_Condition_Actions);
pragma Inline (Set_Config_Pragmas);
pragma Inline (Set_Constraints);
pragma Inline (Set_Context_Installed);
pragma Inline (Set_Context_Items);
+ pragma Inline (Set_Context_Pending);
pragma Inline (Set_Controlling_Argument);
pragma Inline (Set_Conversion_OK);
pragma Inline (Set_Corresponding_Body);
pragma Inline (Set_Has_Task_Info_Pragma);
pragma Inline (Set_Has_Task_Name_Pragma);
pragma Inline (Set_Has_Wide_Character);
+ pragma Inline (Set_Has_Wide_Wide_Character);
pragma Inline (Set_Hidden_By_Use_Clause);
pragma Inline (Set_High_Bound);
pragma Inline (Set_Identifier);
pragma Inline (Set_In_Present);
pragma Inline (Set_Instance_Spec);
pragma Inline (Set_Intval);
+ pragma Inline (Set_Is_Accessibility_Actual);
pragma Inline (Set_Is_Asynchronous_Call_Block);
pragma Inline (Set_Is_Component_Left_Opnd);
pragma Inline (Set_Is_Component_Right_Opnd);
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_Enabled);
pragma Inline (Set_Pragma_Identifier);
pragma Inline (Set_Pragmas_After);
pragma Inline (Set_Pragmas_Before);
pragma Inline (Set_Reverse_Present);
pragma Inline (Set_Right_Opnd);
pragma Inline (Set_Rounded_Result);
+ pragma Inline (Set_SCIL_Controlling_Tag);
+ pragma Inline (Set_SCIL_Entity);
+ pragma Inline (Set_SCIL_Related_Node);
+ pragma Inline (Set_SCIL_Tag_Value);
+ pragma Inline (Set_SCIL_Target_Prim);
pragma Inline (Set_Scope);
pragma Inline (Set_Select_Alternatives);
pragma Inline (Set_Selector_Name);