DWARF: for variants, produce unsigned discr. when debug type is unsigned
In Ada, the Character type is supposed to be unsigned. However,
depending on the sign of C char types, GNAT can materialize it as a
signed type for code generation purposes. When this is the case, GNAT
also attach a debug type to it so it is represented as an unsigned base
type in the debug information.
This change adapts record variant parts processing in the DWARF back-end
so that when the debug type of discriminant is unsigned while
discriminant values are signed themselves, we output unsigned
discriminant values in DWARF.
gcc/
* dwarf2out.c (get_discr_value): Call the get_debug_type hook on
the type of the input discriminant value. Convert the
discriminant value of signedness vary.
gcc/testsuite/
* gnat.dg/debug11.adb: New testcase.
From-SVN: r248773