-- 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
-- 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
-- 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.
----------------------------------------------
-- N_Null_Statement
-- Sloc points to NULL
- -- Is_Scil_Node (Flag4-Sem)
- -- Scil_Nkind (Uint3-Sem)
- -- Scil_Related_Node (Node1-Sem)
- -- Entity (Node4-Sem)
- -- Scil_Target_Prim (Node2-Sem)
----------------
-- 5.1 Label --
-- Selector_Name (Node2) (always non-Empty)
-- Explicit_Actual_Parameter (Node3)
-- Next_Named_Actual (Node4-Sem)
+ -- Is_Accessibility_Actual (Flag13-Sem)
---------------------------
-- 6.4 Actual Parameter --
-- 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 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 Is_Protected_Subprogram_Body
(N : Node_Id) return Boolean; -- Flag7
- function Is_Scil_Node
- (N : Node_Id) return Boolean; -- Flag4
-
function Is_Static_Coextension
(N : Node_Id) return Boolean; -- Flag14
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_Nkind
- (N : Node_Id) return Uint; -- Uint3
+ 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
+ function SCIL_Related_Node
(N : Node_Id) return Node_Id; -- Node1
- function Scil_Target_Prim
+ function SCIL_Tag_Value
+ (N : Node_Id) return Node_Id; -- Node5
+
+ function SCIL_Target_Prim
(N : Node_Id) return Node_Id; -- Node2
function Scope
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_Is_Protected_Subprogram_Body
(N : Node_Id; Val : Boolean := True); -- Flag7
- procedure Set_Is_Scil_Node
- (N : Node_Id; Val : Boolean := True); -- Flag4
-
procedure Set_Is_Static_Coextension
(N : Node_Id; Val : Boolean := True); -- Flag14
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_Nkind
- (N : Node_Id; Val : Uint); -- Uint3
+ 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
+ procedure Set_SCIL_Related_Node
(N : Node_Id; Val : Node_Id); -- Node1
- procedure Set_Scil_Target_Prim
+ 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
-- 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 (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 (Is_Overloaded);
pragma Inline (Is_Power_Of_2_For_Shift);
pragma Inline (Is_Protected_Subprogram_Body);
- pragma Inline (Is_Scil_Node);
pragma Inline (Is_Static_Coextension);
pragma Inline (Is_Static_Expression);
pragma Inline (Is_Subprogram_Descriptor);
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_Nkind);
- pragma Inline (Scil_Related_Node);
- pragma Inline (Scil_Target_Prim);
+ 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_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_Is_Overloaded);
pragma Inline (Set_Is_Power_Of_2_For_Shift);
pragma Inline (Set_Is_Protected_Subprogram_Body);
- pragma Inline (Set_Is_Scil_Node);
pragma Inline (Set_Has_Self_Reference);
pragma Inline (Set_Is_Static_Coextension);
pragma Inline (Set_Is_Static_Expression);
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_Nkind);
- pragma Inline (Set_Scil_Related_Node);
- pragma Inline (Set_Scil_Target_Prim);
+ 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);