[multiple changes]
[gcc.git] / gcc / ada / atree.adb
index a6105e2c4278fc3b8d8c0b05ee345249ba6456a4..1a7e36ca70dd2a94a44c4c2d15add4994ce167b0 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2013, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2017, 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- --
@@ -39,15 +39,26 @@ pragma Style_Checks (All_Checks);
 with Aspects; use Aspects;
 with Debug;   use Debug;
 with Nlists;  use Nlists;
+with Opt;     use Opt;
 with Output;  use Output;
 with Sinput;  use Sinput;
 with Tree_IO; use Tree_IO;
 
+with GNAT.Heap_Sort_G;
+
 package body Atree is
 
+   Locked : Boolean := False;
+   --  Compiling with assertions enabled, node contents modifications are
+   --  permitted only when this switch is set to False; compiling without
+   --  assertions this lock has no effect.
+
    Reporting_Proc : Report_Proc := null;
    --  Record argument to last call to Set_Reporting_Proc
 
+   Rewriting_Proc : Rewrite_Proc := null;
+   --  This soft link captures the procedure invoked during a node rewrite
+
    ---------------
    -- Debugging --
    ---------------
@@ -65,11 +76,12 @@ package body Atree is
    --     ww := 12345
    --  and set a breakpoint on New_Node_Breakpoint (nickname "nn"). Continue.
 
-   --  Either way, gnat1 will stop when node 12345 is created
-
-   --  The second method is much faster
+   --  Either way, gnat1 will stop when node 12345 is created, or certain other
+   --  interesting operations are performed, such as Rewrite. To see exactly
+   --  which operations, search for "pragma Debug" below.
 
-   --  Similarly, rr and rrd allow breaking on rewriting of a given node
+   --  The second method is much faster if the amount of Ada code being
+   --  compiled is large.
 
    ww : Node_Id'Base := Node_Id'First - 1;
    pragma Export (Ada, ww); --  trick the optimizer
@@ -95,24 +107,12 @@ package body Atree is
    --  If Node = Watch_Node, this prints out the new node and calls
    --  New_Node_Breakpoint. Otherwise, does nothing.
 
-   procedure rr;
-   pragma Export (Ada, rr);
-   procedure Rewrite_Breakpoint renames rr;
-   --  This doesn't do anything interesting; it's just for setting breakpoint
-   --  on as explained above.
-
-   procedure rrd (Old_Node, New_Node : Node_Id);
-   pragma Export (Ada, rrd);
-   procedure Rewrite_Debugging_Output
-     (Old_Node, New_Node : Node_Id) renames rrd;
-   --  For debugging. If debugging is turned on, Rewrite calls this. If debug
-   --  flag N is turned on, this prints out the new node.
-   --
-   --  If Old_Node = Watch_Node, this prints out the old and new nodes and
-   --  calls Rewrite_Breakpoint. Otherwise, does nothing.
-
    procedure Node_Debug_Output (Op : String; N : Node_Id);
-   --  Common code for nnd and rrd, writes Op followed by information about N
+   --  Called by nnd; writes Op followed by information about N
+
+   procedure Print_Statistics;
+   pragma Export (Ada, Print_Statistics);
+   --  Print various statistics on the tables maintained by the package
 
    -----------------------------
    -- Local Objects and Types --
@@ -122,10 +122,10 @@ package body Atree is
    --  Count allocated nodes for Num_Nodes function
 
    use Unchecked_Access;
-   --  We are allowed to see these from within our own body!
+   --  We are allowed to see these from within our own body
 
    use Atree_Private_Part;
-   --  We are also allowed to see our private data structures!
+   --  We are also allowed to see our private data structures
 
    --  Functions used to store Entity_Kind value in Nkind field
 
@@ -507,8 +507,9 @@ package body Atree is
       Table_Component_Type => Node_Id,
       Table_Index_Type     => Node_Id'Base,
       Table_Low_Bound      => First_Node_Id,
-      Table_Initial        => Alloc.Orig_Nodes_Initial,
-      Table_Increment      => Alloc.Orig_Nodes_Increment,
+      Table_Initial        => Alloc.Nodes_Initial,
+      Table_Increment      => Alloc.Nodes_Increment,
+      Release_Threshold    => Alloc.Nodes_Release_Threshold,
       Table_Name           => "Orig_Nodes");
 
    --------------------------
@@ -541,16 +542,20 @@ package body Atree is
    -- Local Subprograms --
    -----------------------
 
-   procedure Fix_Parents (Ref_Node, Fix_Node : Node_Id);
-   --  Fixup parent pointers for the syntactic children of Fix_Node after
-   --  a copy, setting them to Fix_Node when they pointed to Ref_Node.
-
    function Allocate_Initialize_Node
      (Src            : Node_Id;
       With_Extension : Boolean) return Node_Id;
    --  Allocate a new node or node extension. If Src is not empty, the
    --  information for the newly-allocated node is copied from it.
 
+   procedure Fix_Parents (Ref_Node, Fix_Node : Node_Id);
+   --  Fix up parent pointers for the syntactic children of Fix_Node after a
+   --  copy, setting them to Fix_Node when they pointed to Ref_Node.
+
+   procedure Mark_New_Ghost_Node (N : Node_Or_Entity_Id);
+   --  Mark arbitrary node or entity N as Ghost when it is created within a
+   --  Ghost region.
+
    ------------------------------
    -- Allocate_Initialize_Node --
    ------------------------------
@@ -568,14 +573,17 @@ package body Atree is
         and then Src = Nodes.Last
       then
          New_Id := Src;
-      else
-         --  We are allocating a new node, or extending a node
-         --  other than Nodes.Last.
 
+      --  We are allocating a new node, or extending a node other than
+      --  Nodes.Last.
+
+      else
          if Present (Src) then
             Nodes.Append (Nodes.Table (Src));
+            Flags.Append (Flags.Table (Src));
          else
             Nodes.Append (Default_Node);
+            Flags.Append (Default_Flags);
          end if;
 
          New_Id := Nodes.Last;
@@ -583,6 +591,10 @@ package body Atree is
          Node_Count := Node_Count + 1;
       end if;
 
+      --  Clear Check_Actuals to False
+
+      Set_Check_Actuals (New_Id, False);
+
       --  Specifically copy Paren_Count to deal with creating new table entry
       --  if the parentheses count is at the maximum possible value already.
 
@@ -595,11 +607,13 @@ package body Atree is
       if With_Extension then
          if Present (Src) and then Has_Extension (Src) then
             for J in 1 .. Num_Extension_Nodes loop
-               Nodes.Append (Nodes.Table (Src + Node_Id (J)));
+               Nodes.Append (Nodes.Table (Src + J));
+               Flags.Append (Flags.Table (Src + J));
             end loop;
          else
             for J in 1 .. Num_Extension_Nodes loop
                Nodes.Append (Default_Node_Extension);
+               Flags.Append (Default_Flags);
             end loop;
          end if;
       end if;
