-- --
-- S p e c --
-- --
--- $Revision: 1.14 $
--- --
--- Copyright (C) 1992-2000, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
+-- --
+-- You should have received a copy of the GNU General Public License along --
+-- with this program; see file COPYING3. If not see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- These have a delayed freeze. Gigi will generate code to evaluate
-- the initialization expression if present and store it in a temp.
-- The actual object is created at the point of the freeze, and if
- -- neccessary initialized by copying the value of this temporary.
+ -- necessary initialized by copying the value of this temporary.
-- Formal Parameters
--
-- base types, where the freeze node is preallocated at the point of
-- declaration, so that the First_Subtype_Link field can be set.
+ Freezing_Library_Level_Tagged_Type : Boolean := False;
+ -- Flag used to indicate that we are freezing the primitives of a library
+ -- level tagged types. Used to disable checks on premature freezing.
+ -- More documentation needed??? why is this flag needed? what are these
+ -- checks? why do they need disabling in some cases?
+
-----------------
-- Subprograms --
-----------------
function Build_Renamed_Body
(Decl : Node_Id;
- New_S : Entity_Id)
- return Node_Id;
+ New_S : Entity_Id) return Node_Id;
-- Rewrite renaming declaration as a subprogram body, whose single
-- statement is a call to the renamed entity. New_S is the entity that
-- appears in the renaming declaration. If this is a Renaming_As_Body,
-- do not allow a size clause if the size would not otherwise be known at
-- compile time in any case.
+ function Is_Atomic_Aggregate
+ (E : Entity_Id;
+ Typ : Entity_Id) return Boolean;
+
+ -- If an atomic object is initialized with an aggregate or is assigned
+ -- an aggregate, we have to prevent a piecemeal access or assignment
+ -- to the object, even if the aggregate is to be expanded. We create
+ -- a temporary for the aggregate, and assign the temporary instead,
+ -- so that the back end can generate an atomic move for it. This is
+ -- only done in the context of an object declaration or an assignment.
+ -- Function is a noop and returns false in other contexts.
+
function Freeze_Entity (E : Entity_Id; Loc : Source_Ptr) return List_Id;
-- Freeze an entity, and return Freeze nodes, to be inserted at the
-- point of call. Loc is a source location which corresponds to the
-- frozen entities.
procedure Freeze_Before (N : Node_Id; T : Entity_Id);
- -- Freeze T then Insert the generated Freeze nodes before the node N.
+ -- Freeze T then Insert the generated Freeze nodes before the node N
procedure Freeze_Expression (N : Node_Id);
-- Freezes the required entities when the Expression N causes freezing.
-- so need to be similarly treated. Freeze_Expression takes care of
-- determining the proper insertion point for generated freeze actions.
+ procedure Freeze_Fixed_Point_Type (Typ : Entity_Id);
+ -- Freeze fixed point type. For fixed-point types, we have to defer
+ -- setting the size and bounds till the freeze point, since they are
+ -- potentially affected by the presence of size and small clauses.
+
procedure Freeze_Itype (T : Entity_Id; N : Node_Id);
-- This routine is called when an Itype is created and must be frozen
-- immediately at the point of creation (for the sake of the expansion