]> git.ipfire.org Git - thirdparty/gcc.git/commit
DWARF: move pessimistic DWARF version checks for imported entities
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Oct 2016 07:53:37 +0000 (07:53 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Oct 2016 07:53:37 +0000 (07:53 +0000)
commitce229d5677157b43b8bf3783ddb716b72fce2352
tree21ba90c8d091f54e8e10863ba50b71f8e6617f6f
parent7667e10d2d8218530ebc7ed3bb52043eadb93e46
DWARF: move pessimistic DWARF version checks for imported entities

A check in dwarf2out_imported_module_or_decl prevents
DW_TAG_imported_module from being emitted as it was introduced in the
DWARFv3 standard. However, this also prevents valid strict DWARFv2
constructs such as DW_TAG_imported_declaration from being emitted in
dwarf2out_imported_module_or_decl_1.

The latter already protects the emission of newer DWARF tags with
appropriate checks, so the one in the former is redundant and
pessimistic.  This function is already called from places like
process_scope_var, which are not protected anyway.

This patch moves the check in dwarf2out_imported_module_or_decl so that
in strict DWARFv2 mode, tags like DW_TAG_imported_declaration are
emitted while DW_TAG_imported_module are not.

gcc/

* dwarf2out.c (dwarf2out_imported_module_or_decl): Move DWARF
version check to protect only DW_TAG_imported_module generation.

gcc/testsuite/

* gnat.dg/debug7.adb, gnat.dg/debug7.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240772 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/debug7.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/debug7.ads [new file with mode: 0644]