@@ -638,6 +652,15 @@ package body Atree is
           (Nodes.Table (E + 2).Field12'Unrestricted_Access)).Convention := Val;
    end Basic_Set_Convention;
 
+   -------------------
+   -- Check_Actuals --
+   -------------------
+
+   function Check_Actuals (N : Node_Id) return Boolean is
+   begin
+      return Flags.Table (N).Check_Actuals;
+   end Check_Actuals;
+
    --------------------------
    -- Check_Error_Detected --
    --------------------------
@@ -680,6 +703,8 @@ package body Atree is
       Nodes.Table (N).Nkind             := New_Node_Kind;
       Nodes.Table (N).Error_Posted      := Save_Posted;
 
+      Flags.Table (N) := Default_Flags;
+
       if New_Node_Kind in N_Subexpr then
          Set_Paren_Count (N, Par_Count);
       end if;
@@ -714,10 +739,15 @@ package body Atree is
       Save_Link    : constant Union_Id := Nodes.Table (Destination).Link;
 
    begin
+      pragma Debug (New_Node_Debugging_Output (Source));
+      pragma Debug (New_Node_Debugging_Output (Destination));
+
       Nodes.Table (Destination)         := Nodes.Table (Source);
       Nodes.Table (Destination).In_List := Save_In_List;
       Nodes.Table (Destination).Link    := Save_Link;
 
+      Flags.Table (Destination) := Flags.Table (Source);
+
       --  Specifically set Paren_Count to make sure auxiliary table entry
       --  gets correctly made if the parentheses count is at the max value.
 
@@ -725,18 +755,15 @@ package body Atree is
          Set_Paren_Count (Destination, Paren_Count (Source));
       end if;
 
-      --  Deal with copying extension nodes if present
+      --  Deal with copying extension nodes if present. No need to copy flags
+      --  table entries, since they are always zero for extending components.
 
-      if Has_Extension (Source) then
-         pragma Assert (Has_Extension (Destination));
-         Nodes.Table (Destination + 1) := Nodes.Table (Source + 1);
-         Nodes.Table (Destination + 2) := Nodes.Table (Source + 2);
-         Nodes.Table (Destination + 3) := Nodes.Table (Source + 3);
-         Nodes.Table (Destination + 4) := Nodes.Table (Source + 4);
+      pragma Assert (Has_Extension (Source) = Has_Extension (Destination));
 
-      else
-         pragma Assert (not Has_Extension (Source));
-         null;
+      if Has_Extension (Source) then
+         for J in 1 .. Num_Extension_Nodes loop
+            Nodes.Table (Destination + J) := Nodes.Table (Source + J);
+         end loop;
       end if;
    end Copy_Node;
 
@@ -763,7 +790,7 @@ package body Atree is
    ------------------------
 
    function Copy_Separate_Tree (Source : Node_Id) return Node_Id is
-      New_Id  : Node_Id;
+      New_Id : Node_Id;
 
       function Copy_Entity (E : Entity_Id) return Entity_Id;
       --  Copy Entity, copying only the Ekind and Chars fields
@@ -772,8 +799,8 @@ package body Atree is
       --  Copy list
 
       function Possible_Copy (Field : Union_Id) return Union_Id;
-      --  Given a field, returns a copy of the node or list if its parent
-      --  is the current source node, and otherwise returns the input
+      --  Given a field, returns a copy of the node or list if its parent is
+      --  the current source node, and otherwise returns the input.
 
       -----------------
       -- Copy_Entity --
@@ -783,6 +810,8 @@ package body Atree is
          New_Ent : Entity_Id;
 
       begin
+         --  Build appropriate node
+
          case N_Entity (Nkind (E)) is
             when N_Defining_Identifier =>
                New_Ent := New_Entity (N_Defining_Identifier, Sloc (E));
@@ -795,6 +824,7 @@ package body Atree is
          end case;
 
          Set_Chars (New_Ent, Chars (E));
+         --  Set_Comes_From_Source (New_Ent, Comes_From_Source (E));
          return New_Ent;
       end Copy_Entity;
 
@@ -871,7 +901,7 @@ package body Atree is
       else
          New_Id := New_Copy (Source);
 
-         --  Recursively copy descendents
+         --  Recursively copy descendants
 
          Set_Field1 (New_Id, Possible_Copy (Field1 (New_Id)));
          Set_Field2 (New_Id, Possible_Copy (Field2 (New_Id)));
@@ -879,6 +909,16 @@ package body Atree is
          Set_Field4 (New_Id, Possible_Copy (Field4 (New_Id)));
          Set_Field5 (New_Id, Possible_Copy (Field5 (New_Id)));
 
+         --  Explicitly copy the aspect specifications as those do not reside
+         --  in a node field.
+
+         if Permits_Aspect_Specifications (Source)
+           and then Has_Aspects (Source)
+         then
+            Set_Aspect_Specifications
+              (New_Id, Copy_List (Aspect_Specifications (Source)));
+         end if;
+
          --  Set Entity field to Empty to ensure that no entity references
          --  are shared between the two, if the source is already analyzed.
 
@@ -888,6 +928,42 @@ package body Atree is
             Set_Entity (New_Id, Empty);
          end if;
 
+         --  Reset all Etype fields and Analyzed flags, because input tree may
+         --  have been fully or partially analyzed.
+
+         if Nkind (New_Id) in N_Has_Etype then
+            Set_Etype (New_Id, Empty);
+         end if;
+
+         Set_Analyzed (New_Id, False);
+
+         --  Rather special case, if we have an expanded name, then change
+         --  it back into a selected component, so that the tree looks the
+         --  way it did coming out of the parser. This will change back
+         --  when we analyze the selected component node.
+
+         if Nkind (New_Id) = N_Expanded_Name then
+
+            --  The following code is a bit kludgy. It would be cleaner to
+            --  Add an entry Change_Expanded_Name_To_Selected_Component to
+            --  Sinfo.CN, but that's an earthquake, because it has the wrong
+            --  license, and Atree is used outside the compiler, e.g. in the
+            --  binder and in ASIS, so we don't want to add that dependency.
+
+            --  Consequently we have no choice but to hold our noses and do
+            --  the change manually. At least we are Atree, so this odd use
+            --  of Atree.Unchecked_Access is at least all in the family.
+
+            --  Change the node type
+
+            Atree.Unchecked_Access.Set_Nkind (New_Id, N_Selected_Component);
+
+            --  Clear the Chars field which is not present in a selected
+            --  component node, so we don't want a junk value around.
+
+            Set_Node1 (New_Id, Empty);
+         end if;
+
          --  All done, return copied node
 
          return New_Id;
@@ -978,6 +1054,126 @@ package body Atree is
              T = V6;
    end Ekind_In;
 
+   function Ekind_In
+     (T  : Entity_Kind;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind) return Boolean
+   is
+   begin
+      return T = V1 or else
+             T = V2 or else
+             T = V3 or else
+             T = V4 or else
+             T = V5 or else
+             T = V6 or else
+             T = V7;
+   end Ekind_In;
+
+   function Ekind_In
+     (T  : Entity_Kind;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind;
+      V8 : Entity_Kind) return Boolean
+   is
+   begin
+      return T = V1 or else
+             T = V2 or else
+             T = V3 or else
+             T = V4 or else
+             T = V5 or else
+             T = V6 or else
+             T = V7 or else
+             T = V8;
+   end Ekind_In;
+
+   function Ekind_In
+     (T  : Entity_Kind;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind;
+      V8 : Entity_Kind;
+      V9 : Entity_Kind) return Boolean
+   is
+   begin
+      return T = V1 or else
+             T = V2 or else
+             T = V3 or else
+             T = V4 or else
+             T = V5 or else
+             T = V6 or else
+             T = V7 or else
+             T = V8 or else
+             T = V9;
+   end Ekind_In;
+
+   function Ekind_In
+     (T   : Entity_Kind;
+      V1  : Entity_Kind;
+      V2  : Entity_Kind;
+      V3  : Entity_Kind;
+      V4  : Entity_Kind;
+      V5  : Entity_Kind;
+      V6  : Entity_Kind;
+      V7  : Entity_Kind;
+      V8  : Entity_Kind;
+      V9  : Entity_Kind;
+      V10 : Entity_Kind) return Boolean
+   is
+   begin
+      return T = V1 or else
+             T = V2 or else
+             T = V3 or else
+             T = V4 or else
+             T = V5 or else
+             T = V6 or else
+             T = V7 or else
+             T = V8 or else
+             T = V9 or else
+             T = V10;
+   end Ekind_In;
+
+   function Ekind_In
+     (T   : Entity_Kind;
+      V1  : Entity_Kind;
+      V2  : Entity_Kind;
+      V3  : Entity_Kind;
+      V4  : Entity_Kind;
+      V5  : Entity_Kind;
+      V6  : Entity_Kind;
+      V7  : Entity_Kind;
+      V8  : Entity_Kind;
+      V9  : Entity_Kind;
+      V10 : Entity_Kind;
+      V11 : Entity_Kind) return Boolean
+   is
+   begin
+      return T = V1  or else
+             T = V2  or else
+             T = V3  or else
+             T = V4  or else
+             T = V5  or else
+             T = V6  or else
+             T = V7  or else
+             T = V8  or else
+             T = V9  or else
+             T = V10 or else
+             T = V11;
+   end Ekind_In;
+
    function Ekind_In
      (E  : Entity_Id;
       V1 : Entity_Kind;
@@ -1033,15 +1229,86 @@ package body Atree is
       return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6);
    end Ekind_In;
 
-   ------------------------
-   -- Set_Reporting_Proc --
-   ------------------------
+   function Ekind_In
+     (E  : Entity_Id;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind) return Boolean
+   is
+   begin
+      return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7);
+   end Ekind_In;
 
-   procedure Set_Reporting_Proc (P : Report_Proc) is
+   function Ekind_In
+     (E  : Entity_Id;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind;
+      V8 : Entity_Kind) return Boolean
+   is
    begin
-      pragma Assert (Reporting_Proc = null);
-      Reporting_Proc := P;
-   end Set_Reporting_Proc;
+      return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8);
+   end Ekind_In;
+
+   function Ekind_In
+     (E  : Entity_Id;
+      V1 : Entity_Kind;
+      V2 : Entity_Kind;
+      V3 : Entity_Kind;
+      V4 : Entity_Kind;
+      V5 : Entity_Kind;
+      V6 : Entity_Kind;
+      V7 : Entity_Kind;
+      V8 : Entity_Kind;
+      V9 : Entity_Kind) return Boolean
+   is
+   begin
+      return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9);
+   end Ekind_In;
+
+   function Ekind_In
+     (E   : Entity_Id;
+      V1  : Entity_Kind;
+      V2  : Entity_Kind;
+      V3  : Entity_Kind;
+      V4  : Entity_Kind;
+      V5  : Entity_Kind;
+      V6  : Entity_Kind;
+      V7  : Entity_Kind;
+      V8  : Entity_Kind;
+      V9  : Entity_Kind;
+      V10 : Entity_Kind) return Boolean
+   is
+   begin
+      return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10);
+   end Ekind_In;
+
+   function Ekind_In
+     (E   : Entity_Id;
+      V1  : Entity_Kind;
+      V2  : Entity_Kind;
+      V3  : Entity_Kind;
+      V4  : Entity_Kind;
+      V5  : Entity_Kind;
+      V6  : Entity_Kind;
+      V7  : Entity_Kind;
+      V8  : Entity_Kind;
+      V9  : Entity_Kind;
+      V10 : Entity_Kind;
+      V11 : Entity_Kind) return Boolean
+   is
+   begin
+      return
+        Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11);
+   end Ekind_In;
 
    ------------------
    -- Error_Posted --
@@ -1059,30 +1326,32 @@ package body Atree is
 
    procedure Exchange_Entities (E1 : Entity_Id; E2 : Entity_Id) is
       Temp_Ent : Node_Record;
+      Temp_Flg : Flags_Byte;
 
    begin
