[Ada] Make System.Generic_Bignums more flexible
authorArnaud Charlet <charlet@adacore.com>
Mon, 25 May 2020 15:30:56 +0000 (11:30 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 10 Jul 2020 09:16:17 +0000 (05:16 -0400)
commit2f9821a09ac0c5f07ce621ef6a32acfdfa2e485e
tree02567e042b72d4a8c8e076c15bec3d80a87c9022
parent9e0cd875b5c5911200543044f855843afb93bf67
[Ada] Make System.Generic_Bignums more flexible

gcc/ada/

* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-shabig.o.
* libgnat/s-shabig.ads: New file to share definitions.
* libgnat/s-genbig.ads, libgnat/s-genbig.adb: Reorganized to
make it more generic and flexible in terms of memory allocation
and data structure returned.
(To_String): Moved to System.Generic_Bignums to allow sharing
this code.
(Big_And, Big_Or, Big_Shift_Left, Big_Shift_Right): New.
* libgnat/s-bignum.adb, libgnat/s-bignum.ads: Adapt to new
System.Generic_Bignums spec.
* libgnat/a-nbnbin.adb: Likewise.
(To_String): Moved to System.Generic_Bignums to allow sharing
this code.
* libgnat/a-nbnbre.adb (Normalize): Fix handling of Num = 0
leading to an exception.
gcc/ada/Makefile.rtl
gcc/ada/libgnat/a-nbnbin.adb
gcc/ada/libgnat/a-nbnbre.adb
gcc/ada/libgnat/s-bignum.adb
gcc/ada/libgnat/s-bignum.ads
gcc/ada/libgnat/s-genbig.adb
gcc/ada/libgnat/s-genbig.ads
gcc/ada/libgnat/s-shabig.ads [new file with mode: 0644]