Commit 442ade9d by Robert Dewar Committed by Arnaud Charlet

sem_attr.ads, [...] (Analyze_Attribute, case Value): For enumeration type, mark…

sem_attr.ads, [...] (Analyze_Attribute, case Value): For enumeration type, mark all literals as referenced.

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

	* sem_attr.ads, sem_attr.adb (Analyze_Attribute, case Value): For
	enumeration type, mark all literals as referenced.
	(Eval_Attribute, case 'Image): If the argument is an enumeration
	literal and names are available, constant-fold but mark nevertheless as
	non-static.
	Clean up function names.
	(Name_Modifies_Prefix): Rename to Name_Implies_Lvalue_Prefix. Clarify
	comment.
	(Requires_Simple_Name_Prefix): Removed.

From-SVN: r127425
parent 852ab9d0
...@@ -542,18 +542,16 @@ package Sem_Attr is ...@@ -542,18 +542,16 @@ package Sem_Attr is
-- in appropriate contexts (i.e. in subtype marks, or as prefixes for -- in appropriate contexts (i.e. in subtype marks, or as prefixes for
-- other attributes). -- other attributes).
function Name_Modifies_Prefix (Nam : Name_Id) return Boolean; function Name_Implies_Lvalue_Prefix (Nam : Name_Id) return Boolean;
-- Determine whether the name of an attribute reference modifies the -- Determine whether the name of an attribute reference categorizes its
-- contents of its prefix. "Read" is such an attribute. -- prefix as an lvalue. The following attributes fall under this bracket
-- by directly or indirectly modifying their prefixes.
function Requires_Simple_Name_Prefix (Nam : Name_Id) return Boolean; -- Access
-- Determine whether the name of an attribute reference requires a simple -- Address
-- name rather than a value as its prefix. Such prefixes do not need to be -- Input
-- optimized. For instance in the following example: -- Read
-- I : constant Integer := 5; -- Unchecked_Access
-- S : constant Integer := I'Size; -- Unrestricted_Access
-- "Size" requires a simple name prefix since "5'Size" does not make
-- sense.
procedure Resolve_Attribute (N : Node_Id; Typ : Entity_Id); procedure Resolve_Attribute (N : Node_Id; Typ : Entity_Id);
-- Performs type resolution of attribute. If the attribute yields a -- Performs type resolution of attribute. If the attribute yields a
......
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