-      pragma Assert (Has_Extension (E1)
+      pragma Debug (New_Node_Debugging_Output (E1));
+      pragma Debug (New_Node_Debugging_Output (E2));
+
+      pragma Assert (True
+        and then Has_Extension (E1)
         and then Has_Extension (E2)
         and then not Nodes.Table (E1).In_List
         and then not Nodes.Table (E2).In_List);
 
       --  Exchange the contents of the two entities
 
-      Temp_Ent := Nodes.Table (E1);
-      Nodes.Table (E1) := Nodes.Table (E2);
-      Nodes.Table (E2) := Temp_Ent;
-      Temp_Ent := Nodes.Table (E1 + 1);
-      Nodes.Table (E1 + 1) := Nodes.Table (E2 + 1);
-      Nodes.Table (E2 + 1) := Temp_Ent;
-      Temp_Ent := Nodes.Table (E1 + 2);
-      Nodes.Table (E1 + 2) := Nodes.Table (E2 + 2);
-      Nodes.Table (E2 + 2) := Temp_Ent;
-      Temp_Ent := Nodes.Table (E1 + 3);
-      Nodes.Table (E1 + 3) := Nodes.Table (E2 + 3);
-      Nodes.Table (E2 + 3) := Temp_Ent;
-      Temp_Ent := Nodes.Table (E1 + 4);
-      Nodes.Table (E1 + 4) := Nodes.Table (E2 + 4);
-      Nodes.Table (E2 + 4) := Temp_Ent;
+      for J in 0 .. Num_Extension_Nodes loop
+         Temp_Ent := Nodes.Table (E1 + J);
+         Nodes.Table (E1 + J) := Nodes.Table (E2 + J);
+         Nodes.Table (E2 + J) := Temp_Ent;
+      end loop;
+
+      --  Exchange flag bytes for first component. No need to do the exchange
+      --  for the other components, since the flag bytes are always zero.
+
+      Temp_Flg := Flags.Table (E1);
+      Flags.Table (E1) := Flags.Table (E2);
+      Flags.Table (E2) := Temp_Flg;
 
       --  That exchange exchanged the parent pointers as well, which is what
       --  we want, but we need to patch up the defining identifier pointers
@@ -1135,8 +1404,10 @@ package body Atree is
 
    begin
       pragma Assert (not (Has_Extension (Node)));
+
       Result := Allocate_Initialize_Node (Node, With_Extension => True);
       pragma Debug (Debug_Extend_Node);
+
       return Result;
    end Extend_Node;
 
@@ -1145,9 +1416,8 @@ package body Atree is
    -----------------
 
    procedure Fix_Parents (Ref_Node, Fix_Node : Node_Id) is
-
       procedure Fix_Parent (Field : Union_Id);
-      --  Fixup one parent pointer. Field is checked to see if it points to
+      --  Fix up one parent pointer. Field is checked to see if it points to
       --  a node, list, or element list that has a parent that points to
       --  Ref_Node. If so, the parent is reset to point to Fix_Node.
 
@@ -1188,6 +1458,15 @@ package body Atree is
       Fix_Parent (Field5 (Fix_Node));
    end Fix_Parents;
 
+   -------------------
+   -- Flags_Address --
+   -------------------
+
+   function Flags_Address return System.Address is
+   begin
+      return Flags.Table (First_Node_Id)'Address;
+   end Flags_Address;
+
    -----------------------------------
    -- Get_Comes_From_Source_Default --
    -----------------------------------
@@ -1227,6 +1506,7 @@ package body Atree is
    begin
       Node_Count := 0;
       Atree_Private_Part.Nodes.Init;
+      Atree_Private_Part.Flags.Init;
       Orig_Nodes.Init;
       Paren_Counts.Init;
 
@@ -1236,13 +1516,22 @@ package body Atree is
       Set_Name1 (Empty, No_Name);
 
       --  Allocate Error node, and set Error_Posted, since we certainly
-      --  only generate an Error node if we do post some kind of error!
+      --  only generate an Error node if we do post some kind of error.
 
       Dummy := New_Node (N_Error, No_Location);
       Set_Name1 (Error, Error_Name);
       Set_Error_Posted (Error, True);
    end Initialize;
 
+   ---------------------------
+   -- Is_Ignored_Ghost_Node --
+   ---------------------------
+
+   function Is_Ignored_Ghost_Node (N : Node_Id) return Boolean is
+   begin
+      return Flags.Table (N).Is_Ignored_Ghost_Node;
+   end Is_Ignored_Ghost_Node;
+
    --------------------------
    -- Is_Rewrite_Insertion --
    --------------------------
@@ -1276,12 +1565,50 @@ package body Atree is
 
    procedure Lock is
    begin
+      --  We used to Release the tables, as in the comments below, but that is
+      --  a waste of time. We're only wasting virtual memory here, and the
+      --  release calls copy large amounts of data.
+
+      --  Nodes.Release;
       Nodes.Locked := True;
+      --  Flags.Release;
+      Flags.Locked := True;
+      --  Orig_Nodes.Release;
       Orig_Nodes.Locked := True;
-      Nodes.Release;
-      Orig_Nodes.Release;
    end Lock;
 
+   ----------------
+   -- Lock_Nodes --
+   ----------------
+
+   procedure Lock_Nodes is
+   begin
+      pragma Assert (not Locked);
+      Locked := True;
+   end Lock_Nodes;
+
+   -------------------------
+   -- Mark_New_Ghost_Node --
+   -------------------------
+
+   procedure Mark_New_Ghost_Node (N : Node_Or_Entity_Id) is
+   begin
+      --  The Ghost node is created within a Ghost region
+
+      if Ghost_Mode = Check then
+         if Nkind (N) in N_Entity then
+            Set_Is_Checked_Ghost_Entity (N);
+         end if;
+
+      elsif Ghost_Mode = Ignore then
+         if Nkind (N) in N_Entity then
+            Set_Is_Ignored_Ghost_Entity (N);
+         end if;
+
+         Set_Is_Ignored_Ghost_Node (N);
+      end if;
+   end Mark_New_Ghost_Node;
+
    ----------------------------
    -- Mark_Rewrite_Insertion --
    ----------------------------
@@ -1322,6 +1649,10 @@ package body Atree is
          --  aspects if this is required for the particular situation.
 
          Set_Has_Aspects (New_Id, False);
+
+         --  Mark the copy as Ghost depending on the current Ghost region
+
+         Mark_New_Ghost_Node (New_Id);
       end if;
 
       return New_Id;
@@ -1350,10 +1681,14 @@ package body Atree is
          Current_Error_Node := Ent;
       end if;
 
-      Nodes.Table (Ent).Nkind  := New_Node_Kind;
-      Nodes.Table (Ent).Sloc   := New_Sloc;
+      Nodes.Table (Ent).Nkind := New_Node_Kind;
+      Nodes.Table (Ent).Sloc  := New_Sloc;
       pragma Debug (New_Node_Debugging_Output (Ent));
 
+      --  Mark the new entity as Ghost depending on the current Ghost region
+
+      Mark_New_Ghost_Node (Ent);
+
       return Ent;
    end New_Entity;
 
@@ -1369,6 +1704,7 @@ package body Atree is
 
    begin
       pragma Assert (New_Node_Kind not in N_Entity);
+
       Nod := Allocate_Initialize_Node (Empty, With_Extension => False);
       Nodes.Table (Nod).Nkind := New_Node_Kind;
       Nodes.Table (Nod).Sloc  := New_Sloc;
@@ -1382,6 +1718,10 @@ package body Atree is
          Current_Error_Node := Nod;
       end if;
 
+      --  Mark the new node as Ghost depending on the current Ghost region
+
+      Mark_New_Ghost_Node (Nod);
+
       return Nod;
    end New_Node;
 
@@ -1393,7 +1733,6 @@ package body Atree is
    begin
       Write_Str ("Watched node ");
       Write_Int (Int (Watch_Node));
-      Write_Str (" created");
       Write_Eol;
    end nn;
 
@@ -1406,7 +1745,7 @@ package body Atree is
 
    begin
       if Debug_Flag_N or else Node_Is_Watched then
-         Node_Debug_Output ("Allocate", N);
+         Node_Debug_Output ("Node", N);
 
          if Node_Is_Watched then
             New_Node_Breakpoint;
@@ -1654,6 +1993,114 @@ package body Atree is
         Nodes.Table (OldN).Comes_From_Source;
    end Preserve_Comes_From_Source;
 
+   ----------------------
+   -- Print_Statistics --
+   ----------------------
+
+   procedure Print_Statistics is
+      N_Count : constant Natural := Natural (Nodes.Last - First_Node_Id + 1);
+      E_Count : Natural := 0;
+
+   begin
+      Write_Str ("Number of entities: ");
+      Write_Eol;
+
+      declare
+         function CP_Lt (Op1, Op2 : Natural) return Boolean;
+         --  Compare routine for Sort
+
+         procedure CP_Move (From : Natural; To : Natural);
+         --  Move routine for Sort
+
+         Kind_Count : array (Node_Kind) of Natural := (others => 0);
+         --  Array of occurrence count per node kind
+
+         Kind_Max : constant Natural := Node_Kind'Pos (N_Unused_At_End) - 1;
+         --  The index of the largest (interesting) node kind
+
+         Ranking : array (0 .. Kind_Max) of Node_Kind;
+         --  Ranking array for node kinds (index 0 is used for the temporary)
+
+         package Sorting is new GNAT.Heap_Sort_G (CP_Move, CP_Lt);
+
+         function CP_Lt (Op1, Op2 : Natural) return Boolean is
+         begin
+            return Kind_Count (Ranking (Op2)) < Kind_Count (Ranking (Op1));
+         end CP_Lt;
+
+         procedure CP_Move (From : Natural; To : Natural) is
+         begin
+            Ranking (To) := Ranking (From);
+         end CP_Move;
+
+      begin
+         --  Count the number of occurrences of each node kind
+
+         for I in First_Node_Id .. Nodes.Last loop
+            declare
+               Nkind : constant Node_Kind := Nodes.Table (I).Nkind;
+            begin
+               if not Nodes.Table (I).Is_Extension then
+                  Kind_Count (Nkind) := Kind_Count (Nkind) + 1;
+               end if;
+            end;
+         end loop;
+
+         --  Sort the node kinds by number of occurrences
+
+         for N in 1 .. Kind_Max loop
+            Ranking (N) := Node_Kind'Val (N);
+         end loop;
+
+         Sorting.Sort (Kind_Max);
+
+         --  Print the list in descending order
+
+         for N in 1 .. Kind_Max loop
+            declare
+               Count : constant Natural := Kind_Count (Ranking (N));
+            begin
+               if Count > 0 then
+                  Write_Str ("  ");
+                  Write_Str (Node_Kind'Image (Ranking (N)));
+                  Write_Str (": ");
+                  Write_Int (Int (Count));
+                  Write_Eol;
+
+                  E_Count := E_Count + Count;
+               end if;
+            end;
+         end loop;
+      end;
+
+      Write_Str ("Total number of entities: ");
+      Write_Int (Int (E_Count));
+      Write_Eol;
+
+      Write_Str ("Maximum number of nodes per entity: ");
+      Write_Int (Int (Num_Extension_Nodes + 1));
+      Write_Eol;
+
+      Write_Str ("Number of allocated nodes: ");
+      Write_Int (Int (N_Count));
+      Write_Eol;
+
+      Write_Str ("Ratio allocated nodes/entities: ");
+      Write_Int (Int (Long_Long_Integer (N_Count) * 100 /
+                                                 Long_Long_Integer (E_Count)));
+      Write_Str ("/100");
+      Write_Eol;
+
+      Write_Str ("Size of a node in bytes: ");
+      Write_Int (Int (Node_Record'Size) / Storage_Unit);
+      Write_Eol;
+
+      Write_Str ("Memory consumption in bytes: ");
+      Write_Int (Int (Long_Long_Integer (N_Count) *
+                                           (Node_Record'Size / Storage_Unit)));
+      Write_Eol;
+   end Print_Statistics;
+
    -------------------
    -- Relocate_Node --
    -------------------
@@ -1669,18 +2116,17 @@ package body Atree is
       New_Node := New_Copy (Source);
       Fix_Parents (Ref_Node => Source, Fix_Node => New_Node);
 
-      --  We now set the parent of the new node to be the same as the
-      --  parent of the source. Almost always this parent will be
-      --  replaced by a new value when the relocated node is reattached
-      --  to the tree, but by doing it now, we ensure that this node is
-      --  not even temporarily disconnected from the tree. Note that this
-      --  does not happen free, because in the list case, the parent does
-      --  not get set.
+      --  We now set the parent of the new node to be the same as the parent of
+      --  the source. Almost always this parent will be replaced by a new value
+      --  when the relocated node is reattached to the tree, but by doing it
+      --  now, we ensure that this node is not even temporarily disconnected
+      --  from the tree. Note that this does not happen free, because in the
+      --  list case, the parent does not get set.
 
       Set_Parent (New_Node, Parent (Source));
 
-      --  If the node being relocated was a rewriting of some original
-      --  node, then the relocated node has the same original node.
+      --  If the node being relocated was a rewriting of some original node,
+      --  then the relocated node has the same original node.
 
       if Orig_Nodes.Table (Source) /= Source then
          Orig_Nodes.Table (New_Node) := Orig_Nodes.Table (Source);
@@ -1704,6 +2150,9 @@ package body Atree is
           and not Has_Extension (New_Node)
           and not Nodes.Table (New_Node).In_List);
 
+      pragma Debug (New_Node_Debugging_Output (Old_Node));
+      pragma Debug (New_Node_Debugging_Output (New_Node));
+
       --  Do copy, preserving link and in list status and required flags
 
       Copy_Node (Source => New_Node, Destination => Old_Node);
@@ -1754,7 +2203,9 @@ package body Atree is
         (not Has_Extension (Old_Node)
           and not Has_Extension (New_Node)
           and not Nodes.Table (New_Node).In_List);
-      pragma Debug (Rewrite_Debugging_Output (Old_Node, New_Node));
+
+      pragma Debug (New_Node_Debugging_Output (Old_Node));
+      pragma Debug (New_Node_Debugging_Output (New_Node));
 
       if Nkind (Old_Node) in N_Subexpr then
          Old_Paren_Count     := Paren_Count (Old_Node);
@@ -1778,8 +2229,7 @@ package body Atree is
          --  Both the old and new copies of the node will share the same list
          --  of aspect specifications if aspect specifications are present.
 
-         if Has_Aspects (Sav_Node) then
-            Set_Has_Aspects (Sav_Node, False);
+         if Old_Has_Aspects then
             Set_Aspect_Specifications
               (Sav_Node, Aspect_Specifications (Old_Node));
          end if;
@@ -1803,37 +2253,13 @@ package body Atree is
       if Reporting_Proc /= null then
          Reporting_Proc.all (Target => Old_Node, Source => New_Node);
       end if;
-   end Rewrite;
-
-   -------------------------
-   -- Rewrite_Breakpoint --
-   -------------------------
-
-   procedure rr is
-   begin
-      Write_Str ("Watched node ");
-      Write_Int (Int (Watch_Node));
-      Write_Str (" rewritten");
-      Write_Eol;
-   end rr;
-
-   ------------------------------
-   -- Rewrite_Debugging_Output --
-   ------------------------------
-
-   procedure rrd (Old_Node, New_Node : Node_Id) is
-      Node_Is_Watched : constant Boolean := Old_Node = Watch_Node;
 
-   begin
-      if Debug_Flag_N or else Node_Is_Watched then
-         Node_Debug_Output ("Rewrite", Old_Node);
-         Node_Debug_Output ("into",    New_Node);
+      --  Invoke the rewriting procedure (if available)
 
-         if Node_Is_Watched then
-            Rewrite_Breakpoint;
-         end if;
+      if Rewriting_Proc /= null then
+         Rewriting_Proc.all (Target => Old_Node, Source => New_Node);
       end if;
-   end rrd;
+   end Rewrite;
 
    ------------------
    -- Set_Analyzed --
@@ -1841,15 +2267,27 @@ package body Atree is
 
    procedure Set_Analyzed (N : Node_Id; Val : Boolean := True) is
    begin
+      pragma Assert (not Locked);
       Nodes.Table (N).Analyzed := Val;
    end Set_Analyzed;
 
+   -----------------------
+   -- Set_Check_Actuals --
+   -----------------------
+
+   procedure Set_Check_Actuals (N : Node_Id; Val : Boolean := True) is
+   begin
+      pragma Assert (not Locked);
+      Flags.Table (N).Check_Actuals := Val;
+   end Set_Check_Actuals;
+
    ---------------------------
    -- Set_Comes_From_Source --
    ---------------------------
 
    procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean) is
    begin
+      pragma Assert (not Locked);
       pragma Assert (N <= Nodes.Last);
       Nodes.Table (N).Comes_From_Source := Val;
    end Set_Comes_From_Source;
@@ -1869,6 +2307,7 @@ package body Atree is
 
    procedure Set_Ekind (E : Entity_Id; Val : Entity_Kind) is
    begin
+      pragma Assert (not Locked);
       pragma Assert (Nkind (E) in N_Entity);
       Nodes.Table (E + 1).Nkind := E_To_N (Val);
    end Set_Ekind;
@@ -1879,6 +2318,7 @@ package body Atree is
 
    procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True) is
    begin
+      pragma Assert (not Locked);
       Nodes.Table (N).Error_Posted := Val;
    end Set_Error_Posted;
 
@@ -1888,16 +2328,28 @@ package body Atree is
 
    procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True) is
    begin
+      pragma Assert (not Locked);
       pragma Assert (N <= Nodes.Last);
       Nodes.Table (N).Has_Aspects := Val;
    end Set_Has_Aspects;
 
+   -------------------------------
+   -- Set_Is_Ignored_Ghost_Node --
+   -------------------------------
+
+   procedure Set_Is_Ignored_Ghost_Node (N : Node_Id; Val : Boolean := True) is
+   begin
+      pragma Assert (not Locked);
+      Flags.Table (N).Is_Ignored_Ghost_Node := Val;
+   end Set_Is_Ignored_Ghost_Node;
+
    -----------------------
    -- Set_Original_Node --
    -----------------------
 
    procedure Set_Original_Node (N : Node_Id; Val : Node_Id) is
    begin
+      pragma Assert (not Locked);
       Orig_Nodes.Table (N) := Val;
    end Set_Original_Node;
 
@@ -1907,6 +2359,7 @@ package body Atree is
 
    procedure Set_Paren_Count (N : Node_Id; Val : Nat) is
    begin
+      pragma Assert (not Locked);
       pragma Assert (Nkind (N) in N_Subexpr);
 
       --  Value of 0,1,2 stored as is
@@ -1938,19 +2391,41 @@ package body Atree is
 
    procedure Set_Parent (N : Node_Id; Val : Node_Id) is
    begin
+      pragma Assert (not Locked);
       pragma Assert (not Nodes.Table (N).In_List);
       Nodes.Table (N).Link := Union_Id (Val);
    end Set_Parent;
 
+   ------------------------
+   -- Set_Reporting_Proc --
+   ------------------------
+
+   procedure Set_Reporting_Proc (Proc : Report_Proc) is
+   begin
+      pragma Assert (Reporting_Proc = null);
+      Reporting_Proc := Proc;
+   end Set_Reporting_Proc;
+
    --------------
    -- Set_Sloc --
    --------------
 
    procedure Set_Sloc (N : Node_Id; Val : Source_Ptr) is
    begin
+      pragma Assert (not Locked);
       Nodes.Table (N).Sloc := Val;
    end Set_Sloc;
 
+   ------------------------
+   -- Set_Rewriting_Proc --
+   ------------------------
+
+   procedure Set_Rewriting_Proc (Proc : Rewrite_Proc) is
+   begin
+      pragma Assert (Rewriting_Proc = null);
+      Rewriting_Proc := Proc;
+   end Set_Rewriting_Proc;
+
    ----------
    -- Sloc --
    ----------
@@ -1988,11 +2463,11 @@ package body Atree is
          if Fld = Union_Id (Empty) then
             return OK;
 
-         --  Descendent is a node
+         --  Descendant is a node
 
          elsif Fld in Node_Range then
 
-            --  Traverse descendent that is syntactic subtree node
+            --  Traverse descendant that is syntactic subtree node
 
             if Is_Syntactic_Field (Nkind (Nod), FN) then
                return Traverse_Func (Node_Id (Fld));
@@ -2003,11 +2478,11 @@ package body Atree is
                return OK;
             end if;
 
-         --  Descendent is a list
+         --  Descendant is a list
 
          elsif Fld in List_Range then
 
-            --  Traverse descendent that is a syntactic subtree list
+            --  Traverse descendant that is a syntactic subtree list
 
             if Is_Syntactic_Field (Nkind (Nod), FN) then
                declare
@@ -2114,6 +2589,7 @@ package body Atree is
    begin
       Tree_Read_Int (Node_Count);
       Nodes.Tree_Read;
+      Flags.Tree_Read;
       Orig_Nodes.Tree_Read;
       Paren_Counts.Tree_Read;
    end Tree_Read;
@@ -2126,6 +2602,7 @@ package body Atree is
    begin
       Tree_Write_Int (Node_Count);
       Nodes.Tree_Write;
+      Flags.Tree_Write;
       Orig_Nodes.Tree_Write;
       Paren_Counts.Tree_Write;
    end Tree_Write;
@@ -2346,6 +2823,42 @@ package body Atree is
          return Nodes.Table (N + 5).Field11;
       end Field35;
 
+      function Field36 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field6;
+      end Field36;
+
+      function Field37 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field7;
+      end Field37;
+
+      function Field38 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field8;
+      end Field38;
+
+      function Field39 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field9;
+      end Field39;
+
+      function Field40 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field10;
+      end Field40;
+
+      function Field41 (N : Node_Id) return Union_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Nodes.Table (N + 6).Field11;
+      end Field41;
+
       function Node1 (N : Node_Id) return Node_Id is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -2538,6 +3051,60 @@ package body Atree is
          return Node_Id (Nodes.Table (N + 5).Field8);
       end Node32;
 
+      function Node33 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 5).Field9);
+      end Node33;
+
+      function Node34 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 5).Field10);
+      end Node34;
+
+      function Node35 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 5).Field11);
+      end Node35;
+
+      function Node36 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field6);
+      end Node36;
+
+      function Node37 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field7);
+      end Node37;
+
+      function Node38 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field8);
+      end Node38;
+
+      function Node39 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field9);
+      end Node39;
+
+      function Node40 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field10);
+      end Node40;
+
+      function Node41 (N : Node_Id) return Node_Id is
+      begin
+         pragma Assert (Nkind (N) in N_Entity);
+         return Node_Id (Nodes.Table (N + 6).Field11);
+      end Node41;
+
       function List1 (N : Node_Id) return List_Id is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -2586,6 +3153,16 @@ package body Atree is
          return List_Id (Nodes.Table (N + 4).Field7);
       end List25;
 
