Commit 86cde7b1 by Robert Dewar Committed by Arnaud Charlet

exp_util.ads, [...]: This patch replaces a number of occurrences of explicit…

exp_util.ads, [...]: This patch replaces a number of occurrences of explicit tests for N_Null with...

2007-08-14  Robert Dewar  <dewar@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>
	    Javier Miranda  <miranda@adacore.com>

	* exp_util.ads, exp_util.adb: 
	This patch replaces a number of occurrences of explicit tests for N_Null
	with calls to Known_Null. This improves tracking of null values, since
	Known_Null also catches null constants, and variables currently known to
	be null, so we get better tracking.
	(Ensure_Defined): create an itype reference only in the scope of the
	itype.
	(Side_Effect_Free): A selected component of an access type that
	denotes a component with a rep clause must be treated as not
	side-effect free, because if it is part of a linked structure its
	value may be affected by a renaming.
	(Expand_Subtype_From_Expr): For limited objects initialized with build
	in place function calls, do nothing; otherwise we prematurely introduce
	an N_Reference node in the expression initializing the object, which
	breaks the circuitry that detects and adds the additional arguments to
	the called function. Bug found working in the new patch for statically
	allocated dispatch tables.
	(Is_Library_Level_Tagged_Type): New subprogram.
	(Remove_Side_Effects): If the expression of an elementary type is an
	operator treat as a function call.
	(Make_Literal_Range): If the index type of the array is not integer, use
	attributes properly to compute the constraint on the resulting aggregate
	which is a string.

	* freeze.ads, freeze.adb (Freeze_Entity): If the entity is a
	class-wide type whose base type is an incomplete private type, leave
	class-wide type unfrozen so that freeze nodes can be generated
	properly at a later point.
	(Freeze_Entity, array case): Handle case of pragma Pack and component
	size attributre clause for same array.

From-SVN: r127419
parent b2e1beb3
......@@ -438,6 +438,10 @@ package Exp_Util is
-- False otherwise. True for an empty list. It is an error to call this
-- routine with No_List as the argument.
function Is_Library_Level_Tagged_Type (Typ : Entity_Id) return Boolean;
-- Return True if Typ is a library level tagged type. Currently we use
-- this information to build statically allocated dispatch tables.
function Is_Predefined_Dispatching_Operation (E : Entity_Id) return Boolean;
-- Ada 2005 (AI-251): Determines if E is a predefined primitive operation
......@@ -628,7 +632,7 @@ package Exp_Util is
-- control to escape doing the undefer call.
private
pragma Inline (Force_Evaluation);
pragma Inline (Duplicate_Subexpr);
pragma Inline (Force_Evaluation);
pragma Inline (Is_Library_Level_Tagged_Type);
end Exp_Util;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2007, 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- --
......@@ -121,6 +121,12 @@ package Freeze is
-- 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 --
-----------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment