[Ada] Uintp: add a new UI_From_Integral generic constructor
authorEd Schonberg <schonberg@adacore.com>
Tue, 11 Dec 2018 11:11:06 +0000 (11:11 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 11 Dec 2018 11:11:06 +0000 (11:11 +0000)
commit62ebfa527237ba42c9d93032dc008e82d482d271
treeba2bcd82f026df41318ff05a4967bd6291a6bc74
parent5e366628853651e5d7a98e7bc12f5fb7746ce993
[Ada] Uintp: add a new UI_From_Integral generic constructor

2018-12-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* uintp.ads, uintp.adb (UI_From_Integral): New generic function,
to simplify construction of Universal_Integer representations
from any Integer type. If type is small enough the code is
equivalent to a call to UI_To_Int with appropriate conversions;
otherwise the routine uses the existing mechanism of building a
vector of suitable integer values and calling Vector_To_Uint.
The routine must not be applied to a biased type.

From-SVN: r267000
gcc/ada/ChangeLog
gcc/ada/uintp.adb
gcc/ada/uintp.ads