+      function List38 (N : Node_Id) return List_Id is
+      begin
+         return List_Id (Nodes.Table (N + 6).Field8);
+      end List38;
+
+      function List39 (N : Node_Id) return List_Id is
+      begin
+         return List_Id (Nodes.Table (N + 6).Field9);
+      end List39;
+
       function Elist1 (N : Node_Id) return Elist_Id is
          pragma Assert (N <= Nodes.Last);
          Value : constant Union_Id := Nodes.Table (N).Field1;
@@ -2652,6 +3229,17 @@ package body Atree is
          end if;
       end Elist8;
 
+      function Elist9 (N : Node_Id) return Elist_Id is
+         pragma Assert (Nkind (N) in N_Entity);
+         Value : constant Union_Id := Nodes.Table (N + 1).Field9;
+      begin
+         if Value = 0 then
+            return No_Elist;
+         else
+            return Elist_Id (Value);
+         end if;
+      end Elist9;
+
       function Elist10 (N : Node_Id) return Elist_Id is
          pragma Assert (Nkind (N) in N_Entity);
          Value : constant Union_Id := Nodes.Table (N + 1).Field10;
@@ -2663,6 +3251,17 @@ package body Atree is
          end if;
       end Elist10;
 
+      function Elist11 (N : Node_Id) return Elist_Id is
+         pragma Assert (Nkind (N) in N_Entity);
+         Value : constant Union_Id := Nodes.Table (N + 1).Field11;
+      begin
+         if Value = 0 then
+            return No_Elist;
+         else
+            return Elist_Id (Value);
+         end if;
+      end Elist11;
+
       function Elist13 (N : Node_Id) return Elist_Id is
          pragma Assert (Nkind (N) in N_Entity);
          Value : constant Union_Id := Nodes.Table (N + 2).Field6;
@@ -2762,6 +3361,28 @@ package body Atree is
          end if;
       end Elist26;
 
+      function Elist29 (N : Node_Id) return Elist_Id is
+         pragma Assert (Nkind (N) in N_Entity);
+         Value : constant Union_Id := Nodes.Table (N + 4).Field11;
+      begin
+         if Value = 0 then
+            return No_Elist;
+         else
+            return Elist_Id (Value);
+         end if;
+      end Elist29;
+
+      function Elist36 (N : Node_Id) return Elist_Id is
+         pragma Assert (Nkind (N) in N_Entity);
+         Value : constant Union_Id := Nodes.Table (N + 6).Field6;
+      begin
+         if Value = 0 then
+            return No_Elist;
+         else
+            return Elist_Id (Value);
+         end if;
+      end Elist36;
+
       function Name1 (N : Node_Id) return Name_Id is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -2945,6 +3566,17 @@ package body Atree is
          end if;
       end Uint22;
 
+      function Uint24 (N : Node_Id) return Uint is
+         pragma Assert (Nkind (N) in N_Entity);
+         U : constant Union_Id := Nodes.Table (N + 4).Field6;
+      begin
+         if U = 0 then
+            return Uint_0;
+         else
+            return From_Union (U);
+         end if;
+      end Uint24;
+
       function Ureal3 (N : Node_Id) return Ureal is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -2963,6 +3595,30 @@ package body Atree is
          return From_Union (Nodes.Table (N + 3).Field8);
       end Ureal21;
 
