summaryrefslogtreecommitdiff
path: root/gcc/ada/repinfo.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/repinfo.adb')
-rw-r--r--gcc/ada/repinfo.adb37
1 files changed, 35 insertions, 2 deletions
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index 362d1d8cead..3f3f488e1c7 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -1054,6 +1054,39 @@ package body Repinfo is
Write_Str ("'Alignment use ");
Write_Val (Alignment (Ent));
Write_Line (";");
+
+ -- Special stuff for fixed-point
+
+ if Is_Fixed_Point_Type (Ent) then
+
+ -- Write small (always a static constant)
+
+ Write_Str ("for ");
+ List_Name (Ent);
+ Write_Str ("'Small use ");
+ UR_Write (Small_Value (Ent));
+ Write_Line (";");
+
+ -- Write range if static
+
+ declare
+ R : constant Node_Id := Scalar_Range (Ent);
+
+ begin
+ if Nkind (Low_Bound (R)) = N_Real_Literal
+ and then
+ Nkind (High_Bound (R)) = N_Real_Literal
+ then
+ Write_Str ("for ");
+ List_Name (Ent);
+ Write_Str ("'Range use ");
+ UR_Write (Realval (Low_Bound (R)));
+ Write_Str (" .. ");
+ UR_Write (Realval (High_Bound (R)));
+ Write_Line (";");
+ end if;
+ end;
+ end if;
end List_Type_Info;
----------------------
@@ -1087,8 +1120,8 @@ package body Repinfo is
-- Internal recursive routine to evaluate tree
function W (Val : Uint) return Word;
- -- Convert Val to Word, assuming Val is always in the Int range. This is
- -- a helper function for the evaluation of bitwise expressions like
+ -- Convert Val to Word, assuming Val is always in the Int range. This
+ -- is a helper function for the evaluation of bitwise expressions like
-- Bit_And_Expr, for which there is no direct support in uintp. Uint
-- values out of the Int range are expected to be seen in such
-- expressions only with overflowing byte sizes around, introducing