]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: Fix forward referenced enums missing type names in debug info [PR118309]
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Apr 2025 18:02:02 +0000 (20:02 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 9 Apr 2025 18:28:15 +0000 (20:28 +0200)
commitcee353c2653d274768a67677c8ea37fd23422b3c
tree7f6b318504f38aa45b563e96dea2c58aed6580ed
parent8df0de92a0bb2429491ab914461f30e960bba84a
d: Fix forward referenced enums missing type names in debug info [PR118309]

Calling `rest_of_type_compilation' as the D types were built meant that
debug info was being emitted before all forward references were
resolved, resulting in DW_AT_name's to be missing.

Instead, defer outputting type debug information until all modules have
been parsed and generated in `d_finish_compilation'.

PR d/118309

gcc/d/ChangeLog:

* modules.cc: Include debug.h
(d_finish_compilation): Call debug_hooks->type_decl on all TYPE_DECLs.
* types.cc: Remove toplev.h include.
(finish_aggregate_type): Don't call rest_of_type_compilation or
rest_of_decl_compilation on type.
(TypeVisitor::visit (TypeEnum *)): Likewise.

gcc/testsuite/ChangeLog:

* gdc.dg/debug/dwarf2/pr118309.d: New test.
gcc/d/modules.cc
gcc/d/types.cc
gcc/testsuite/gdc.dg/debug/dwarf2/pr118309.d [new file with mode: 0644]