[Ada] Emit debug info for named numbers
Eric Botcazou
ebotcazou@adacore.com
Fri Oct 11 08:20:00 GMT 2019
You can declare named numbers in Ada with the syntax:
Pi : constant := 3.14159
and the compiler automatically resolves the underlying type. But it wouldn't
emit debug info for the declaration although DW_TAG_constant is a perfect fit.
Tested on x86_64-suse-linux, applied on the mainline.
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Named_{Integer|Real}>:
New case to deal with the definition of named numbers.
<E_Variable>: Minor tweaks. Set DECL_IGNORED_P on the CONST_DECL
if a corresponding variable is built.
* gcc-interface/trans.c (gnat_to_gnu) <N_Integer_Literal>: Return
error_mark_node instead of aborting on overflow for named numbers.
<N_Number_Declaration>: Reuse the <N_Object_Declaration> case and
deal with error_mark_node specifically.
* gcc-interface/utils.c (create_var_decl): Do not set DECL_IGNORED_P
on CONST_DECLs.
(gnat_write_global_declarations): Output global constants.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 6424 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191011/9be7b7e0/attachment.bin>
More information about the Gcc-patches
mailing list