aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-06 12:53:58 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-06 12:53:58 +0200
commit203ddceaeda20a6d1de0a283873d64f4fb3a5cef (patch)
treeca430b765206683111d5a1c7faa156f19e0bd6c6 /gcc/ada/sem_attr.adb
parent32dba5ef786a92d5d041594106995f8ffd2bda34 (diff)
downloadgcc-203ddceaeda20a6d1de0a283873d64f4fb3a5cef.zip
gcc-203ddceaeda20a6d1de0a283873d64f4fb3a5cef.tar.gz
gcc-203ddceaeda20a6d1de0a283873d64f4fb3a5cef.tar.bz2
[multiple changes]
2011-09-06 Robert Dewar <dewar@adacore.com> * s-tpopsp-vxworks.adb, prj-nmsc.adb: Minor reformatting. 2011-09-06 Hristian Kirtchev <kirtchev@adacore.com> * gcc-interface/trans.c (Attribute_to_gnu): New case for attribute Descriptor_Size. * exp_attr.adb (Expand_N_Attribute_Reference): Add processing for attribute Descriptor_Size. * exp_ch7.adb (Double_Size_Of): Removed. (Make_Finalize_Address_Stmts): Remove the code which generates an expression to calculate the dope vector of an unconstrained array. Instead use attribute Descriptor_Size and leave the calculation to the back end. (Nearest_Multiple_Rounded_Up): Removed. (Size_Of): Removed. * sem_attr.adb (Analyze_Attribute): Add processing for attribute Descriptor_Size. Currently the attribute is applicable only to unconstrained arrays. (Eval_Attribute): Add processing for attribute Descriptor_Size. * snames.ads-tmpl: Add a predefined name and an Attribute_Id for Descriptor_Size. 2011-09-06 Ed Schonberg <schonberg@adacore.com> * exp_aggr.adb: Remove useless formal. From-SVN: r178585
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 789cb47..9b33acd 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -3014,6 +3014,28 @@ package body Sem_Attr is
Check_Floating_Point_Type_0;
Set_Etype (N, Standard_Boolean);
+ ---------------------
+ -- Descriptor_Size --
+ ---------------------
+
+ when Attribute_Descriptor_Size =>
+ Check_E0;
+
+ -- Attribute Descriptor_Size is relevant only in the context of an
+ -- unconstrained array type.
+
+ if Is_Entity_Name (P)
+ and then Is_Type (Entity (P))
+ and then Is_Array_Type (Entity (P))
+ and then not Is_Constrained (Entity (P))
+ then
+ null;
+ else
+ Error_Attr_P ("invalid prefix for % attribute");
+ end if;
+
+ Set_Etype (N, Universal_Integer);
+
------------
-- Digits --
------------
@@ -6246,6 +6268,13 @@ package body Sem_Attr is
Fold_Uint
(N, UI_From_Int (Boolean'Pos (Denorm_On_Target)), True);
+ ---------------------
+ -- Descriptor_Size --
+ ---------------------
+
+ when Attribute_Descriptor_Size =>
+ null;
+
------------
-- Digits --
------------