OSDN Git Service

* 1aexcept.adb, 1aexcept.ads, 1ic.ads, 1ssecsta.adb,
[pf3gnuchains/gcc-fork.git] / gcc / ada / sinfo.ads
index 8cb5b4b..7f3fe5c 100644 (file)
@@ -6,9 +6,7 @@
 --                                                                          --
 --                                 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- --
@@ -29,7 +27,7 @@
 -- 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.      --
 --                                                                          --
 ------------------------------------------------------------------------------
 
@@ -551,9 +549,9 @@ package Sinfo is
 
    --  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)
@@ -570,13 +568,14 @@ package Sinfo is
 
    --  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.
@@ -1179,6 +1178,16 @@ package Sinfo is
    --    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
@@ -1474,6 +1483,7 @@ package Sinfo is
    --    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
@@ -1505,6 +1515,9 @@ package Sinfo is
    --  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
@@ -2006,6 +2019,7 @@ package Sinfo is
       --  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 --
@@ -2801,6 +2815,15 @@ package Sinfo is
       --  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)
@@ -2812,6 +2835,7 @@ package Sinfo is
       --  Do_Overflow_Check (Flag17-Sem)
       --  Redundant_Use (Flag13-Sem)
       --  OK_For_Stream (Flag4-Sem)
+      --  Must_Be_Byte_Aligned (Flag14)
       --  plus fields for expression
 
       ---------------------------------
@@ -5963,7 +5987,6 @@ package Sinfo is
       --  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)
@@ -6063,33 +6086,42 @@ package Sinfo is
       --  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 --
@@ -7205,6 +7237,9 @@ package Sinfo is
    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
 
@@ -7328,6 +7363,9 @@ package Sinfo is
    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
 
@@ -7955,6 +7993,9 @@ package Sinfo is
    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
 
@@ -8078,6 +8119,9 @@ package Sinfo is
    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
 
@@ -8391,6 +8435,7 @@ package Sinfo is
    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);
@@ -8430,8 +8475,9 @@ package Sinfo is
    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);
@@ -8638,6 +8684,7 @@ package Sinfo is
    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);
@@ -8676,8 +8723,9 @@ package Sinfo is
    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);