summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-18 09:53:00 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-18 09:53:00 +0000
commit79d59c5e0601fbd6a1a0b6e41bfe5766f6de90d9 (patch)
tree364d9ffedf372b96525952d1fdac74e0d4096065 /gcc/ada
parente977c0cf76179b3df7859a44eb3684f2b8ba1d84 (diff)
downloadgcc-79d59c5e0601fbd6a1a0b6e41bfe5766f6de90d9.tar.gz
2010-06-18 Thomas Quinot <quinot@adacore.com>
* types.ads: Clean up obsolete comments * tbuild.adb: Minor reformatting. * exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb, exp_strm.adb, aa_drive.adb: Minor reformatting. * sem_res.adb (Is_Predefined_Operator): An operator that is an imported intrinsic with an Interface_Name denotes an imported back-end builtin, and must be rewritten into a call, not left in the tree as an operator, so return False in that case. 2010-06-18 Eric Botcazou <ebotcazou@adacore.com> * exp_util.adb (Remove_Side_Effects): Make a copy for an allocator. 2010-06-18 Robert Dewar <dewar@adacore.com> * scos.ads: Add proposed output for case expression 2010-06-18 Jose Ruiz <ruiz@adacore.com> * gnat_ugn.texi: Document that, when using the RTX compiler to generate RTSS modules, we need to use the Microsoft linker. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog24
-rw-r--r--gcc/ada/exp_ch5.adb8
-rw-r--r--gcc/ada/exp_strm.adb4
-rw-r--r--gcc/ada/exp_util.adb7
-rw-r--r--gcc/ada/gnat_ugn.texi3
-rw-r--r--gcc/ada/rtsfind.adb6
-rw-r--r--gcc/ada/s-shasto.adb8
-rw-r--r--gcc/ada/scos.ads25
-rw-r--r--gcc/ada/sem_ch10.adb42
-rw-r--r--gcc/ada/sem_intr.adb4
-rw-r--r--gcc/ada/sem_res.adb33
-rw-r--r--gcc/ada/tbuild.adb4
-rw-r--r--gcc/ada/types.ads63
13 files changed, 149 insertions, 82 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f76b284c1d6..e48bac3e0c2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,27 @@
+2010-06-18 Thomas Quinot <quinot@adacore.com>
+
+ * types.ads: Clean up obsolete comments
+ * tbuild.adb: Minor reformatting.
+ * exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb,
+ exp_strm.adb, aa_drive.adb: Minor reformatting.
+ * sem_res.adb (Is_Predefined_Operator): An operator that is an imported
+ intrinsic with an Interface_Name denotes an imported back-end builtin,
+ and must be rewritten into a call, not left in the tree as an operator,
+ so return False in that case.
+
+2010-06-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * exp_util.adb (Remove_Side_Effects): Make a copy for an allocator.
+
+2010-06-18 Robert Dewar <dewar@adacore.com>
+
+ * scos.ads: Add proposed output for case expression
+
+2010-06-18 Jose Ruiz <ruiz@adacore.com>
+
+ * gnat_ugn.texi: Document that, when using the RTX compiler to generate
+ RTSS modules, we need to use the Microsoft linker.
+
2010-06-18 Robert Dewar <dewar@adacore.com>
* checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 2cdb9c8111d..71b58ae358e 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -4192,9 +4192,9 @@ package body Exp_Ch5 is
end;
end if;
- -- If we are returning an object that may not be bit-aligned, then
- -- copy the value into a temporary first. This copy may need to expand
- -- to a loop of component operations..
+ -- If we are returning an object that may not be bit-aligned, then copy
+ -- the value into a temporary first. This copy may need to expand to a
+ -- loop of component operations.
if Is_Possibly_Unaligned_Slice (Exp)
or else Is_Possibly_Unaligned_Object (Exp)
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index 42c34a8487e..ddb1064c475 100644
--- a/gcc/ada/exp_strm.adb
+++ b/gcc/ada/exp_strm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -1396,7 +1396,7 @@ package body Exp_Strm is
-- If the enclosing record is an unchecked_union, we use the
-- default expressions for the discriminant (it must exist)
-- because we cannot generate a reference to it, given that
- -- it is not stored..
+ -- it is not stored.
if Is_Unchecked_Union (Scope (Entity (Name (VP)))) then
D_Ref :=
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index e8a85103be8..95036b9e726 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -4684,14 +4684,15 @@ package body Exp_Util is
Scope_Suppress := (others => True);
-- If it is a scalar type and we need to capture the value, just make
- -- a copy. Likewise for a function call, an attribute reference or an
- -- operator. And if we have a volatile reference and Name_Req is not
- -- set (see comments above for Side_Effect_Free).
+ -- a copy. Likewise for a function call, an attribute reference, an
+ -- allocator or an operator. And if we have a volatile reference and
+ -- Name_Req is not set (see comments above for Side_Effect_Free).
if Is_Elementary_Type (Exp_Type)
and then (Variable_Ref
or else Nkind (Exp) = N_Function_Call
or else Nkind (Exp) = N_Attribute_Reference
+ or else Nkind (Exp) = N_Allocator
or else Nkind (Exp) in N_Op
or else (not Name_Req and then Is_Volatile_Reference (Exp)))
then
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 274dc8c4662..0681deaab2d 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -25555,7 +25555,8 @@ Windows executables that run in Ring 3 to utilize memory protection
@item
Real-time subsystem (RTSS) executables that run in Ring 0, where
performance can be optimized with RTSS applications taking precedent
-over all Windows applications (@emph{rts-rtx-rtss}).
+over all Windows applications (@emph{rts-rtx-rtss}). This mode requires
+the Microsoft linker to handle RTSS libraries.
@end itemize
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index 32323fc593e..9742cb20b95 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -1333,8 +1333,8 @@ package body Rtsfind is
-- The RT_Unit_Table entry that may need updating
begin
- -- If entry is not set, set it now, and indicate that it
- -- was loaded through an explicit context clause..
+ -- If entry is not set, set it now, and indicate that it was
+ -- loaded through an explicit context clause.
if No (U.Entity) then
U := (Entity => E,
diff --git a/gcc/ada/s-shasto.adb b/gcc/ada/s-shasto.adb
index 7038d796c28..783fdc4a95d 100644
--- a/gcc/ada/s-shasto.adb
+++ b/gcc/ada/s-shasto.adb
@@ -6,8 +6,8 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
--- --
+-- Copyright (C) 1998-2010, 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 3, or (at your option) any later ver- --
@@ -88,8 +88,8 @@ package body System.Shared_Storage is
Item : AS.Stream_Element_Array);
subtype Hash_Header is Natural range 0 .. 30;
- -- Number of hash headers, related (for efficiency purposes only)
- -- to the maximum number of lock files..
+ -- Number of hash headers, related (for efficiency purposes only) to the
+ -- maximum number of lock files.
type Shared_Var_File_Entry;
type Shared_Var_File_Entry_Ptr is access Shared_Var_File_Entry;
diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads
index dc02e28c5e0..ce865d77587 100644
--- a/gcc/ada/scos.ads
+++ b/gcc/ada/scos.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2009-2010, 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- --
@@ -161,9 +161,9 @@ package SCOs is
-- and is omitted for all other cases.
- -- Note: up to 6 entries can appear on a single CS line. If more than 6
- -- entries appear in one logical statement sequence, continuation lines are
- -- marked by Cs and appear immediately after the CS line they continue.
+ -- Note: up to 6 entries can appear on a single CS line. If more than 6
+ -- entries appear in one logical statement sequence, continuation lines
+ -- are marked by Cs and appear immediately after the CS line.
-- Decisions
@@ -272,6 +272,23 @@ package SCOs is
-- enclosing statement. The SCO line for a nested decision always occurs
-- after the line for the enclosing decision.
+ -- Case Expressions
+
+ -- For case statements, we rely on statement coverage to make sure that
+ -- all branches of a case statement are covered, but that does not work
+ -- for case expressions, since the entire expression is contained in a
+ -- single statement. However, for complete coverage we really should be
+ -- able to check that every branch of the case statement is covered, so
+ -- we generate a SCO of the form:
+
+ -- CC sloc-range sloc-range ...
+
+ -- where sloc-range covers the range of the case expression.
+
+ -- Note: up to 6 entries can appear on a single CC line. If more than 6
+ -- entries appear in one logical statement sequence, continuation lines
+ -- are marked by Cc and appear immediately after the CC line.
+
---------------------------------------------------------------------
-- Internal table used to store Source Coverage Obligations (SCOs) --
---------------------------------------------------------------------
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 6b61a875763..e5a42d669f2 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -552,7 +552,8 @@ package body Sem_Ch10 is
or else
Used_In_Spec)
then
- Error_Msg_N ("?redundant with clause in body", Clause);
+ Error_Msg_N -- CODEFIX
+ ("?redundant with clause in body", Clause);
end if;
Used_In_Body := False;
@@ -580,7 +581,8 @@ package body Sem_Ch10 is
Exit_On_Self => True);
if Withed then
- Error_Msg_N ("?redundant with clause", Clause);
+ Error_Msg_N -- CODEFIX
+ ("?redundant with clause", Clause);
end if;
end;
end if;
@@ -690,9 +692,9 @@ package body Sem_Ch10 is
end if;
if Circularity then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("circular dependency caused by with_clauses", N);
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("\possibly missing limited_with clause"
& " in one of the following", N);
@@ -1470,11 +1472,11 @@ package body Sem_Ch10 is
Unit_Name)
then
Error_Msg_Sloc := Sloc (It);
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("simultaneous visibility of limited "
& "and unlimited views not allowed",
Item);
- Error_Msg_NE
+ Error_Msg_NE -- CODEFIX???
("\unlimited view visible through "
& "context clause #",
Item, It);
@@ -1853,7 +1855,8 @@ package body Sem_Ch10 is
if No (Nam)
or else not Is_Protected_Type (Etype (Nam))
then
- Error_Msg_N ("missing specification for Protected body", N);
+ Error_Msg_N -- CODEFIX???
+ ("missing specification for Protected body", N);
else
Set_Scope (Defining_Entity (N), Current_Scope);
Set_Has_Completion (Etype (Nam));
@@ -2252,7 +2255,8 @@ package body Sem_Ch10 is
end if;
if No (Nam) or else not Is_Task_Type (Etype (Nam)) then
- Error_Msg_N ("missing specification for task body", N);
+ Error_Msg_N -- CODEFIX???
+ ("missing specification for task body", N);
else
Set_Scope (Defining_Entity (N), Current_Scope);
Generate_Reference (Nam, Defining_Identifier (N), 'b');
@@ -2393,13 +2397,15 @@ package body Sem_Ch10 is
begin
if U_Kind = Implementation_Unit then
- Error_Msg_F ("& is an internal 'G'N'A'T unit?", Name (N));
+ Error_Msg_F -- CODEFIX???
+ ("& is an internal 'G'N'A'T unit?", Name (N));
-- Add alternative name if available, otherwise issue a
-- general warning message.
if Error_Msg_Strlen /= 0 then
- Error_Msg_F ("\use ""~"" instead", Name (N));
+ Error_Msg_F -- CODEFIX???
+ ("\use ""~"" instead", Name (N));
else
Error_Msg_F
("\use of this unit is non-portable " &
@@ -3449,7 +3455,7 @@ package body Sem_Ch10 is
end loop;
if E2 = WEnt then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("unlimited view visible through use clause ", W);
return;
end if;
@@ -3799,7 +3805,7 @@ package body Sem_Ch10 is
N_Generic_Package_Declaration)
and then Nkind (Lib_Unit) not in N_Generic_Renaming_Declaration
then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("child of a generic package must be a generic unit", Lib_Unit);
elsif not Is_Package_Or_Generic_Package (P_Name) then
@@ -4491,11 +4497,11 @@ package body Sem_Ch10 is
-- installed.
if Kind = N_Package_Declaration then
- Error_Msg_N
+ Error_Msg_N -- CODEFIX???
("simultaneous visibility of the limited and " &
"unlimited views not allowed", N);
Error_Msg_Sloc := Sloc (Item);
- Error_Msg_NE
+ Error_Msg_NE -- CODEFIX???
("\\ unlimited view of & visible through the " &
"context clause #", N, P);
Error_Msg_Sloc := Sloc (Decl);
@@ -5948,9 +5954,9 @@ package body Sem_Ch10 is
if Nkind (Item) = N_With_Clause
and then Private_Present (Item)
then
- -- If private_with_clause is redundant, remove it from
- -- context, as a small optimization to subsequent handling
- -- of private_with clauses in other nested packages..
+ -- If private_with_clause is redundant, remove it from context,
+ -- as a small optimization to subsequent handling of private_with
+ -- clauses in other nested packages.
if In_Regular_With_Clause (Entity (Name (Item))) then
declare
diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb
index e5c779f1d7d..20a1614fb06 100644
--- a/gcc/ada/sem_intr.adb
+++ b/gcc/ada/sem_intr.adb
@@ -53,8 +53,8 @@ package body Sem_Intr is
-- returns type String.
procedure Check_Intrinsic_Operator (E : Entity_Id; N : Node_Id);
- -- Check that operator is one of the binary arithmetic operators, and
- -- that the types involved both have underlying integer types.
+ -- Check that operator is one of the binary arithmetic operators, and that
+ -- the types involved both have underlying integer types.
procedure Check_Shift (E : Entity_Id; N : Node_Id);
-- Check intrinsic shift subprogram, the two arguments are the same
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 7fb17fd08a2..287a940e646 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -130,10 +130,14 @@ package body Sem_Res is
-- declaration, and not an (anonymous) allocator type.
function Is_Predefined_Op (Nam : Entity_Id) return Boolean;
- -- Utility to check whether the name in the call is a predefined
- -- operator, in which case the call is made into an operator node.
- -- An instance of an intrinsic conversion operation may be given
- -- an operator name, but is not treated like an operator.
+ -- Utility to check whether the entity for an operator is a predefined
+ -- operator, in which case the expression is left as an operator in the
+ -- tree (else it is rewritten into a call). An instance of an intrinsic
+ -- conversion operation may be given an operator name, but is not treated
+ -- like an operator. Note that an operator that is an imported back-end
+ -- builtin has convention Intrinsic, but is expected to be rewritten into
+ -- a call, so such an operator is not treated as predefined by this
+ -- predicate.
procedure Replace_Actual_Discriminants (N : Node_Id; Default : Node_Id);
-- If a default expression in entry call N depends on the discriminants
@@ -213,6 +217,9 @@ package body Sem_Res is
procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id);
-- A call to a user-defined intrinsic operator is rewritten as a call
-- to the corresponding predefined operator, with suitable conversions.
+ -- Note that this applies only for intrinsic operators that denote
+ -- predefined operators, not opeartors that are intrinsic imports of
+ -- back-end builtins.
procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id);
-- Ditto, for unary operators (arithmetic ones and "not" on signed
@@ -1108,11 +1115,21 @@ package body Sem_Res is
function Is_Predefined_Op (Nam : Entity_Id) return Boolean is
begin
- return Is_Intrinsic_Subprogram (Nam)
- and then not Is_Generic_Instance (Nam)
+ -- Predefined operators are intrinsic subprograms
+
+ if not Is_Intrinsic_Subprogram (Nam) then
+ return False;
+ end if;
+
+ -- A call to a back-end builtin is never a predefined operator
+
+ if Is_Imported (Nam) and then Present (Interface_Name (Nam)) then
+ return False;
+ end if;
+
+ return not Is_Generic_Instance (Nam)
and then Chars (Nam) in Any_Operator_Name
- and then (No (Alias (Nam))
- or else Is_Predefined_Op (Alias (Nam)));
+ and then (No (Alias (Nam)) or else Is_Predefined_Op (Alias (Nam)));
end Is_Predefined_Op;
-----------------------------
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index b92854ec29d..ed9a7138c43 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2010, 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- --
@@ -659,7 +659,7 @@ package body Tbuild is
-- We don't really need these shift operators, since they never
-- appear as operators in the source, but the path of least
- -- resistance is to put them in (the aggregate must be complete)
+ -- resistance is to put them in (the aggregate must be complete).
N_Op_Rotate_Left => Name_Rotate_Left,
N_Op_Rotate_Right => Name_Rotate_Right,
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 5467f4efe9c..42004ae2654 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -348,16 +348,16 @@ package Types is
-- lie in. Such tests appear only in the lowest level packages.
subtype List_Range is Union_Id
- range List_Low_Bound .. List_High_Bound;
+ range List_Low_Bound .. List_High_Bound;
subtype Node_Range is Union_Id
- range Node_Low_Bound .. Node_High_Bound;
+ range Node_Low_Bound .. Node_High_Bound;
subtype Elist_Range is Union_Id
- range Elist_Low_Bound .. Elist_High_Bound;
+ range Elist_Low_Bound .. Elist_High_Bound;
subtype Elmt_Range is Union_Id
- range Elmt_Low_Bound .. Elmt_High_Bound;
+ range Elmt_Low_Bound .. Elmt_High_Bound;
subtype Names_Range is Union_Id
range Names_Low_Bound .. Names_High_Bound;
@@ -369,23 +369,23 @@ package Types is
range Uint_Low_Bound .. Uint_High_Bound;
subtype Ureal_Range is Union_Id
- range Ureal_Low_Bound .. Ureal_High_Bound;
+ range Ureal_Low_Bound .. Ureal_High_Bound;
- ----------------------------
+ -----------------------------
-- Types for Atree Package --
- ----------------------------
+ -----------------------------
-- Node_Id values are used to identify nodes in the tree. They are
- -- subscripts into the Node table declared in package Tree. Note that
- -- the special values Empty and Error are subscripts into this table,
+ -- subscripts into the Nodes table declared in package Atree. Note that
+ -- the special values Empty and Error are subscripts into this table.
-- See package Atree for further details.
type Node_Id is range Node_Low_Bound .. Node_High_Bound;
-- Type used to identify nodes in the tree
subtype Entity_Id is Node_Id;
- -- A synonym for node types, used in the entity package to refer to nodes
- -- that are entities (i.e. nodes with an Nkind of N_Defining_xxx) All such
+ -- A synonym for node types, used in the Einfo package to refer to nodes
+ -- that are entities (i.e. nodes with an Nkind of N_Defining_xxx). All such
-- nodes are extended nodes and these are the only extended nodes, so that
-- in practice entity and extended nodes are synonymous.
@@ -402,12 +402,12 @@ package Types is
Empty_List_Or_Node : constant := 0;
-- This constant is used in situations (e.g. initializing empty fields)
- -- where the value set will be used to represent either an empty node
- -- or a non-existent list, depending on the context.
+ -- where the value set will be used to represent either an empty node or
+ -- a non-existent list, depending on the context.
Error : constant Node_Id := Node_Low_Bound + 1;
- -- Used to indicate that there was an error in the source program. A node
- -- is actually allocated at this address, so that Nkind (Error) = N_Error.
+ -- Used to indicate an error in the source program. A node is actually
+ -- allocated with this Id value, so that Nkind (Error) = N_Error.
Empty_Or_Error : constant Node_Id := Error;
-- Since Empty and Error are the first two Node_Id values, the test for
@@ -422,11 +422,12 @@ package Types is
-- Types for Nlists Package --
------------------------------
- -- List_Id values are used to identify node lists in the tree. They are
- -- subscripts into the Lists table declared in package Tree. Note that the
- -- special value Error_List is a subscript in this table, but the value
- -- No_List is *not* a valid subscript, and any attempt to apply list
- -- operations to No_List will cause a (detected) error.
+ -- List_Id values are used to identify node lists stored in the tree, so
+ -- that each node can be on at most one such list (see package Nlists for
+ -- further details). Note that the special value Error_List is a subscript
+ -- in this table, but the value No_List is *not* a valid subscript, and any
+ -- attempt to apply list operations to No_List will cause a (detected)
+ -- error.
type List_Id is range List_Low_Bound .. List_High_Bound;
-- Type used to identify a node list
@@ -449,24 +450,23 @@ package Types is
-- Types for Elists Package --
------------------------------
- -- Element list Id values are used to identify element lists stored in the
- -- tree (see package Atree for further details). They are formed by adding
- -- a bias (Element_List_Bias) to subscript values in the same array that is
- -- used for node list headers.
+ -- Element list Id values are used to identify element lists stored outside
+ -- of the tree, allowing nodes to be members of more than one such list
+ -- (see package Elists for further details).
type Elist_Id is range Elist_Low_Bound .. Elist_High_Bound;
-- Type used to identify an element list (Elist header table subscript)
No_Elist : constant Elist_Id := Elist_Low_Bound;
- -- Used to indicate absence of an element list. Note that this is not
- -- an actual Elist header, so element list operations on this value
- -- are not valid.
+ -- Used to indicate absence of an element list. Note that this is not an
+ -- actual Elist header, so element list operations on this value are not
+ -- valid.
First_Elist_Id : constant Elist_Id := No_Elist + 1;
-- Subscript of first allocated Elist header
- -- Element Id values are used to identify individual elements of an
- -- element list (see package Elists for further details).
+ -- Element Id values are used to identify individual elements of an element
+ -- list (see package Elists for further details).
type Elmt_Id is range Elmt_Low_Bound .. Elmt_High_Bound;
-- Type used to identify an element list
@@ -482,11 +482,12 @@ package Types is
-------------------------------
-- String_Id values are used to identify entries in the strings table. They
- -- are subscripts into the strings table defined in package Strings.
+ -- are subscripts into the Strings table defined in package Stringt.
-- Note that with only a few exceptions, which are clearly documented, the
-- type String_Id should be regarded as a private type. In particular it is
-- never appropriate to perform arithmetic operations using this type.
+ -- Doesn't this also apply to all other *_Id types???
type String_Id is range Strings_Low_Bound .. Strings_High_Bound;
-- Type used to identify entries in the strings table
@@ -554,7 +555,7 @@ package Types is
type Unit_Number_Type is new Int;
-- Unit number. The main source is unit 0, and subsidiary sources have
-- non-zero numbers starting with 1. Unit numbers are used to index the
- -- file table in Lib.
+ -- Units table in package Lib.
Main_Unit : constant Unit_Number_Type := 0;
-- Unit number value for main unit