+2011-11-04 Matthew Heaney <heaney@adacore.com>
+
+ * a-cdlili.ad[sb], a-cidlli.ad[sb], a-coorse.ad[sb], a-ciorse.ad[sb],
+ a-coorma.ad[sb], a-ciorma.ad[sb], a-coormu.ad[sb], a-ciormu.ad[sb],
+ a-cohama.ad[sb], a-cihama.ad[sb], a-cohase.ad[sb], a-cihase.ad[sb],
+ a-convec.ad[sb], a-coinve.ad[sb] (Assign, Copy): New operations
+ added to package.
+
+2011-11-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch12.adb: Minor reformatting
+
+2011-11-04 Gary Dismukes <dismukes@adacore.com>
+
+ * bindgen.adb (Gen_Elab_Calls): In the case of the AAMP target,
+ initialize elaboration entities to zero when specs are processed.
+
2011-10-28 Iain Sandoe <iains@gcc.gnu.org>
Eric Botcazou <ebotcazou@adacore.com>
Insert (Container, No_Element, New_Item, Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out List; Source : List) is
+ Node : Node_Access;
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ Node := Source.First;
+ while Node /= null loop
+ Target.Append (Node.Element);
+ Node := Node.Next;
+ end loop;
+ end Assign;
+
-----------
-- Clear --
-----------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : List) return List is
+ begin
+ return Target : List do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out List; Source : List);
+
+ function Copy (Source : List) return List;
+
procedure Move
(Target : in out List;
Source : in out List);
Insert (Container, No_Element, New_Item, Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out List; Source : List) is
+ Node : Node_Access;
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ Node := Source.First;
+ while Node /= null loop
+ Target.Append (Node.Element.all);
+ Node := Node.Next;
+ end loop;
+ end Assign;
+
-----------
-- Clear --
-----------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : List) return List is
+ begin
+ return Target : List do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out List; Source : List);
+
+ function Copy (Source : List) return List;
+
procedure Move
(Target : in out List;
Source : in out List);
with Ada.Unchecked_Deallocation;
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Hashed_Maps is
procedure Free_Key is
HT_Ops.Adjust (Container.HT);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is new HT_Ops.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key.all, New_Item => Node.Element.all);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ if Target.Capacity < Source.Length then
+ Target.Reserve_Capacity (Source.Length);
+ end if;
+
+ Insert_Items (Target.HT);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Map;
+ Capacity : Count_Type := 0) return Map
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Map do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
Free_Element (X);
end Assign;
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Set;
+ Capacity : Count_Type := 0) return Set
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Set do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
Position : Cursor)
return Constant_Reference_Type;
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
with Ada.Containers.Red_Black_Trees.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Maps is
pragma Suppress (All_Checks);
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is
+ new Tree_Operations.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key.all, New_Item => Node.Element.all);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Insert_Items (Target.Tree);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Map) return Map is
+ begin
+ return Target : Map do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
Process : not null access procedure (Key : Key_Type;
Element : in out Element_Type));
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
procedure Insert
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Multisets is
-----------------------------
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
-- change the value of the element while Process is executing (to "tamper
-- with elements") will raise Program_Error.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- If Target denotes the same object as Source, the operation does
-- nothing. If either Target or Source is busy (cursor tampering is
with Ada.Unchecked_Deallocation;
+with System; use type System.Address;
+
package body Ada.Containers.Indefinite_Ordered_Sets is
type Iterator is new
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
procedure Insert
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
with Ada.Containers.Hash_Tables.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Hashed_Maps is
type Iterator is new
HT_Ops.Adjust (Container.HT);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is new HT_Ops.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key, New_Item => Node.Element);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+
+ if Target.Capacity < Source.Length then
+ Target.Reserve_Capacity (Source.Length);
+ end if;
+
+ Insert_Items (Target.HT);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Map;
+ Capacity : Count_Type := 0) return Map
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Map do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
Node.Element := Item;
end Assign;
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Set;
+ Capacity : Count_Type := 0) return Set
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Set do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- Calls Process with the element (having only a constant view) of the node
-- designed by the cursor.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set; Capacity : Count_Type := 0) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Vector; Source : Vector) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Append (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find_Index (Container, Item) /= No_Index;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Vector;
+ Capacity : Count_Type := 0) return Vector
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Vector do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type));
+ procedure Assign (Target : in out Vector; Source : Vector);
+
+ function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector;
+
procedure Move (Target : in out Vector; Source : in out Vector);
procedure Insert
Count);
end Append;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Vector; Source : Vector) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Append (Source);
+ end Assign;
+
--------------
-- Capacity --
--------------
return Find_Index (Container, Item) /= No_Index;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy
+ (Source : Vector;
+ Capacity : Count_Type := 0) return Vector
+ is
+ C : Count_Type;
+
+ begin
+ if Capacity = 0 then
+ C := Source.Length;
+
+ elsif Capacity >= Source.Length then
+ C := Capacity;
+
+ else
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
+
+ return Target : Vector do
+ Target.Reserve_Capacity (C);
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
------------
-- Delete --
------------
function Reference (Container : Vector; Position : Index_Type)
return Reference_Type;
+ procedure Assign (Target : in out Vector; Source : Vector);
+
+ function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector;
+
procedure Move (Target : in out Vector; Source : in out Vector);
+
procedure Insert
(Container : in out Vector;
Before : Extended_Index;
with Ada.Containers.Red_Black_Trees.Generic_Keys;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Maps is
type Iterator is new
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Map; Source : Map) is
+ procedure Insert_Item (Node : Node_Access);
+ pragma Inline (Insert_Item);
+
+ procedure Insert_Items is
+ new Tree_Operations.Generic_Iteration (Insert_Item);
+
+ -----------------
+ -- Insert_Item --
+ -----------------
+
+ procedure Insert_Item (Node : Node_Access) is
+ begin
+ Target.Insert (Key => Node.Key, New_Item => Node.Element);
+ end Insert_Item;
+
+ -- Start of processing for Assign
+
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Insert_Items (Target.Tree);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Key) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Map) return Map is
+ begin
+ return Target : Map do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
Process : not null access
procedure (Key : Key_Type; Element : in out Element_Type));
+ procedure Assign (Target : in out Map; Source : Map);
+
+ function Copy (Source : Map) return Map;
+
procedure Move (Target : in out Map; Source : in out Map);
procedure Insert
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Multisets is
-----------------------------
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2011, 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- --
-- change the value of the element while Process is executing (to "tamper
-- with elements") will raise Program_Error.
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
-- If Target denotes the same object as Source, the operation does
-- nothing. If either Target or Source is busy (cursor tampering is
with Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations);
+with System; use type System.Address;
+
package body Ada.Containers.Ordered_Sets is
type Iterator is new
Adjust (Container.Tree);
end Adjust;
+ ------------
+ -- Assign --
+ ------------
+
+ procedure Assign (Target : in out Set; Source : Set) is
+ begin
+ if Target'Address = Source'Address then
+ return;
+ end if;
+
+ Target.Clear;
+ Target.Union (Source);
+ end Assign;
+
-------------
-- Ceiling --
-------------
return Find (Container, Item) /= No_Element;
end Contains;
+ ----------
+ -- Copy --
+ ----------
+
+ function Copy (Source : Set) return Set is
+ begin
+ return Target : Set do
+ Target.Assign (Source);
+ end return;
+ end Copy;
+
---------------
-- Copy_Node --
---------------
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
+ procedure Assign (Target : in out Set; Source : Set);
+
+ function Copy (Source : Set) return Set;
+
procedure Move (Target : in out Set; Source : in out Set);
procedure Insert
or else U.Unit_Kind /= 's')
then
- -- The only case in which we have to do something is if this
- -- is a body, with a separate spec, where the separate spec
- -- has an elaboration entity defined. In that case, this is
+ -- In the case of a body with a separate spec, where the
+ -- separate spec has an elaboration entity defined, this is
-- where we increment the elaboration entity.
if U.Utype = Is_Body
Set_Unit_Number (Unum_Spec);
Set_String (" + 1;");
Write_Statement_Buffer;
+
+ -- In the special case where the target is AAMP and the unit is
+ -- a spec with a body, the elaboration entity is initialized
+ -- here. This is done because it's the only way to accomplish
+ -- initialization of such entities, because there's not any
+ -- mechanism provided to initialize global variables at load
+ -- time on AAMP. (Also note that there is no notion of shared
+ -- libraries for AAMP, so no possibility of reelaboration.)
+
+ elsif AAMP_On_Target
+ and then U.Utype = Is_Spec
+ and then Units.Table (Unum_Spec).Set_Elab_Entity
+ then
+ Set_String (" E");
+ Set_Unit_Number (Unum_Spec);
+ Set_String (" := 0;");
+ Write_Statement_Buffer;
end if;
-- Here if elaboration code is present. If binding a library
-- variables, only calls to 'Elab* subprograms.
else
+ -- In the special case where the target is AAMP and the unit is
+ -- a spec with a body, the elaboration entity is initialized
+ -- here. This is done because it's the only way to accomplish
+ -- initialization of such entities, because there's not any
+ -- mechanism provided to initialize global variables at load
+ -- time on AAMP. (Also note that there is no notion of shared
+ -- libraries for AAMP, so no possibility of reelaboration.)
+
+ if AAMP_On_Target
+ and then U.Utype = Is_Spec
+ and then Units.Table (Unum_Spec).Set_Elab_Entity
+ then
+ Set_String (" E");
+ Set_Unit_Number (Unum_Spec);
+ Set_String (" := 0;");
+ Write_Statement_Buffer;
+ end if;
+
Check_Elab_Flag :=
not CodePeer_Mode
and then (Force_Checking_Of_Elaboration_Flags
Scop := Scope (Scop);
end loop;
- if Scop = Par_I then
-
- -- Previous instance encloses current instance
+ -- Previous instance encloses current instance
+ if Scop = Par_I then
null;
- elsif Is_Generic_Instance (Scop) then
-
- -- Current instance is within an unrelated instance
+ -- Current instance is within an unrelated instance
+ elsif Is_Generic_Instance (Scop) then
null;
else