]> git.lizzy.rs Git - rust.git/commit
auto merge of #14486 : michaelwoerister/rust/unified_enum_rep, r=luqmana
authorbors <bors@rust-lang.org>
Thu, 29 May 2014 21:41:42 +0000 (14:41 -0700)
committerbors <bors@rust-lang.org>
Thu, 29 May 2014 21:41:42 +0000 (14:41 -0700)
commit0935beba717bf6d3b54ad1b2eace359dea5dfca0
treeaf4a606376b0a360b0659c5ad65e3b7af1e01d79
parent729ee203387cc3a3f7387cffd018aba93b0110e6
parenteea329b0f71905518902d34ef77c0923096dde1d
auto merge of #14486 : michaelwoerister/rust/unified_enum_rep, r=luqmana

So far the DWARF information for enums was different for regular enums, univariant enums, Option-like enums, etc. Regular enums were encoded as unions of structs, while the other variants were encoded as bare structs. With the changes in this PR all enums are encoded as unions so that debuggers can reconstruct if something originally was a struct, a univariant enum, or an Option-like enum.  For the latter case, information about the *Null* variant is encoded into the union field name. This information can then be used by the debugger to print a `None` value actually as `None` instead of `Some(0x0)`.

The changes in this PR should also fix the regression reported in #14385 and #14411, but I want to close these only after I have confirmation from the original reporters that the issues are actually fixed for them.
src/librustc/middle/trans/debuginfo.rs