]> git.lizzy.rs Git - rust.git/commit
debuginfo: Make DWARF representation of enums uniform.
authorMichael Woerister <michaelwoerister@posteo>
Thu, 15 May 2014 13:33:51 +0000 (15:33 +0200)
committerMichael Woerister <michaelwoerister@posteo>
Thu, 29 May 2014 12:21:03 +0000 (14:21 +0200)
commiteea329b0f71905518902d34ef77c0923096dde1d
treee734cbe1994eb783eb47bc01f106ba69c443689a
parent138089355d7a1bc28fa58f2bea7680af96bd5b92
debuginfo: Make DWARF representation of enums uniform.

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).
src/librustc/middle/trans/debuginfo.rs
src/test/debuginfo/borrowed-enum.rs
src/test/debuginfo/generic-struct-style-enum.rs
src/test/debuginfo/generic-tuple-style-enum.rs
src/test/debuginfo/managed-enum.rs
src/test/debuginfo/option-like-enum.rs
src/test/debuginfo/recursive-struct.rs
src/test/debuginfo/struct-in-enum.rs
src/test/debuginfo/struct-style-enum.rs
src/test/debuginfo/tuple-style-enum.rs
src/test/debuginfo/unique-enum.rs