]> git.lizzy.rs Git - rust.git/commit
auto merge of #7710 : michaelwoerister/rust/WP4, r=jdm
authorbors <bors@rust-lang.org>
Sat, 20 Jul 2013 16:10:34 +0000 (09:10 -0700)
committerbors <bors@rust-lang.org>
Sat, 20 Jul 2013 16:10:34 +0000 (09:10 -0700)
commit8aae6edce09a8e2a32a154acb55c9879dbebf99c
treed77d6659847631f404dcf08529e3b3bd0b7fa4e2
parent3a1db2d1e631feede472396fced1806dfd3cf677
parenta1303cc81565a019d59be28940a94caf0f9329bf
auto merge of #7710 : michaelwoerister/rust/WP4, r=jdm

This pull request includes various improvements:

+ Composite types (structs, tuples, boxes, etc) are now handled more cleanly by debuginfo generation. Most notably, field offsets are now extracted directly from LLVM types, as opposed to trying to reconstruct them. This leads to more stable handling of edge cases (e.g. packed structs or structs implementing drop).

+ `debuginfo.rs` in general has seen a major cleanup. This includes better formatting, more readable variable and function names, removal of dead code, and better factoring of functionality.

+ Handling of `VariantInfo` in `ty.rs` has been improved. That is, the `type VariantInfo = @VariantInfo_` typedef has been replaced with explicit uses of @VariantInfo, and the duplicated logic for creating VariantInfo instances in `ty::enum_variants()` and `typeck::check::mod::check_enum_variants()` has been unified into a single constructor function. Both function now look nicer too :)

+ Debug info generation for enum types is now mostly supported. This includes:
  + Good support for C-style enums. Both DWARF and `gdb` know how to handle them.
  + Proper description of tuple- and struct-style enum variants as unions of structs.
  + Proper handling of univariant enums without discriminator field.
  + Unfortunately `gdb` always prints all possible interpretations of a union, so debug output of enums is verbose and unintuitive. Neither `LLVM` nor `gdb` support DWARF's `DW_TAG_variant` which allows to properly describe tagged unions. Adding support for this to `LLVM` seems doable. `gdb` however is another story. In the future we might be able to use `gdb`'s Python scripting support to alleviate this problem. In agreement with @jdm this is not a high priority for now.

+ The debuginfo test suite has been extended with 14 test files including tests for packed structs (with Drop), boxed structs, boxed vecs, vec slices, c-style enums (standalone and embedded), empty enums, tuple- and struct-style enums, and various pointer types to the above.

~~What is not yet included is DI support for some enum edge-cases represented as described in `trans::adt::NullablePointer`.~~

Cheers,
Michael

PS: closes #7819,  fixes #7712
src/librustc/metadata/csearch.rs
src/librustc/metadata/decoder.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/ty.rs