[Ada] Avoid repeated conversions from Int to Char_Code
commit53f2aaf0b3c322e65d014ad2203a706bc8b26b8f
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 18 Jan 2022 20:24:32 +0000 (18 21:24 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 10 May 2022 08:19:22 +0000 (10 08:19 +0000)
treed2c68c8f27fd72d26227af1e5901bbf3e3dd8a82
parent3ad8cac47099983e9b24103e8327bc2518044877
[Ada] Avoid repeated conversions from Int to Char_Code

When expanding aggregates like "(others => 'x')" into strings we
repeated conversion from Int to Char_Code for every character.  Now we
convert once and use the Char_Code directly.

Cleanup related to handling characters in GNATprove counterexamples;
semantics is unaffected.

gcc/ada/

* exp_aggr.adb (Expand_N_Aggregate): Replace UI_To_Int with
UI_To_CC; replace magic literals with high-level routines that
recognise wide and wide wide characters; reorder if-then-elsif
condition, because we don't have a routine to detect wide wide
characters.
gcc/ada/exp_aggr.adb