]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #54004 - tromey:enum-debuginfo, r=tromey
authorbors <bors@rust-lang.org>
Tue, 30 Oct 2018 23:36:10 +0000 (23:36 +0000)
committerbors <bors@rust-lang.org>
Tue, 30 Oct 2018 23:36:10 +0000 (23:36 +0000)
Fix DWARF generation for enums

The DWARF generated for Rust enums was always somewhat unusual.
Rather than using DWARF constructs directly, it would emit magic field
names like "RUST$ENCODED$ENUM$0$Name" and "RUST$ENUM$DISR".  Since
PR #45225, though, even this has not worked -- the ad hoc scheme was
not updated to handle the wider variety of niche-filling layout
optimizations now available.

This patch changes the generated DWARF to use the standard tags meant
for this purpose; namely, DW_TAG_variant and DW_TAG_variant_part.

The patch to implement this went in to LLVM 7.  In order to work with
older versions of LLVM, and because LLVM doesn't do anything here for
PDB, the existing code is kept as a fallback mode.

Support for this DWARF is in the Rust lldb and in gdb 8.2.

Closes #32920
Closes #32924
Closes #52762
Closes #53153


Trivial merge