+      function Flag0 (N : Node_Id) return Boolean is
+      begin
+         pragma Assert (N <= Nodes.Last);
+         return Flags.Table (N).Flag0;
+      end Flag0;
+
+      function Flag1 (N : Node_Id) return Boolean is
+      begin
+         pragma Assert (N <= Nodes.Last);
+         return Flags.Table (N).Flag1;
+      end Flag1;
+
+      function Flag2 (N : Node_Id) return Boolean is
+      begin
+         pragma Assert (N <= Nodes.Last);
+         return Flags.Table (N).Flag2;
+      end Flag2;
+
+      function Flag3 (N : Node_Id) return Boolean is
+      begin
+         pragma Assert (N <= Nodes.Last);
+         return Flags.Table (N).Flag3;
+      end Flag3;
+
       function Flag4 (N : Node_Id) return Boolean is
       begin
          pragma Assert (N <= Nodes.Last);
@@ -4849,1045 +5505,1402 @@ package body Atree is
 
       procedure Set_Nkind (N : Node_Id; Val : Node_Kind) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Nkind := Val;
       end Set_Nkind;
 
       procedure Set_Field1 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field1 := Val;
       end Set_Field1;
 
       procedure Set_Field2 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field2 := Val;
       end Set_Field2;
 
       procedure Set_Field3 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := Val;
       end Set_Field3;
 
       procedure Set_Field4 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field4 := Val;
       end Set_Field4;
 
       procedure Set_Field5 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field5 := Val;
       end Set_Field5;
 
       procedure Set_Field6 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field6 := Val;
       end Set_Field6;
 
       procedure Set_Field7 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field7 := Val;
       end Set_Field7;
 
       procedure Set_Field8 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field8 := Val;
       end Set_Field8;
 
       procedure Set_Field9 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field9 := Val;
       end Set_Field9;
 
       procedure Set_Field10 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field10 := Val;
       end Set_Field10;
 
       procedure Set_Field11 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field11 := Val;
       end Set_Field11;
 
       procedure Set_Field12 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field12 := Val;
       end Set_Field12;
 
       procedure Set_Field13 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field6 := Val;
       end Set_Field13;
 
       procedure Set_Field14 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field7 := Val;
       end Set_Field14;
 
       procedure Set_Field15 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field8 := Val;
       end Set_Field15;
 
       procedure Set_Field16 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field9 := Val;
       end Set_Field16;
 
       procedure Set_Field17 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field10 := Val;
       end Set_Field17;
 
       procedure Set_Field18 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field11 := Val;
       end Set_Field18;
 
       procedure Set_Field19 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field6 := Val;
       end Set_Field19;
 
       procedure Set_Field20 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field7 := Val;
       end Set_Field20;
 
       procedure Set_Field21 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field8 := Val;
       end Set_Field21;
 
       procedure Set_Field22 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field9 := Val;
       end Set_Field22;
 
       procedure Set_Field23 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field10 := Val;
       end Set_Field23;
 
       procedure Set_Field24 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field6 := Val;
       end Set_Field24;
 
       procedure Set_Field25 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field7 := Val;
       end Set_Field25;
 
       procedure Set_Field26 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field8 := Val;
       end Set_Field26;
 
       procedure Set_Field27 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field9 := Val;
       end Set_Field27;
 
       procedure Set_Field28 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field10 := Val;
       end Set_Field28;
 
       procedure Set_Field29 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field11 := Val;
       end Set_Field29;
 
       procedure Set_Field30 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field6 := Val;
       end Set_Field30;
 
       procedure Set_Field31 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field7 := Val;
       end Set_Field31;
 
       procedure Set_Field32 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field8 := Val;
       end Set_Field32;
 
       procedure Set_Field33 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field9 := Val;
       end Set_Field33;
 
       procedure Set_Field34 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field10 := Val;
       end Set_Field34;
 
       procedure Set_Field35 (N : Node_Id; Val : Union_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field11 := Val;
       end Set_Field35;
 
+      procedure Set_Field36 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field6 := Val;
+      end Set_Field36;
+
+      procedure Set_Field37 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field7 := Val;
+      end Set_Field37;
+
+      procedure Set_Field38 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field8 := Val;
+      end Set_Field38;
+
+      procedure Set_Field39 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field9 := Val;
+      end Set_Field39;
+
+      procedure Set_Field40 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field10 := Val;
+      end Set_Field40;
+
+      procedure Set_Field41 (N : Node_Id; Val : Union_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field11 := Val;
+      end Set_Field41;
+
       procedure Set_Node1 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field1 := Union_Id (Val);
       end Set_Node1;
 
       procedure Set_Node2 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field2 := Union_Id (Val);
       end Set_Node2;
 
       procedure Set_Node3 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := Union_Id (Val);
       end Set_Node3;
 
       procedure Set_Node4 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field4 := Union_Id (Val);
       end Set_Node4;
 
       procedure Set_Node5 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field5 := Union_Id (Val);
       end Set_Node5;
 
       procedure Set_Node6 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field6 := Union_Id (Val);
       end Set_Node6;
 
       procedure Set_Node7 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field7 := Union_Id (Val);
       end Set_Node7;
 
       procedure Set_Node8 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field8 := Union_Id (Val);
       end Set_Node8;
 
       procedure Set_Node9 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field9 := Union_Id (Val);
       end Set_Node9;
 
       procedure Set_Node10 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field10 := Union_Id (Val);
       end Set_Node10;
 
       procedure Set_Node11 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field11 := Union_Id (Val);
       end Set_Node11;
 
       procedure Set_Node12 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field12 := Union_Id (Val);
       end Set_Node12;
 
       procedure Set_Node13 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field6 := Union_Id (Val);
       end Set_Node13;
 
       procedure Set_Node14 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field7 := Union_Id (Val);
       end Set_Node14;
 
       procedure Set_Node15 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field8 := Union_Id (Val);
       end Set_Node15;
 
       procedure Set_Node16 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field9 := Union_Id (Val);
       end Set_Node16;
 
       procedure Set_Node17 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field10 := Union_Id (Val);
       end Set_Node17;
 
       procedure Set_Node18 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field11 := Union_Id (Val);
       end Set_Node18;
 
       procedure Set_Node19 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field6 := Union_Id (Val);
       end Set_Node19;
 
       procedure Set_Node20 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field7 := Union_Id (Val);
       end Set_Node20;
 
       procedure Set_Node21 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field8 := Union_Id (Val);
       end Set_Node21;
 
       procedure Set_Node22 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field9 := Union_Id (Val);
       end Set_Node22;
 
       procedure Set_Node23 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field10 := Union_Id (Val);
       end Set_Node23;
 
       procedure Set_Node24 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field6 := Union_Id (Val);
       end Set_Node24;
 
       procedure Set_Node25 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field7 := Union_Id (Val);
       end Set_Node25;
 
       procedure Set_Node26 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field8 := Union_Id (Val);
       end Set_Node26;
 
       procedure Set_Node27 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field9 := Union_Id (Val);
       end Set_Node27;
 
       procedure Set_Node28 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field10 := Union_Id (Val);
       end Set_Node28;
 
       procedure Set_Node29 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field11 := Union_Id (Val);
       end Set_Node29;
 
       procedure Set_Node30 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field6 := Union_Id (Val);
       end Set_Node30;
 
       procedure Set_Node31 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field7 := Union_Id (Val);
       end Set_Node31;
 
       procedure Set_Node32 (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Field8 := Union_Id (Val);
       end Set_Node32;
 
+      procedure Set_Node33 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 5).Field9 := Union_Id (Val);
+      end Set_Node33;
+
+      procedure Set_Node34 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 5).Field10 := Union_Id (Val);
+      end Set_Node34;
+
+      procedure Set_Node35 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 5).Field11 := Union_Id (Val);
+      end Set_Node35;
+
+      procedure Set_Node36 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field6 := Union_Id (Val);
+      end Set_Node36;
+
+      procedure Set_Node37 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field7 := Union_Id (Val);
+      end Set_Node37;
+
+      procedure Set_Node38 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field8 := Union_Id (Val);
+      end Set_Node38;
+
+      procedure Set_Node39 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field9 := Union_Id (Val);
+      end Set_Node39;
+
+      procedure Set_Node40 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field10 := Union_Id (Val);
+      end Set_Node40;
+
+      procedure Set_Node41 (N : Node_Id; Val : Node_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field11 := Union_Id (Val);
+      end Set_Node41;
+
       procedure Set_List1 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field1 := Union_Id (Val);
       end Set_List1;
 
       procedure Set_List2 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field2 := Union_Id (Val);
       end Set_List2;
 
       procedure Set_List3 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := Union_Id (Val);
       end Set_List3;
 
       procedure Set_List4 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field4 := Union_Id (Val);
       end Set_List4;
 
       procedure Set_List5 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field5 := Union_Id (Val);
       end Set_List5;
 
       procedure Set_List10 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field10 := Union_Id (Val);
       end Set_List10;
 
       procedure Set_List14 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field7 := Union_Id (Val);
       end Set_List14;
 
       procedure Set_List25 (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field7 := Union_Id (Val);
       end Set_List25;
 
+      procedure Set_List38 (N : Node_Id; Val : List_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field8 := Union_Id (Val);
+      end Set_List38;
+
+      procedure Set_List39 (N : Node_Id; Val : List_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field9 := Union_Id (Val);
+      end Set_List39;
+
       procedure Set_Elist1 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          Nodes.Table (N).Field1 := Union_Id (Val);
       end Set_Elist1;
 
       procedure Set_Elist2 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          Nodes.Table (N).Field2 := Union_Id (Val);
       end Set_Elist2;
 
       procedure Set_Elist3 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          Nodes.Table (N).Field3 := Union_Id (Val);
       end Set_Elist3;
 
       procedure Set_Elist4 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          Nodes.Table (N).Field4 := Union_Id (Val);
       end Set_Elist4;
 
       procedure Set_Elist5 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          Nodes.Table (N).Field5 := Union_Id (Val);
       end Set_Elist5;
 
       procedure Set_Elist8 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field8 := Union_Id (Val);
       end Set_Elist8;
 
+      procedure Set_Elist9 (N : Node_Id; Val : Elist_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 1).Field9 := Union_Id (Val);
+      end Set_Elist9;
+
       procedure Set_Elist10 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field10 := Union_Id (Val);
       end Set_Elist10;
 
+      procedure Set_Elist11 (N : Node_Id; Val : Elist_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 1).Field11 := Union_Id (Val);
+      end Set_Elist11;
+
       procedure Set_Elist13 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field6 := Union_Id (Val);
       end Set_Elist13;
 
       procedure Set_Elist15 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field8 := Union_Id (Val);
       end Set_Elist15;
 
       procedure Set_Elist16 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field9 := Union_Id (Val);
       end Set_Elist16;
 
       procedure Set_Elist18 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field11 := Union_Id (Val);
       end Set_Elist18;
 
       procedure Set_Elist21 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field8 := Union_Id (Val);
       end Set_Elist21;
 
       procedure Set_Elist23 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field10 := Union_Id (Val);
       end Set_Elist23;
 
       procedure Set_Elist24 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field6 := Union_Id (Val);
       end Set_Elist24;
 
       procedure Set_Elist25 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field7 := Union_Id (Val);
       end Set_Elist25;
 
       procedure Set_Elist26 (N : Node_Id; Val : Elist_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Field8 := Union_Id (Val);
       end Set_Elist26;
 
+      procedure Set_Elist29 (N : Node_Id; Val : Elist_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 4).Field11 := Union_Id (Val);
+      end Set_Elist29;
+
+      procedure Set_Elist36 (N : Node_Id; Val : Elist_Id) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 6).Field6 := Union_Id (Val);
+      end Set_Elist36;
+
       procedure Set_Name1 (N : Node_Id; Val : Name_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field1 := Union_Id (Val);
       end Set_Name1;
 
       procedure Set_Name2 (N : Node_Id; Val : Name_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field2 := Union_Id (Val);
       end Set_Name2;
 
       procedure Set_Str3 (N : Node_Id; Val : String_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := Union_Id (Val);
       end Set_Str3;
 
       procedure Set_Uint2 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field2 := To_Union (Val);
       end Set_Uint2;
 
       procedure Set_Uint3 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := To_Union (Val);
       end Set_Uint3;
 
       procedure Set_Uint4 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field4 := To_Union (Val);
       end Set_Uint4;
 
       procedure Set_Uint5 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field5 := To_Union (Val);
       end Set_Uint5;
 
       procedure Set_Uint8 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field8 := To_Union (Val);
       end Set_Uint8;
 
       procedure Set_Uint9 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field9 := To_Union (Val);
       end Set_Uint9;
 
       procedure Set_Uint10 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field10 := To_Union (Val);
       end Set_Uint10;
 
       procedure Set_Uint11 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field11 := To_Union (Val);
       end Set_Uint11;
 
       procedure Set_Uint12 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Field12 := To_Union (Val);
       end Set_Uint12;
 
       procedure Set_Uint13 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field6 := To_Union (Val);
       end Set_Uint13;
 
       procedure Set_Uint14 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field7 := To_Union (Val);
       end Set_Uint14;
 
       procedure Set_Uint15 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field8 := To_Union (Val);
       end Set_Uint15;
 
       procedure Set_Uint16 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field9 := To_Union (Val);
       end Set_Uint16;
 
       procedure Set_Uint17 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field10 := To_Union (Val);
       end Set_Uint17;
 
       procedure Set_Uint22 (N : Node_Id; Val : Uint) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field9 := To_Union (Val);
       end Set_Uint22;
 
+      procedure Set_Uint24 (N : Node_Id; Val : Uint) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (Nkind (N) in N_Entity);
+         Nodes.Table (N + 4).Field6 := To_Union (Val);
+      end Set_Uint24;
+
       procedure Set_Ureal3 (N : Node_Id; Val : Ureal) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Field3 := To_Union (Val);
       end Set_Ureal3;
 
       procedure Set_Ureal18 (N : Node_Id; Val : Ureal) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Field11 := To_Union (Val);
       end Set_Ureal18;
 
       procedure Set_Ureal21 (N : Node_Id; Val : Ureal) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Field8 := To_Union (Val);
       end Set_Ureal21;
 
+      procedure Set_Flag0 (N : Node_Id; Val : Boolean) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (N <= Nodes.Last);
+         Flags.Table (N).Flag0 := Val;
+      end Set_Flag0;
+
+      procedure Set_Flag1 (N : Node_Id; Val : Boolean) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (N <= Nodes.Last);
+         Flags.Table (N).Flag1 := Val;
+      end Set_Flag1;
+
+      procedure Set_Flag2 (N : Node_Id; Val : Boolean) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (N <= Nodes.Last);
+         Flags.Table (N).Flag2 := Val;
+      end Set_Flag2;
+
+      procedure Set_Flag3 (N : Node_Id; Val : Boolean) is
+      begin
+         pragma Assert (not Locked);
+         pragma Assert (N <= Nodes.Last);
+         Flags.Table (N).Flag3 := Val;
+      end Set_Flag3;
+
       procedure Set_Flag4 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag4 := Val;
       end Set_Flag4;
 
       procedure Set_Flag5 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag5 := Val;
       end Set_Flag5;
 
       procedure Set_Flag6 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag6 := Val;
       end Set_Flag6;
 
       procedure Set_Flag7 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag7 := Val;
       end Set_Flag7;
 
       procedure Set_Flag8 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag8 := Val;
       end Set_Flag8;
 
       procedure Set_Flag9 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag9 := Val;
       end Set_Flag9;
 
       procedure Set_Flag10 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag10 := Val;
       end Set_Flag10;
 
       procedure Set_Flag11 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag11 := Val;
       end Set_Flag11;
 
       procedure Set_Flag12 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag12 := Val;
       end Set_Flag12;
 
       procedure Set_Flag13 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag13 := Val;
       end Set_Flag13;
 
       procedure Set_Flag14 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag14 := Val;
       end Set_Flag14;
 
       procedure Set_Flag15 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag15 := Val;
       end Set_Flag15;
 
       procedure Set_Flag16 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag16 := Val;
       end Set_Flag16;
 
       procedure Set_Flag17 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag17 := Val;
       end Set_Flag17;
 
       procedure Set_Flag18 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          Nodes.Table (N).Flag18 := Val;
       end Set_Flag18;
 
       procedure Set_Flag19 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).In_List := Val;
       end Set_Flag19;
 
       procedure Set_Flag20 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Has_Aspects := Val;
       end Set_Flag20;
 
       procedure Set_Flag21 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Rewrite_Ins := Val;
       end Set_Flag21;
 
       procedure Set_Flag22 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Analyzed := Val;
       end Set_Flag22;
 
       procedure Set_Flag23 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Comes_From_Source := Val;
       end Set_Flag23;
 
       procedure Set_Flag24 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Error_Posted := Val;
       end Set_Flag24;
 
       procedure Set_Flag25 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag4 := Val;
       end Set_Flag25;
 
       procedure Set_Flag26 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag5 := Val;
       end Set_Flag26;
 
       procedure Set_Flag27 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag6 := Val;
       end Set_Flag27;
 
       procedure Set_Flag28 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag7 := Val;
       end Set_Flag28;
 
       procedure Set_Flag29 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag8 := Val;
       end Set_Flag29;
 
       procedure Set_Flag30 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag9 := Val;
       end Set_Flag30;
 
       procedure Set_Flag31 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag10 := Val;
       end Set_Flag31;
 
       procedure Set_Flag32 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag11 := Val;
       end Set_Flag32;
 
       procedure Set_Flag33 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag12 := Val;
       end Set_Flag33;
 
       procedure Set_Flag34 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag13 := Val;
       end Set_Flag34;
 
       procedure Set_Flag35 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag14 := Val;
       end Set_Flag35;
 
       procedure Set_Flag36 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag15 := Val;
       end Set_Flag36;
 
       procedure Set_Flag37 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag16 := Val;
       end Set_Flag37;
 
       procedure Set_Flag38 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag17 := Val;
       end Set_Flag38;
 
       procedure Set_Flag39 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Flag18 := Val;
       end Set_Flag39;
 
       procedure Set_Flag40 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).In_List := Val;
       end Set_Flag40;
 
       procedure Set_Flag41 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Has_Aspects := Val;
       end Set_Flag41;
 
       procedure Set_Flag42 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Rewrite_Ins := Val;
       end Set_Flag42;
 
       procedure Set_Flag43 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Analyzed := Val;
       end Set_Flag43;
 
       procedure Set_Flag44 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Comes_From_Source := Val;
       end Set_Flag44;
 
       procedure Set_Flag45 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Error_Posted := Val;
       end Set_Flag45;
 
       procedure Set_Flag46 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag4 := Val;
       end Set_Flag46;
 
       procedure Set_Flag47 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag5 := Val;
       end Set_Flag47;
 
       procedure Set_Flag48 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag6 := Val;
       end Set_Flag48;
 
       procedure Set_Flag49 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag7 := Val;
       end Set_Flag49;
 
       procedure Set_Flag50 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag8 := Val;
       end Set_Flag50;
 
       procedure Set_Flag51 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag9 := Val;
       end Set_Flag51;
 
       procedure Set_Flag52 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag10 := Val;
       end Set_Flag52;
 
       procedure Set_Flag53 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag11 := Val;
       end Set_Flag53;
 
       procedure Set_Flag54 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag12 := Val;
       end Set_Flag54;
 
       procedure Set_Flag55 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag13 := Val;
       end Set_Flag55;
 
       procedure Set_Flag56 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag14 := Val;
       end Set_Flag56;
 
       procedure Set_Flag57 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag15 := Val;
       end Set_Flag57;
 
       procedure Set_Flag58 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag16 := Val;
       end Set_Flag58;
 
       procedure Set_Flag59 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag17 := Val;
       end Set_Flag59;
 
       procedure Set_Flag60 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Flag18 := Val;
       end Set_Flag60;
 
       procedure Set_Flag61 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Pflag1 := Val;
       end Set_Flag61;
 
       procedure Set_Flag62 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 1).Pflag2 := Val;
       end Set_Flag62;
 
       procedure Set_Flag63 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Pflag1 := Val;
       end Set_Flag63;
 
       procedure Set_Flag64 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 2).Pflag2 := Val;
       end Set_Flag64;
 
       procedure Set_Flag65 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5896,6 +6909,7 @@ package body Atree is
 
       procedure Set_Flag66 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5904,6 +6918,7 @@ package body Atree is
 
       procedure Set_Flag67 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5912,6 +6927,7 @@ package body Atree is
 
       procedure Set_Flag68 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5920,6 +6936,7 @@ package body Atree is
 
       procedure Set_Flag69 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5928,6 +6945,7 @@ package body Atree is
 
       procedure Set_Flag70 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5936,6 +6954,7 @@ package body Atree is
 
       procedure Set_Flag71 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5944,6 +6963,7 @@ package body Atree is
 
       procedure Set_Flag72 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte_Ptr
            (Node_Kind_Ptr'
@@ -5952,6 +6972,7 @@ package body Atree is
 
       procedure Set_Flag73 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -5960,6 +6981,7 @@ package body Atree is
 
       procedure Set_Flag74 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -5968,6 +6990,7 @@ package body Atree is
 
       procedure Set_Flag75 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -5976,6 +6999,7 @@ package body Atree is
 
       procedure Set_Flag76 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -5984,6 +7008,7 @@ package body Atree is
 
       procedure Set_Flag77 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -5992,6 +7017,7 @@ package body Atree is
 
       procedure Set_Flag78 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6000,6 +7026,7 @@ package body Atree is
 
       procedure Set_Flag79 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6008,6 +7035,7 @@ package body Atree is
 
       procedure Set_Flag80 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6016,6 +7044,7 @@ package body Atree is
 
       procedure Set_Flag81 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6024,6 +7053,7 @@ package body Atree is
 
       procedure Set_Flag82 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6032,6 +7062,7 @@ package body Atree is
 
       procedure Set_Flag83 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6040,6 +7071,7 @@ package body Atree is
 
       procedure Set_Flag84 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6048,6 +7080,7 @@ package body Atree is
 
       procedure Set_Flag85 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6056,6 +7089,7 @@ package body Atree is
 
       procedure Set_Flag86 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6064,6 +7098,7 @@ package body Atree is
 
       procedure Set_Flag87 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6072,6 +7107,7 @@ package body Atree is
 
       procedure Set_Flag88 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6080,6 +7116,7 @@ package body Atree is
 
       procedure Set_Flag89 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6088,6 +7125,7 @@ package body Atree is
 
       procedure Set_Flag90 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6096,6 +7134,7 @@ package body Atree is
 
       procedure Set_Flag91 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6104,6 +7143,7 @@ package body Atree is
 
       procedure Set_Flag92 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6112,6 +7152,7 @@ package body Atree is
 
       procedure Set_Flag93 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6120,6 +7161,7 @@ package body Atree is
 
       procedure Set_Flag94 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6128,6 +7170,7 @@ package body Atree is
 
       procedure Set_Flag95 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6136,6 +7179,7 @@ package body Atree is
 
       procedure Set_Flag96 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word_Ptr
            (Union_Id_Ptr'
@@ -6144,6 +7188,7 @@ package body Atree is
 
       procedure Set_Flag97 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6152,6 +7197,7 @@ package body Atree is
 
       procedure Set_Flag98 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6160,6 +7206,7 @@ package body Atree is
 
       procedure Set_Flag99 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6168,6 +7215,7 @@ package body Atree is
 
       procedure Set_Flag100 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6176,6 +7224,7 @@ package body Atree is
 
       procedure Set_Flag101 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6184,6 +7233,7 @@ package body Atree is
 
       procedure Set_Flag102 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6192,6 +7242,7 @@ package body Atree is
 
       procedure Set_Flag103 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6200,6 +7251,7 @@ package body Atree is
 
       procedure Set_Flag104 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6208,6 +7260,7 @@ package body Atree is
 
       procedure Set_Flag105 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6216,6 +7269,7 @@ package body Atree is
 
       procedure Set_Flag106 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6224,6 +7278,7 @@ package body Atree is
 
       procedure Set_Flag107 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6232,6 +7287,7 @@ package body Atree is
 
       procedure Set_Flag108 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6240,6 +7296,7 @@ package body Atree is
 
       procedure Set_Flag109 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6248,6 +7305,7 @@ package body Atree is
 
       procedure Set_Flag110 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6256,6 +7314,7 @@ package body Atree is
 
       procedure Set_Flag111 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6264,6 +7323,7 @@ package body Atree is
 
       procedure Set_Flag112 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6272,6 +7332,7 @@ package body Atree is
 
       procedure Set_Flag113 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6280,6 +7341,7 @@ package body Atree is
 
       procedure Set_Flag114 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6288,6 +7350,7 @@ package body Atree is
 
       procedure Set_Flag115 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6296,6 +7359,7 @@ package body Atree is
 
       procedure Set_Flag116 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6304,6 +7368,7 @@ package body Atree is
 
       procedure Set_Flag117 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6312,6 +7377,7 @@ package body Atree is
 
       procedure Set_Flag118 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6320,6 +7386,7 @@ package body Atree is
 
       procedure Set_Flag119 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6328,6 +7395,7 @@ package body Atree is
 
       procedure Set_Flag120 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6336,6 +7404,7 @@ package body Atree is
 
       procedure Set_Flag121 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6344,6 +7413,7 @@ package body Atree is
 
       procedure Set_Flag122 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6352,6 +7422,7 @@ package body Atree is
 
       procedure Set_Flag123 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6360,6 +7431,7 @@ package body Atree is
 
       procedure Set_Flag124 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6368,6 +7440,7 @@ package body Atree is
 
       procedure Set_Flag125 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6376,6 +7449,7 @@ package body Atree is
 
       procedure Set_Flag126 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6384,6 +7458,7 @@ package body Atree is
 
       procedure Set_Flag127 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6392,6 +7467,7 @@ package body Atree is
 
       procedure Set_Flag128 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word2_Ptr
            (Union_Id_Ptr'
@@ -6400,144 +7476,168 @@ package body Atree is
 
       procedure Set_Flag129 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).In_List := Val;
       end Set_Flag129;
 
       procedure Set_Flag130 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Has_Aspects := Val;
       end Set_Flag130;
 
       procedure Set_Flag131 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Rewrite_Ins := Val;
       end Set_Flag131;
 
       procedure Set_Flag132 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Analyzed := Val;
       end Set_Flag132;
 
       procedure Set_Flag133 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Comes_From_Source := Val;
       end Set_Flag133;
 
       procedure Set_Flag134 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Error_Posted := Val;
       end Set_Flag134;
 
       procedure Set_Flag135 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag4 := Val;
       end Set_Flag135;
 
       procedure Set_Flag136 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag5 := Val;
       end Set_Flag136;
 
       procedure Set_Flag137 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag6 := Val;
       end Set_Flag137;
 
       procedure Set_Flag138 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag7 := Val;
       end Set_Flag138;
 
       procedure Set_Flag139 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag8 := Val;
       end Set_Flag139;
 
       procedure Set_Flag140 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag9 := Val;
       end Set_Flag140;
 
       procedure Set_Flag141 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag10 := Val;
       end Set_Flag141;
 
       procedure Set_Flag142 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag11 := Val;
       end Set_Flag142;
 
       procedure Set_Flag143 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag12 := Val;
       end Set_Flag143;
 
       procedure Set_Flag144 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag13 := Val;
       end Set_Flag144;
 
       procedure Set_Flag145 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag14 := Val;
       end Set_Flag145;
 
       procedure Set_Flag146 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag15 := Val;
       end Set_Flag146;
 
       procedure Set_Flag147 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag16 := Val;
       end Set_Flag147;
 
       procedure Set_Flag148 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag17 := Val;
       end Set_Flag148;
 
       procedure Set_Flag149 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Flag18 := Val;
       end Set_Flag149;
 
       procedure Set_Flag150 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Pflag1 := Val;
       end Set_Flag150;
 
       procedure Set_Flag151 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 3).Pflag2 := Val;
       end Set_Flag151;
 
       procedure Set_Flag152 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6546,6 +7646,7 @@ package body Atree is
 
       procedure Set_Flag153 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6554,6 +7655,7 @@ package body Atree is
 
       procedure Set_Flag154 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6562,6 +7664,7 @@ package body Atree is
 
       procedure Set_Flag155 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6570,6 +7673,7 @@ package body Atree is
 
       procedure Set_Flag156 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6578,6 +7682,7 @@ package body Atree is
 
       procedure Set_Flag157 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6586,6 +7691,7 @@ package body Atree is
 
       procedure Set_Flag158 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6594,6 +7700,7 @@ package body Atree is
 
       procedure Set_Flag159 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6602,6 +7709,7 @@ package body Atree is
 
       procedure Set_Flag160 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6610,6 +7718,7 @@ package body Atree is
 
       procedure Set_Flag161 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6618,6 +7727,7 @@ package body Atree is
 
       procedure Set_Flag162 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6626,6 +7736,7 @@ package body Atree is
 
       procedure Set_Flag163 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6634,6 +7745,7 @@ package body Atree is
 
       procedure Set_Flag164 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6642,6 +7754,7 @@ package body Atree is
 
       procedure Set_Flag165 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6650,6 +7763,7 @@ package body Atree is
 
       procedure Set_Flag166 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6658,6 +7772,7 @@ package body Atree is
 
       procedure Set_Flag167 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6666,6 +7781,7 @@ package body Atree is
 
       procedure Set_Flag168 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6674,6 +7790,7 @@ package body Atree is
 
       procedure Set_Flag169 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6682,6 +7799,7 @@ package body Atree is
 
       procedure Set_Flag170 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6690,6 +7808,7 @@ package body Atree is
 
       procedure Set_Flag171 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6698,6 +7817,7 @@ package body Atree is
 
       procedure Set_Flag172 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6706,6 +7826,7 @@ package body Atree is
 
       procedure Set_Flag173 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6714,6 +7835,7 @@ package body Atree is
 
       procedure Set_Flag174 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6722,6 +7844,7 @@ package body Atree is
 
       procedure Set_Flag175 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6730,6 +7853,7 @@ package body Atree is
 
       procedure Set_Flag176 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6738,6 +7862,7 @@ package body Atree is
 
       procedure Set_Flag177 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6746,6 +7871,7 @@ package body Atree is
 
       procedure Set_Flag178 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6754,6 +7880,7 @@ package body Atree is
 
       procedure Set_Flag179 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6762,6 +7889,7 @@ package body Atree is
 
       procedure Set_Flag180 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6770,6 +7898,7 @@ package body Atree is
 
       procedure Set_Flag181 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6778,6 +7907,7 @@ package body Atree is
 
       procedure Set_Flag182 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6786,6 +7916,7 @@ package body Atree is
 
       procedure Set_Flag183 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word3_Ptr
            (Union_Id_Ptr'
@@ -6794,6 +7925,7 @@ package body Atree is
 
       procedure Set_Flag184 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6802,6 +7934,7 @@ package body Atree is
 
       procedure Set_Flag185 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6810,6 +7943,7 @@ package body Atree is
 
       procedure Set_Flag186 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6818,6 +7952,7 @@ package body Atree is
 
       procedure Set_Flag187 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6826,6 +7961,7 @@ package body Atree is
 
       procedure Set_Flag188 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6834,6 +7970,7 @@ package body Atree is
 
       procedure Set_Flag189 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6842,6 +7979,7 @@ package body Atree is
 
       procedure Set_Flag190 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6850,6 +7988,7 @@ package body Atree is
 
       procedure Set_Flag191 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6858,6 +7997,7 @@ package body Atree is
 
       procedure Set_Flag192 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6866,6 +8006,7 @@ package body Atree is
 
       procedure Set_Flag193 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6874,6 +8015,7 @@ package body Atree is
 
       procedure Set_Flag194 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6882,6 +8024,7 @@ package body Atree is
 
       procedure Set_Flag195 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6890,6 +8033,7 @@ package body Atree is
 
       procedure Set_Flag196 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6898,6 +8042,7 @@ package body Atree is
 
       procedure Set_Flag197 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6906,6 +8051,7 @@ package body Atree is
 
       procedure Set_Flag198 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6914,6 +8060,7 @@ package body Atree is
 
       procedure Set_Flag199 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6922,6 +8069,7 @@ package body Atree is
 
       procedure Set_Flag200 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6930,6 +8078,7 @@ package body Atree is
 
       procedure Set_Flag201 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6938,6 +8087,7 @@ package body Atree is
 
       procedure Set_Flag202 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6946,6 +8096,7 @@ package body Atree is
 
       procedure Set_Flag203 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6954,6 +8105,7 @@ package body Atree is
 
       procedure Set_Flag204 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6962,6 +8114,7 @@ package body Atree is
 
       procedure Set_Flag205 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6970,6 +8123,7 @@ package body Atree is
 
       procedure Set_Flag206 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6978,6 +8132,7 @@ package body Atree is
 
       procedure Set_Flag207 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6986,6 +8141,7 @@ package body Atree is
 
       procedure Set_Flag208 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -6994,6 +8150,7 @@ package body Atree is
 
       procedure Set_Flag209 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7002,6 +8159,7 @@ package body Atree is
 
       procedure Set_Flag210 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7010,6 +8168,7 @@ package body Atree is
 
       procedure Set_Flag211 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7018,6 +8177,7 @@ package body Atree is
 
       procedure Set_Flag212 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7026,6 +8186,7 @@ package body Atree is
 
       procedure Set_Flag213 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7034,6 +8195,7 @@ package body Atree is
 
       procedure Set_Flag214 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7042,6 +8204,7 @@ package body Atree is
 
       procedure Set_Flag215 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word4_Ptr
            (Union_Id_Ptr'
@@ -7050,144 +8213,168 @@ package body Atree is
 
       procedure Set_Flag216 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).In_List := Val;
       end Set_Flag216;
 
       procedure Set_Flag217 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Has_Aspects := Val;
       end Set_Flag217;
 
       procedure Set_Flag218 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Rewrite_Ins := Val;
       end Set_Flag218;
 
       procedure Set_Flag219 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Analyzed := Val;
       end Set_Flag219;
 
       procedure Set_Flag220 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Comes_From_Source := Val;
       end Set_Flag220;
 
       procedure Set_Flag221 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Error_Posted := Val;
       end Set_Flag221;
 
       procedure Set_Flag222 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag4 := Val;
       end Set_Flag222;
 
       procedure Set_Flag223 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag5 := Val;
       end Set_Flag223;
 
       procedure Set_Flag224 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag6 := Val;
       end Set_Flag224;
 
       procedure Set_Flag225 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag7 := Val;
       end Set_Flag225;
 
       procedure Set_Flag226 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag8 := Val;
       end Set_Flag226;
 
       procedure Set_Flag227 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag9 := Val;
       end Set_Flag227;
 
       procedure Set_Flag228 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag10 := Val;
       end Set_Flag228;
 
       procedure Set_Flag229 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag11 := Val;
       end Set_Flag229;
 
       procedure Set_Flag230 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag12 := Val;
       end Set_Flag230;
 
       procedure Set_Flag231 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag13 := Val;
       end Set_Flag231;
 
       procedure Set_Flag232 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag14 := Val;
       end Set_Flag232;
 
       procedure Set_Flag233 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag15 := Val;
       end Set_Flag233;
 
       procedure Set_Flag234 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag16 := Val;
       end Set_Flag234;
 
       procedure Set_Flag235 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag17 := Val;
       end Set_Flag235;
 
       procedure Set_Flag236 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Flag18 := Val;
       end Set_Flag236;
 
       procedure Set_Flag237 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Pflag1 := Val;
       end Set_Flag237;
 
       procedure Set_Flag238 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 4).Pflag2 := Val;
       end Set_Flag238;
 
       procedure Set_Flag239 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7196,6 +8383,7 @@ package body Atree is
 
       procedure Set_Flag240 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7204,6 +8392,7 @@ package body Atree is
 
       procedure Set_Flag241 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7212,6 +8401,7 @@ package body Atree is
 
       procedure Set_Flag242 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7220,6 +8410,7 @@ package body Atree is
 
       procedure Set_Flag243 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7228,6 +8419,7 @@ package body Atree is
 
       procedure Set_Flag244 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7236,6 +8428,7 @@ package body Atree is
 
       procedure Set_Flag245 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7244,6 +8437,7 @@ package body Atree is
 
       procedure Set_Flag246 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte2_Ptr
            (Node_Kind_Ptr'
@@ -7252,6 +8446,7 @@ package body Atree is
 
       procedure Set_Flag247 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7260,6 +8455,7 @@ package body Atree is
 
       procedure Set_Flag248 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7268,6 +8464,7 @@ package body Atree is
 
       procedure Set_Flag249 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7276,6 +8473,7 @@ package body Atree is
 
       procedure Set_Flag250 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7284,6 +8482,7 @@ package body Atree is
 
       procedure Set_Flag251 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7292,6 +8491,7 @@ package body Atree is
 
       procedure Set_Flag252 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7300,6 +8500,7 @@ package body Atree is
 
       procedure Set_Flag253 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7308,6 +8509,7 @@ package body Atree is
 
       procedure Set_Flag254 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte3_Ptr
            (Node_Kind_Ptr'
@@ -7316,6 +8518,7 @@ package body Atree is
 
       procedure Set_Flag255 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7324,6 +8527,7 @@ package body Atree is
 
       procedure Set_Flag256 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7332,6 +8536,7 @@ package body Atree is
 
       procedure Set_Flag257 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7340,6 +8545,7 @@ package body Atree is
 
       procedure Set_Flag258 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7348,6 +8554,7 @@ package body Atree is
 
       procedure Set_Flag259 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7356,6 +8563,7 @@ package body Atree is
 
       procedure Set_Flag260 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7364,6 +8572,7 @@ package body Atree is
 
       procedure Set_Flag261 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7372,6 +8581,7 @@ package body Atree is
 
       procedure Set_Flag262 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7380,6 +8590,7 @@ package body Atree is
 
       procedure Set_Flag263 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7388,6 +8599,7 @@ package body Atree is
 
       procedure Set_Flag264 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7396,6 +8608,7 @@ package body Atree is
 
       procedure Set_Flag265 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7404,6 +8617,7 @@ package body Atree is
 
       procedure Set_Flag266 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7412,6 +8626,7 @@ package body Atree is
 
       procedure Set_Flag267 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7420,6 +8635,7 @@ package body Atree is
 
       procedure Set_Flag268 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7428,6 +8644,7 @@ package body Atree is
 
       procedure Set_Flag269 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7436,6 +8653,7 @@ package body Atree is
 
       procedure Set_Flag270 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7444,6 +8662,7 @@ package body Atree is
 
       procedure Set_Flag271 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7452,6 +8671,7 @@ package body Atree is
 
       procedure Set_Flag272 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7460,6 +8680,7 @@ package body Atree is
 
       procedure Set_Flag273 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7468,6 +8689,7 @@ package body Atree is
 
       procedure Set_Flag274 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7476,6 +8698,7 @@ package body Atree is
 
       procedure Set_Flag275 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7484,6 +8707,7 @@ package body Atree is
 
       procedure Set_Flag276 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7492,6 +8716,7 @@ package body Atree is
 
       procedure Set_Flag277 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7500,6 +8725,7 @@ package body Atree is
 
       procedure Set_Flag278 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7508,6 +8734,7 @@ package body Atree is
 
       procedure Set_Flag279 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7516,6 +8743,7 @@ package body Atree is
 
       procedure Set_Flag280 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7524,6 +8752,7 @@ package body Atree is
 
       procedure Set_Flag281 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7532,6 +8761,7 @@ package body Atree is
 
       procedure Set_Flag282 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7540,6 +8770,7 @@ package body Atree is
 
       procedure Set_Flag283 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7548,6 +8779,7 @@ package body Atree is
 
       procedure Set_Flag284 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7556,6 +8788,7 @@ package body Atree is
 
       procedure Set_Flag285 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7564,6 +8797,7 @@ package body Atree is
 
       procedure Set_Flag286 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Word5_Ptr
            (Union_Id_Ptr'
@@ -7572,144 +8806,168 @@ package body Atree is
 
       procedure Set_Flag287 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).In_List := Val;
       end Set_Flag287;
 
       procedure Set_Flag288 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Has_Aspects := Val;
       end Set_Flag288;
 
       procedure Set_Flag289 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Rewrite_Ins := Val;
       end Set_Flag289;
 
       procedure Set_Flag290 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Analyzed := Val;
       end Set_Flag290;
 
       procedure Set_Flag291 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Comes_From_Source := Val;
       end Set_Flag291;
 
       procedure Set_Flag292 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Error_Posted := Val;
       end Set_Flag292;
 
       procedure Set_Flag293 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag4 := Val;
       end Set_Flag293;
 
       procedure Set_Flag294 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag5 := Val;
       end Set_Flag294;
 
       procedure Set_Flag295 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag6 := Val;
       end Set_Flag295;
 
       procedure Set_Flag296 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag7 := Val;
       end Set_Flag296;
 
       procedure Set_Flag297 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag8 := Val;
       end Set_Flag297;
 
       procedure Set_Flag298 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag9 := Val;
       end Set_Flag298;
 
       procedure Set_Flag299 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag10 := Val;
       end Set_Flag299;
 
       procedure Set_Flag300 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag11 := Val;
       end Set_Flag300;
 
       procedure Set_Flag301 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag12 := Val;
       end Set_Flag301;
 
       procedure Set_Flag302 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag13 := Val;
       end Set_Flag302;
 
       procedure Set_Flag303 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag14 := Val;
       end Set_Flag303;
 
       procedure Set_Flag304 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag15 := Val;
       end Set_Flag304;
 
       procedure Set_Flag305 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag16 := Val;
       end Set_Flag305;
 
       procedure Set_Flag306 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag17 := Val;
       end Set_Flag306;
 
       procedure Set_Flag307 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Flag18 := Val;
       end Set_Flag307;
 
       procedure Set_Flag308 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Pflag1 := Val;
       end Set_Flag308;
 
       procedure Set_Flag309 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          Nodes.Table (N + 5).Pflag2 := Val;
       end Set_Flag309;
 
       procedure Set_Flag310 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7718,6 +8976,7 @@ package body Atree is
 
       procedure Set_Flag311 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7726,6 +8985,7 @@ package body Atree is
 
       procedure Set_Flag312 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7734,6 +8994,7 @@ package body Atree is
 
       procedure Set_Flag313 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7742,6 +9003,7 @@ package body Atree is
 
       procedure Set_Flag314 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7750,6 +9012,7 @@ package body Atree is
 
       procedure Set_Flag315 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7758,6 +9021,7 @@ package body Atree is
 
       procedure Set_Flag316 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7766,6 +9030,7 @@ package body Atree is
 
       procedure Set_Flag317 (N : Node_Id; Val : Boolean) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (Nkind (N) in N_Entity);
          To_Flag_Byte4_Ptr
            (Node_Kind_Ptr'
@@ -7774,6 +9039,7 @@ package body Atree is
 
       procedure Set_Node1_With_Parent (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
 
          if Val > Error then
@@ -7785,6 +9051,7 @@ package body Atree is
 
       procedure Set_Node2_With_Parent (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
 
          if Val > Error then
@@ -7796,6 +9063,7 @@ package body Atree is
 
       procedure Set_Node3_With_Parent (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
 
          if Val > Error then
@@ -7807,6 +9075,7 @@ package body Atree is
 
       procedure Set_Node4_With_Parent (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
 
          if Val > Error then
@@ -7818,6 +9087,7 @@ package body Atree is
 
       procedure Set_Node5_With_Parent (N : Node_Id; Val : Node_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
 
          if Val > Error then
@@ -7829,6 +9099,7 @@ package body Atree is
 
       procedure Set_List1_With_Parent (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          if Val /= No_List and then Val /= Error_List then
             Set_Parent (Val, N);
@@ -7838,6 +9109,7 @@ package body Atree is
 
       procedure Set_List2_With_Parent (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          if Val /= No_List and then Val /= Error_List then
             Set_Parent (Val, N);
@@ -7847,6 +9119,7 @@ package body Atree is
 
       procedure Set_List3_With_Parent (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          if Val /= No_List and then Val /= Error_List then
             Set_Parent (Val, N);
@@ -7856,6 +9129,7 @@ package body Atree is
 
       procedure Set_List4_With_Parent (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          if Val /= No_List and then Val /= Error_List then
             Set_Parent (Val, N);
@@ -7865,6 +9139,7 @@ package body Atree is
 
       procedure Set_List5_With_Parent (N : Node_Id; Val : List_Id) is
       begin
+         pragma Assert (not Locked);
          pragma Assert (N <= Nodes.Last);
          if Val /= No_List and then Val /= Error_List then
             Set_Parent (Val, N);
@@ -7881,7 +9156,18 @@ package body Atree is
    procedure Unlock is
    begin
       Nodes.Locked := False;
+      Flags.Locked := False;
       Orig_Nodes.Locked := False;
    end Unlock;
 
+   ------------------
+   -- Unlock_Nodes --
+   ------------------
+
+   procedure Unlock_Nodes is
+   begin
+      pragma Assert (Locked);
+      Locked := False;
+   end Unlock_Nodes;
+
 end Atree;