aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2020-03-18 17:17:58 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-12 04:29:09 -0400
commit5fdf7945d9286999d413f1a7232479575ac51bb6 (patch)
tree171e4e0c70699514e5aa01490835cb4770a5ab70 /gcc/ada
parent90e975175757b4ac9712d90d27ec59cd09f22cc9 (diff)
downloadgcc-5fdf7945d9286999d413f1a7232479575ac51bb6.zip
gcc-5fdf7945d9286999d413f1a7232479575ac51bb6.tar.gz
gcc-5fdf7945d9286999d413f1a7232479575ac51bb6.tar.bz2
[Ada] Ada2020: update Big_Numbers.* specs
2020-06-12 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads, libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb, libgnat/a-nbnbre.ads: Update Put_Image, and uncomment the aspect specification. Add pragmas Ada_2020. * libgnat/a-stouut.ads, libgnat/a-stteou.ads: Add Preelaborate, because the Big_Numbers packages have Preelaborate, and now depend on these Text_Output packages.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/libgnat/a-nbnbin.adb13
-rw-r--r--gcc/ada/libgnat/a-nbnbin.ads14
-rw-r--r--gcc/ada/libgnat/a-nbnbin__gmp.adb13
-rw-r--r--gcc/ada/libgnat/a-nbnbre.adb13
-rw-r--r--gcc/ada/libgnat/a-nbnbre.ads15
-rw-r--r--gcc/ada/libgnat/a-stouut.ads2
-rw-r--r--gcc/ada/libgnat/a-stteou.ads2
7 files changed, 41 insertions, 31 deletions
diff --git a/gcc/ada/libgnat/a-nbnbin.adb b/gcc/ada/libgnat/a-nbnbin.adb
index 637e5fb..fa4ddf0 100644
--- a/gcc/ada/libgnat/a-nbnbin.adb
+++ b/gcc/ada/libgnat/a-nbnbin.adb
@@ -29,8 +29,10 @@
-- --
------------------------------------------------------------------------------
+pragma Ada_2020;
+
with Ada.Unchecked_Deallocation;
-with Ada.Characters.Conversions; use Ada.Characters.Conversions;
+with Ada.Strings.Text_Output.Utils;
with Interfaces; use Interfaces;
@@ -290,11 +292,12 @@ package body Ada.Numerics.Big_Numbers.Big_Integers is
-- Put_Image --
---------------
- procedure Put_Image
- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
- Arg : Big_Integer) is
+ procedure Put_Image (S : in out Sink'Class; V : Big_Integer) is
+ -- This is implemented in terms of To_String. It might be more elegant
+ -- and more efficient to do it the other way around, but this is the
+ -- most expedient implementation for now.
begin
- Wide_Wide_String'Write (Stream, To_Wide_Wide_String (To_String (Arg)));
+ Strings.Text_Output.Utils.Put_UTF_8 (S, To_String (V));
end Put_Image;
---------
diff --git a/gcc/ada/libgnat/a-nbnbin.ads b/gcc/ada/libgnat/a-nbnbin.ads
index 7d1d048..45a7b6e 100644
--- a/gcc/ada/libgnat/a-nbnbin.ads
+++ b/gcc/ada/libgnat/a-nbnbin.ads
@@ -13,7 +13,9 @@
-- --
------------------------------------------------------------------------------
-with Ada.Streams;
+pragma Ada_2020;
+
+with Ada.Strings.Text_Output; use Ada.Strings.Text_Output;
private with Ada.Finalization;
private with System;
@@ -24,9 +26,9 @@ private with System;
package Ada.Numerics.Big_Numbers.Big_Integers
with Preelaborate
is
- type Big_Integer is private;
- -- with Integer_Literal => From_String,
- -- Put_Image => Put_Image;
+ type Big_Integer is private with
+ -- Integer_Literal => From_String,
+ Put_Image => Put_Image;
function Is_Valid (Arg : Big_Integer) return Boolean
with Convention => Intrinsic;
@@ -95,9 +97,7 @@ is
function From_String (Arg : String) return Big_Integer;
- procedure Put_Image
- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
- Arg : Big_Integer);
+ procedure Put_Image (S : in out Sink'Class; V : Big_Integer);
function "+" (L : Big_Integer) return Big_Integer;
diff --git a/gcc/ada/libgnat/a-nbnbin__gmp.adb b/gcc/ada/libgnat/a-nbnbin__gmp.adb
index 5695bc1..c950389 100644
--- a/gcc/ada/libgnat/a-nbnbin__gmp.adb
+++ b/gcc/ada/libgnat/a-nbnbin__gmp.adb
@@ -31,11 +31,13 @@
-- This is the GMP version of this package
+pragma Ada_2020;
+
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Ada.Characters.Conversions; use Ada.Characters.Conversions;
+with Ada.Strings.Text_Output.Utils;
with Ada.Characters.Handling; use Ada.Characters.Handling;
package body Ada.Numerics.Big_Numbers.Big_Integers is
@@ -403,11 +405,12 @@ package body Ada.Numerics.Big_Numbers.Big_Integers is
-- Put_Image --
---------------
- procedure Put_Image
- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
- Arg : Big_Integer) is
+ procedure Put_Image (S : in out Sink'Class; V : Big_Real) is
+ -- This is implemented in terms of To_String. It might be more elegant
+ -- and more efficient to do it the other way around, but this is the
+ -- most expedient implementation for now.
begin
- Wide_Wide_String'Write (Stream, To_Wide_Wide_String (To_String (Arg)));
+ Strings.Text_Output.Utils.Put_UTF_8 (S, To_String (V));
end Put_Image;
---------
diff --git a/gcc/ada/libgnat/a-nbnbre.adb b/gcc/ada/libgnat/a-nbnbre.adb
index 07a9442..11459ca 100644
--- a/gcc/ada/libgnat/a-nbnbre.adb
+++ b/gcc/ada/libgnat/a-nbnbre.adb
@@ -31,7 +31,9 @@
-- This is the default version of this package, based on Big_Integers only.
-with Ada.Characters.Conversions; use Ada.Characters.Conversions;
+pragma Ada_2020;
+
+with Ada.Strings.Text_Output.Utils;
package body Ada.Numerics.Big_Numbers.Big_Reals is
@@ -399,11 +401,12 @@ package body Ada.Numerics.Big_Numbers.Big_Reals is
-- Put_Image --
---------------
- procedure Put_Image
- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
- Arg : Big_Real) is
+ procedure Put_Image (S : in out Sink'Class; V : Big_Real) is
+ -- This is implemented in terms of To_String. It might be more elegant
+ -- and more efficient to do it the other way around, but this is the
+ -- most expedient implementation for now.
begin
- Wide_Wide_String'Write (Stream, To_Wide_Wide_String (To_String (Arg)));
+ Strings.Text_Output.Utils.Put_UTF_8 (S, To_String (V));
end Put_Image;
---------
diff --git a/gcc/ada/libgnat/a-nbnbre.ads b/gcc/ada/libgnat/a-nbnbre.ads
index 2ffc356..ddfbd77 100644
--- a/gcc/ada/libgnat/a-nbnbre.ads
+++ b/gcc/ada/libgnat/a-nbnbre.ads
@@ -13,8 +13,11 @@
-- --
------------------------------------------------------------------------------
+pragma Ada_2020;
+
with Ada.Numerics.Big_Numbers.Big_Integers;
-with Ada.Streams;
+
+with Ada.Strings.Text_Output; use Ada.Strings.Text_Output;
-- Note that some Ada 2020 aspects are commented out since they are not
-- supported yet.
@@ -22,9 +25,9 @@ with Ada.Streams;
package Ada.Numerics.Big_Numbers.Big_Reals
with Preelaborate
is
- type Big_Real is private;
--- with Real_Literal => From_String,
--- Put_Image => Put_Image;
+ type Big_Real is private with
+-- Real_Literal => From_String,
+ Put_Image => Put_Image;
function Is_Valid (Arg : Big_Real) return Boolean
with Convention => Intrinsic;
@@ -105,9 +108,7 @@ is
function From_Quotient_String (Arg : String) return Big_Real;
- procedure Put_Image
- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
- Arg : Big_Real);
+ procedure Put_Image (S : in out Sink'Class; V : Big_Real);
function "+" (L : Big_Real) return Big_Real;
diff --git a/gcc/ada/libgnat/a-stouut.ads b/gcc/ada/libgnat/a-stouut.ads
index c02885e..d781a06 100644
--- a/gcc/ada/libgnat/a-stouut.ads
+++ b/gcc/ada/libgnat/a-stouut.ads
@@ -31,7 +31,7 @@
pragma Ada_2020;
-package Ada.Strings.Text_Output.Utils is
+package Ada.Strings.Text_Output.Utils with Preelaborate is
-- This package provides utility functions on Sink'Class. These are
-- intended for use by Put_Image attributes, both the default versions
diff --git a/gcc/ada/libgnat/a-stteou.ads b/gcc/ada/libgnat/a-stteou.ads
index 8aaee46..f4b8966 100644
--- a/gcc/ada/libgnat/a-stteou.ads
+++ b/gcc/ada/libgnat/a-stteou.ads
@@ -33,7 +33,7 @@ pragma Ada_2020;
with Ada.Strings.UTF_Encoding;
with Ada.Strings.UTF_Encoding.Wide_Wide_Strings;
-package Ada.Strings.Text_Output is
+package Ada.Strings.Text_Output with Preelaborate is
-- This package provides a "Sink" abstraction, to which characters of type
-- Character, Wide_Character, and Wide_Wide_Character can be sent. This