aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 18:22:58 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 18:22:58 +0200
commit5087048c12395ee380b8040e9ecf399b64e1cf66 (patch)
treea9a02f49a226ae852a959602d7df85ceb26d807b /gcc/ada/sem_attr.adb
parent50b2e859965b43c6537acabd9a4e882204c89b42 (diff)
downloadgcc-5087048c12395ee380b8040e9ecf399b64e1cf66.zip
gcc-5087048c12395ee380b8040e9ecf399b64e1cf66.tar.gz
gcc-5087048c12395ee380b8040e9ecf399b64e1cf66.tar.bz2
[multiple changes]
2010-06-22 Thomas Quinot <quinot@adacore.com> * exp_aggr.adb (Rewrite_Discriminant): Fix predicate used to identify reference to discriminant (can be an expanded name as well as an identifier). 2010-06-22 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb: Clarify comment. 2010-06-22 Geert Bosch <bosch@adacore.com> * exp_imgv.adb (Expand_Image_Attribute): Treat ordinary fixed point with decimal small as decimal types, avoiding floating-point arithmetic. (Has_Decimal_Small): New function. * einfo.ads, einfo.adb (Aft_Value): New synthesized attributed for fixed point types. * sem_attr.adb (Eval_Attribute): Remove Aft_Value function and update callers to call the new function in Einfo that takes the entity as parameter. From-SVN: r161200
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb28
1 files changed, 3 insertions, 25 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 2efd558..1b9fcf3 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -4805,10 +4805,6 @@ package body Sem_Attr is
-- processing, since otherwise gigi might see an attribute which it is
-- unprepared to deal with.
- function Aft_Value return Nat;
- -- Computes Aft value for current attribute prefix (used by Aft itself
- -- and also by Width for computing the Width of a fixed point type).
-
procedure Check_Concurrent_Discriminant (Bound : Node_Id);
-- If Bound is a reference to a discriminant of a task or protected type
-- occurring within the object's body, rewrite attribute reference into
@@ -4880,25 +4876,6 @@ package body Sem_Attr is
-- Verify that the prefix of a potentially static array attribute
-- satisfies the conditions of 4.9 (14).
- ---------------
- -- Aft_Value --
- ---------------
-
- function Aft_Value return Nat is
- Result : Nat;
- Delta_Val : Ureal;
-
- begin
- Result := 1;
- Delta_Val := Delta_Value (P_Type);
- while Delta_Val < Ureal_Tenth loop
- Delta_Val := Delta_Val * Ureal_10;
- Result := Result + 1;
- end loop;
-
- return Result;
- end Aft_Value;
-
-----------------------------------
-- Check_Concurrent_Discriminant --
-----------------------------------
@@ -5786,7 +5763,7 @@ package body Sem_Attr is
---------
when Attribute_Aft =>
- Fold_Uint (N, UI_From_Int (Aft_Value), True);
+ Fold_Uint (N, Aft_Value (P_Type), True);
---------------
-- Alignment --
@@ -7364,7 +7341,8 @@ package body Sem_Attr is
-- For fixed-point type width is Fore + 1 + Aft (RM 3.5(34))
Fold_Uint
- (N, UI_From_Int (Fore_Value + 1 + Aft_Value), True);
+ (N, UI_From_Int (Fore_Value + 1) + Aft_Value (P_Type),
+ True);
end if;
-- Discrete types