Commit bf7c85c9 by Robert Dewar Committed by Arnaud Charlet

sem_util.ads: Minor reformatting

2005-03-29  Robert Dewar  <dewar@adacore.com>

	* sem_util.ads: Minor reformatting
	* gnat_rm.texi: Minor editing.

From-SVN: r97190
parent 74a20253
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
@c o @c o
@c G N A T _ RM o @c G N A T _ RM o
@c o @c o
@c Copyright (C) 1995-2004 Free Software Foundation o @c Copyright (C) 1995-2005 Free Software Foundation o
@c o @c o
@c o @c o
@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o @c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
...@@ -5156,24 +5156,18 @@ representation item for a given entity if each non-static expression in ...@@ -5156,24 +5156,18 @@ representation item for a given entity if each non-static expression in
the representation item is a name that statically denotes a constant the representation item is a name that statically denotes a constant
declared before the entity. declared before the entity.
@end cartouche @end cartouche
Followed. GNAT does not support non-static expressions in representation Followed. In fact, GNAT goes beyond the recommended level of support
clauses unless they are constants declared before the entity. For by allowing nonstatic expressions in some representation clauses even
example: without the need to declare constants initialized with the values of
such expressions.
For example:
@smallexample @c ada @smallexample @c ada
X : Some_Type; X : Integer;
for X'Address use To_address (16#2000#); Y : Float;
for Y'Address use X'Address;>>
@end smallexample @end smallexample
@noindent
will be rejected, since the To_Address expression is non-static. Instead
write:
@smallexample @c ada
X_Address : constant Address : = To_Address (16#2000#);
X : Some_Type;
for X'Address use X_Address;
@end smallexample
@sp 1 @sp 1
@cartouche @cartouche
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -391,7 +391,7 @@ package Sem_Util is ...@@ -391,7 +391,7 @@ package Sem_Util is
-- to check if '=' has to be expanded into a bunch component comparaisons. -- to check if '=' has to be expanded into a bunch component comparaisons.
function In_Instance return Boolean; function In_Instance return Boolean;
-- Returns True if the current scope is within a generic instance. -- Returns True if the current scope is within a generic instance
function In_Instance_Body return Boolean; function In_Instance_Body return Boolean;
-- Returns True if current scope is within the body of an instance, where -- Returns True if current scope is within the body of an instance, where
...@@ -436,7 +436,7 @@ package Sem_Util is ...@@ -436,7 +436,7 @@ package Sem_Util is
-- synthesized attribute. -- synthesized attribute.
function Is_Actual_Parameter (N : Node_Id) return Boolean; function Is_Actual_Parameter (N : Node_Id) return Boolean;
-- Determines if N is an actual parameter in a subprogram call. -- Determines if N is an actual parameter in a subprogram call
function Is_Aliased_View (Obj : Node_Id) return Boolean; function Is_Aliased_View (Obj : Node_Id) return Boolean;
-- Determine if Obj is an aliased view, i.e. the name of an -- Determine if Obj is an aliased view, i.e. the name of an
...@@ -542,7 +542,7 @@ package Sem_Util is ...@@ -542,7 +542,7 @@ package Sem_Util is
-- Return True if E is a remote access-to-class-wide-limited_private type -- Return True if E is a remote access-to-class-wide-limited_private type
function Is_Remote_Access_To_Subprogram_Type (E : Entity_Id) return Boolean; function Is_Remote_Access_To_Subprogram_Type (E : Entity_Id) return Boolean;
-- Return True if E is a remote access to subprogram type. -- Return True if E is a remote access to subprogram type
function Is_Remote_Call (N : Node_Id) return Boolean; function Is_Remote_Call (N : Node_Id) return Boolean;
-- Return True if N denotes a potentially remote call -- Return True if N denotes a potentially remote call
...@@ -642,7 +642,7 @@ package Sem_Util is ...@@ -642,7 +642,7 @@ package Sem_Util is
-- the call order, so this does not correspond to simply taking the -- the call order, so this does not correspond to simply taking the
-- next entry of the Parameter_Associations list. The argument is an -- next entry of the Parameter_Associations list. The argument is an
-- actual previously returned by a call to First_Actual or Next_Actual. -- actual previously returned by a call to First_Actual or Next_Actual.
-- Note tha the result produced is always an expression, not a parameter -- Note that the result produced is always an expression, not a parameter
-- assciation node, even if named notation was used. -- assciation node, even if named notation was used.
procedure Normalize_Actuals procedure Normalize_Actuals
...@@ -783,15 +783,14 @@ package Sem_Util is ...@@ -783,15 +783,14 @@ package Sem_Util is
-- Set the flag Is_Transient of the current scope -- Set the flag Is_Transient of the current scope
procedure Set_Size_Info (T1, T2 : Entity_Id); procedure Set_Size_Info (T1, T2 : Entity_Id);
-- Copies the Esize field and Has_Biased_Representation flag from -- Copies the Esize field and Has_Biased_Representation flag from sub(type)
-- (sub)type entity T2 to (sub)type entity T1. Also copies the -- entity T2 to (sub)type entity T1. Also copies the Is_Unsigned_Type flag
-- Is_Unsigned_Type flag in the fixed-point and discrete cases, -- in the fixed-point and discrete cases, and also copies the alignment
-- and also copies the alignment value from T2 to T1. It does NOT -- value from T2 to T1. It does NOT copy the RM_Size field, which must be
-- copy the RM_Size field, which must be separately set if this -- separately set if this is required to be copied also.
-- is required to be copied also.
function Scope_Is_Transient return Boolean; function Scope_Is_Transient return Boolean;
-- True if the current scope is transient. -- True if the current scope is transient
function Static_Integer (N : Node_Id) return Uint; function Static_Integer (N : Node_Id) return Uint;
-- This function analyzes the given expression node and then resolves it -- This function analyzes the given expression node and then resolves it
...@@ -804,10 +803,10 @@ package Sem_Util is ...@@ -804,10 +803,10 @@ package Sem_Util is
-- E1 and E2 refer to different objects -- E1 and E2 refer to different objects
function Subprogram_Access_Level (Subp : Entity_Id) return Uint; function Subprogram_Access_Level (Subp : Entity_Id) return Uint;
-- Return the accessibility level of the view denoted by Subp. -- Return the accessibility level of the view denoted by Subp
procedure Trace_Scope (N : Node_Id; E : Entity_Id; Msg : String); procedure Trace_Scope (N : Node_Id; E : Entity_Id; Msg : String);
-- Print debugging information on entry to each unit being analyzed. -- Print debugging information on entry to each unit being analyzed
procedure Transfer_Entities (From : Entity_Id; To : Entity_Id); procedure Transfer_Entities (From : Entity_Id; To : Entity_Id);
-- Move a list of entities from one scope to another, and recompute -- Move a list of entities from one scope to another, and recompute
...@@ -817,14 +816,14 @@ package Sem_Util is ...@@ -817,14 +816,14 @@ package Sem_Util is
-- Return the accessibility level of Typ -- Return the accessibility level of Typ
function Unit_Declaration_Node (Unit_Id : Entity_Id) return Node_Id; function Unit_Declaration_Node (Unit_Id : Entity_Id) return Node_Id;
-- Unit_Id is the simple name of a program unit, this function returns -- Unit_Id is the simple name of a program unit, this function returns the
-- the corresponding xxx_Declaration node for the entity. Also applies -- corresponding xxx_Declaration node for the entity. Also applies to the
-- to the body entities for subprograms, tasks and protected units, in -- body entities for subprograms, tasks and protected units, in which case
-- which case it returns the subprogram, task or protected body node -- it returns the subprogram, task or protected body node for it. The unit
-- for it. The unit may be a child unit with any number of ancestors. -- may be a child unit with any number of ancestors.
function Universal_Interpretation (Opnd : Node_Id) return Entity_Id; function Universal_Interpretation (Opnd : Node_Id) return Entity_Id;
-- Yields universal_Integer or Universal_Real if this is a candidate. -- Yields universal_Integer or Universal_Real if this is a candidate
function Within_Init_Proc return Boolean; function Within_Init_Proc return Boolean;
-- Determines if Current_Scope is within an init proc -- Determines if Current_Scope is within an init proc
......
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