summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-06 10:53:58 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-06 10:53:58 +0000
commitd964f2aa92920319e5ea812cecbdefa1632dbc8d (patch)
treeca430b765206683111d5a1c7faa156f19e0bd6c6 /gcc/ada/sem_attr.adb
parent7aa072313ac5db140b028fd9b05f73f3e9350f0f (diff)
downloadgcc-d964f2aa92920319e5ea812cecbdefa1632dbc8d.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178585 138bc75d-0d04-0410-961f-82ee72b054a4
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 789cb4763d4..9b33acddef3 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 --
------------