summaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-17 06:40:45 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-17 06:40:45 +0000
commit7a41db5b2e39bcfbf513612fbe4f23891f474f07 (patch)
tree5ecbd6f1520903984be7143b54d55a2e4673f85a /gcc/ada/sinfo.ads
parent443bdccbfd72aca4e18fa2d59455d0abf4c1e1a6 (diff)
downloadgcc-7a41db5b2e39bcfbf513612fbe4f23891f474f07.tar.gz
2014-07-17 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Improve documentation of Unrestricted_Access. * sinfo.ads: Document restriction on aggregates (must expand to assignments if one or more assignments needs expansion, e.g. for controlled types). * sem_ch13.adb: All warning messages regarding bit order should be info: messages. * gnat_ugn.texi: Minor correction of missing @ on @code 2014-07-17 Robert Dewar <dewar@adacore.com> * restrict.ads (Implementation_Restriction): Add No_Long_Long_Integer. * s-rident.ads (Partition_Boolean_Restrictions): Add No_Long_Long_Integer. * sem_ch3.adb (Modular_Type_Declaration): Size must be <= Long_Integer'Size if restriction No_Long_Long_Integer is active. (Signed_Integer_Type_Declaration): Do not allow Long_Long_Integer as the implicit base type for a signed integer type declaration if restriction No_Long_Long_Integer is active. * sem_util.ads, sem_util.adb (Set_Entity_With_Checks): Include check for No_Long_Long_Integer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212727 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r--gcc/ada/sinfo.ads27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 4c282132abd..4bb9d4f34fe 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -3627,6 +3627,16 @@ package Sinfo is
-- references a subprogram that is a renaming, then the front end must
-- rewrite the attribute to refer directly to the renamed entity.
+ -- Note: syntactically the prefix of an attribute reference must be a
+ -- name, and this (somewhat artificial) requirement is enforced by the
+ -- parser. However, for many attributes, such as 'Valid, it is quite
+ -- reasonable to apply the attribute to any value, and hence to any
+ -- expression. Internally in the tree, the prefix is an expression which
+ -- does not have to be a name, and this is handled fine by the semantic
+ -- analysis and expansion, and back ends. This arises for the case of
+ -- attribute references built by the expander (e.g. 'Valid for the case
+ -- of an implicit validity check).
+
-- Note: In generated code, the Address and Unrestricted_Access
-- attributes can be applied to any expression, and the meaning is
-- to create an object containing the value (the object is in the
@@ -3638,7 +3648,7 @@ package Sinfo is
-- N_Attribute_Reference
-- Sloc points to apostrophe
- -- Prefix (Node3)
+ -- Prefix (Node3) (general expression, see note above)
-- Attribute_Name (Name2) identifier name from attribute designator
-- Expressions (List1) (set to No_List if no associated expressions)
-- Entity (Node4-Sem) used if the attribute yields a type
@@ -3731,11 +3741,18 @@ package Sinfo is
-- are not met, then the front end must translate the aggregate into
-- an appropriate set of assignments into a temporary.
- -- Note: for the record aggregate case, gigi/gcc can handle all cases of
- -- record aggregates, including those for packed, and rep-claused
+ -- Note: for the record aggregate case, gigi/gcc can handle most cases
+ -- of record aggregates, including those for packed, and rep-claused
-- records, and also variant records, providing that there are no
- -- variable length fields whose size is not known at compile time, and
- -- providing that the aggregate is presented in fully named form.
+ -- variable length fields whose size is not known at compile time,
+ -- and providing that the aggregate is presented in fully named form.
+
+ -- The other situation in which array aggregates and record aggregates
+ -- cannot be passed to the back end is if assignment to one or more
+ -- components itself needs expansion, e.g. in the case of an assignment
+ -- of an object of a controlled type. In such cases, the front end
+ -- must expand the aggregate to a series of assignments, and apply
+ -- the required expansion to the individual assignment statements.
----------------------------------------------
-- 4.3.1 Record Component Association List --