-- --
-- S p e c --
-- --
--- $Revision: 1.3 $
--- --
--- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2002, 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- --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- 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, even those that are
- -- not normally handled (in particular the tasking abort signal) by
- -- others. This is used for translation of the at end handler into
+ -- 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.
-- Assignment_OK (Flag15-Sem)
-- Associated_Node (Node4-Sem)
-- Present in nodes that can denote an entity: identifiers, character
- -- literals and expanded names, operator nodes that carry an entity
- -- reference, and also in N_Aggregate, N_Selected_Component, and
- -- N_Extension_Aggregate nodes. This field is used during generic
+ -- 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 N_Extension_Aggregate nodes. This field is used during generic
-- processing to relate nodes in the original template to nodes in the
-- generic copy. It overlaps the Entity field, and is used to capture
-- global references in the analyzed copy and place them in the template.
- -- see description in Sem_Ch12 for further details on this usage.
+ -- See description in Sem_Ch12 for further details on this usage.
-- At_End_Proc (Node1)
-- This field is present in an N_Handled_Sequence_Of_Statements node.
-- Used to collect actions that must be executed within the loop because
-- they may need to be evaluated anew each time through.
+ -- Must_Be_Byte_Aligned (Flag14-Sem)
+ -- This flag is present in N_Attribute_Reference nodes. It can be set
+ -- only for the Address and Unrestricted_Access attributes. If set it
+ -- means that the object for which the address/access is given must be
+ -- on a byte (more accurately a storage unit) boundary. If necessary,
+ -- a copy of the object is to be made before taking the address (this
+ -- copy is in the current scope on the stack frame). This is used for
+ -- certainly cases of code generated by the expander that passes
+ -- parameters by address.
+
-- Must_Not_Freeze (Flag8-Sem)
-- A flag present in all expression nodes. Normally expressions cause
-- freezing as described in the RM. If this flag is set, then this
-- Case Statement end case;
-- Record Definition end record;
+ -- Enumeration Definition );
-- The End_Label and End_Span fields are used to mark the locations
-- of these lines, and also keep track of the label in the case where
-- entry for the end of a record, since it represents a scope for
-- name declaration purposes.
+ -- The enumeration definition case is handled in an exactly similar
+ -- manner, building a dummy identifier to get a cross-reference.
+
-- Note: the reason we store the difference as a Uint, instead of
-- storing the Source_Ptr value directly, is that Source_Ptr values
-- cannot be distinguished from other types of values, and we count
-- N_Enumeration_Type_Definition
-- Sloc points to left parenthesis
-- Literals (List1) (Empty for CHARACTER or WIDE_CHARACTER)
+ -- End_Label (Node4) (set to Empty if internally generated record)
----------------------------------------------
-- 3.5.1 Enumeration Literal Specification --
-- a non-standard enumeration type or a nonzero/zero semantics
-- boolean type, so the value is simply the stored representation.
+ -- Note: In generated code, the Address and Unrestricted_Access
+ -- attributes can be applied to any expression, and the meaning is
+ -- to create an object containing the value (the object is in the
+ -- current stack frame), and pass the address of this value. If the
+ -- Must_Be_Byte_Aligned flag is set, then the object whose address
+ -- is taken must be on a byte (storage unit) boundary, and if it is
+ -- not (or may not be), then the generated code must create a copy
+ -- that is byte aligned, and pass the address of this copy.
+
-- N_Attribute_Reference
-- Sloc points to apostrophe
-- Prefix (Node3)
-- Do_Overflow_Check (Flag17-Sem)
-- Redundant_Use (Flag13-Sem)
-- OK_For_Stream (Flag4-Sem)
+ -- Must_Be_Byte_Aligned (Flag14)
-- plus fields for expression
---------------------------------
-- N_Freeze_Entity
-- Sloc points near freeze point (see above special note)
-- Entity (Node4-Sem)
- -- Associated_Node (Node4-Sem)
-- Access_Types_To_Process (Elist2-Sem) (set to No_Elist if none)
-- TSS_Elist (Elist3-Sem) (set to No_Elist if no associated TSS's)
-- Actions (List1) (set to No_List if no freeze actions)
-- circuit form whose left argument is static and decisively
-- eliminates elaboration of the raise operation.
+ -- The exception is generated with a message that contains the
+ -- file name and line number, and then appended text. The Reason
+ -- code shows the text to be added. The Reason code is an element
+ -- of the type Types.RT_Exception_Code, and indicates both the
+ -- message to be added, and the exception to be raised (which must
+ -- match the node type). The value is stored by storing a Uint which
+ -- is the Pos value of the enumeration element in this type.
+
-- Gigi restriction: This expander ensures that the type of the
-- Condition field is always Standard.Boolean, even if the type
-- in the source is some non-standard boolean type.
- -- Sprint syntax: [xxx_error]
- -- or: [xxx_error when condition]
+ -- Sprint syntax: [xxx_error "msg"]
+ -- or: [xxx_error when condition "msg"]
-- N_Raise_Constraint_Error
-- Sloc references related construct
-- Condition (Node1) (set to Empty if no condition)
- -- Sloc is copied from the expression generating the exception
+ -- Reason (Uint3)
-- plus fields for expression
-- N_Raise_Program_Error
-- Sloc references related construct
-- Condition (Node1) (set to Empty if no condition)
- -- Sloc is copied from the construct generating the exception
+ -- Reason (Uint3)
-- plus fields for expression
-- N_Raise_Storage_Error
-- Sloc references related construct
-- Condition (Node1) (set to Empty if no condition)
- -- Sloc is copied from the construct generating the exception
+ -- Reason (Uint3)
-- plus fields for expression
- -- Note: in the case where a debug source file is generated, the Sloc
- -- for this node points to the left bracket in the Sprint file output.
+ -- Note: Sloc is copied from the expression generating the exception.
+ -- In the case where a debug source file is generated, the Sloc for
+ -- this node points to the left bracket in the Sprint file output.
---------------
-- Reference --
function More_Ids
(N : Node_Id) return Boolean; -- Flag5
+ function Must_Be_Byte_Aligned
+ (N : Node_Id) return Boolean; -- Flag14
+
function Must_Not_Freeze
(N : Node_Id) return Boolean; -- Flag8
function Realval
(N : Node_Id) return Ureal; -- Ureal3
+ function Reason
+ (N : Node_Id) return Uint; -- Uint3
+
function Record_Extension_Part
(N : Node_Id) return Node_Id; -- Node3
procedure Set_More_Ids
(N : Node_Id; Val : Boolean := True); -- Flag5
+ procedure Set_Must_Be_Byte_Aligned
+ (N : Node_Id; Val : Boolean := True); -- Flag14
+
procedure Set_Must_Not_Freeze
(N : Node_Id; Val : Boolean := True); -- Flag8
procedure Set_Realval
(N : Node_Id; Val : Ureal); -- Ureal3
+ procedure Set_Reason
+ (N : Node_Id; Val : Uint); -- Uint3
+
procedure Set_Record_Extension_Part
(N : Node_Id; Val : Node_Id); -- Node3
pragma Inline (Low_Bound);
pragma Inline (Mod_Clause);
pragma Inline (More_Ids);
+ pragma Inline (Must_Be_Byte_Aligned);
pragma Inline (Must_Not_Freeze);
pragma Inline (Name);
pragma Inline (Names);
pragma Inline (Raises_Constraint_Error);
pragma Inline (Range_Constraint);
pragma Inline (Range_Expression);
- pragma Inline (Realval);
pragma Inline (Real_Range_Specification);
+ pragma Inline (Realval);
+ pragma Inline (Reason);
pragma Inline (Record_Extension_Part);
pragma Inline (Redundant_Use);
pragma Inline (Return_Type);
pragma Inline (Set_Low_Bound);
pragma Inline (Set_Mod_Clause);
pragma Inline (Set_More_Ids);
+ pragma Inline (Set_Must_Be_Byte_Aligned);
pragma Inline (Set_Must_Not_Freeze);
pragma Inline (Set_Name);
pragma Inline (Set_Names);
pragma Inline (Set_Raises_Constraint_Error);
pragma Inline (Set_Range_Constraint);
pragma Inline (Set_Range_Expression);
- pragma Inline (Set_Realval);
pragma Inline (Set_Real_Range_Specification);
+ pragma Inline (Set_Realval);
+ pragma Inline (Set_Reason);
pragma Inline (Set_Record_Extension_Part);
pragma Inline (Set_Redundant_Use);
pragma Inline (Set_Return_Type);