about summary refs log tree commit diff
path: root/src/librustc_trans/debuginfo
AgeCommit message (Collapse)AuthorLines
2017-11-19rustc: extend the niche-filling enum optimization past 2 variants.Eduard-Mihai Burtescu-2/+4
2017-11-19rustc: optimize out uninhabited types and variants.Eduard-Mihai Burtescu-33/+28
2017-11-19rustc: track validity ranges for layout::Abi::Scalar values.Eduard-Mihai Burtescu-3/+5
2017-11-19rustc: generalize layout::Variants::NicheFilling to niches other than 0.Eduard-Mihai Burtescu-9/+5
2017-11-19rustc: collapse the remains of Layout into Variants (enums vs everything else).Eduard-Mihai Burtescu-50/+48
2017-11-19rustc: move size, align & primitive_align from Abi::Aggregate to layout.Eduard-Mihai Burtescu-14/+14
2017-11-19rustc_trans: go through layouts uniformly for fat pointers and variants.Eduard-Mihai Burtescu-7/+7
2017-11-19rustc_trans: keep a layout instead of a type in {Lvalue,Operand}Ref.Eduard-Mihai Burtescu-2/+1
2017-11-19rustc: do not pub use Layout::* in layout.Eduard-Mihai Burtescu-5/+6
2017-11-19rustc: move layout::Struct into FieldPlacement/Abi.Eduard-Mihai Burtescu-3/+2
2017-11-19rustc: hide details in Layout in favor of Abi or FieldPlacement.Eduard-Mihai Burtescu-22/+2
2017-11-19rustc: store CachedLayout for each variant of enum Layout's instead of Struct.Eduard-Mihai Burtescu-91/+52
2017-11-19rustc: move size/alignment from Layout into layout::Abi.Eduard-Mihai Burtescu-4/+4
2017-11-19rustc: make Layout::NullablePointer a lot more like Layout::General.Eduard-Mihai Burtescu-2/+4
2017-11-19rustc: collapse Layout::CEnum into Layout::General.Eduard-Mihai Burtescu-4/+5
2017-11-19rustc: move CEnum's signedness into Primitive::Int.Eduard-Mihai Burtescu-10/+5
2017-11-19rustc: use Primitive instead of Integer for CEnum and General discriminants.Eduard-Mihai Burtescu-5/+8
2017-11-19rustc: collapse Layout::{Raw,StructWrapped}NullablePointer into one variant.Eduard-Mihai Burtescu-75/+2
2017-11-19rustc: pre-compute field placements out of Layout.Eduard-Mihai Burtescu-5/+5
2017-11-19rustc: remove Ty::layout and move everything to layout_of.Eduard-Mihai Burtescu-3/+3
2017-11-19rustc: re-complicate the TyLayout API and use better names.Eduard-Mihai Burtescu-7/+7
2017-11-19rustc: remove source field path from Layout::StructWrappedNullablePointer.Eduard-Mihai Burtescu-12/+34
2017-11-19rustc: remove useless 0 prefix from Layout::StructWrappedNullablePointer's ↵Eduard-Mihai Burtescu-1/+0
discrfield.
2017-11-19rustc: do not inject discriminant fields into Layout::General's variants.Eduard-Mihai Burtescu-3/+7
2017-11-19rustc_trans: use more of the trans::mir and ty::layout APIs throughout.Eduard-Mihai Burtescu-51/+39
2017-11-19rustc_trans: avoid working with sizes/offsets and alignments as integers.Eduard-Mihai Burtescu-230/+149
2017-11-15Emit debug info for trait object pointerTom Tromey-1/+92
Emit better debugging information for a trait object pointer. In particular, now: * The fields are explicitly represented in the DWARF; * DWARF for the vtable itself is emitted; and * The DWARF for the vtable's type has a DW_AT_containing_type which points to the concrete type for which the vtable was emitted. This is a small DWARF extension, that allows debuggers to determine the real type of the object to which a trait object points. I'll submit the gdb patch to take advantage of this new debuginfo once this lands. The vtable type is not currently complete -- it doesn't include members for the pointers it contains. This information was not needed for this feature. This addresses part 1 of #1563.
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-0/+17
2017-10-21trans_ -> fully_ prefixMarco Concetto Rudilosso-3/+3
2017-10-21added trans_ prefix and pluralised types. Solved failing test on the ↵Marco Concetto Rudilosso-3/+3
incremental test-suite.
2017-10-21Create NormalizeTy queryMarco Concetto Rudilosso-3/+3
2017-10-16Make debuginfo::UniqueTypeId use 128 bit hash.Michael Woerister-4/+3
2017-09-17rustc: Move codegen to a queryAlex Crichton-2/+2
This commit moves the actual code generation in the compiler behind a query keyed by a codegen unit's name. This ended up entailing quite a few internal refactorings to enable this, along with a few cut corners: * The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a whole bunch of trans and such. This is now behind a query and threaded into the construction of the `TyCtxt`. * The `TyCtxt` now has a channel "out the back" intended to send data to worker threads in rustc_trans. This is used as a sort of side effect of the codegen query but morally what's happening here is the return value of the query (currently unit but morally a path) is only valid once the background threads have all finished. * Dispatching work items to the codegen threads was refactored to only rely on data in `TyCtxt`, which mostly just involved refactoring where data was stored, moving it from the translation thread to the controller thread's `CodegenContext` or the like. * A new thread locals was introduced in trans to work around the query system. This is used in the implementation of `assert_module_sources` which looks like an artifact of the old query system and will presumably go away once red/green is up and running.
2017-09-17rustc: Mostly remove `ExportedSymbols`Alex Crichton-1/+2
This is a big map that ends up inside of a `CrateContext` during translation for all codegen units. This means that any change to the map may end up causing an incremental recompilation of a codegen unit! In order to reduce the amount of dependencies here between codegen units and the actual input crate this commit refactors dealing with exported symbols and such into various queries. The new queries are largely based on existing queries with filled out implementations for the local crate in addition to external crates, but the main idea is that while translating codegen untis no unit needs the entire set of exported symbols, instead they only need queries about particulare `DefId` instances every now and then. The linking stage, however, still generates a full list of all exported symbols from all crates, but that's going to always happen unconditionally anyway, so no news there!
2017-09-17rustc_trans: Refactor collection to use tcxAlex Crichton-2/+2
This commit refactors the `collect_crate_translation_items` function to only require the `TyCtxt` instead of a `SharedCrateContext` in preparation for query-ifying this portion of trans.
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-2/+3
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-2/+2
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-2/+2
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-4/+4
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-4/+4
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-31/+31
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-31/+31
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-4/+4
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-12Fix some typosBastien Orivel-1/+1
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+13
2017-07-28Auto merge of #43221 - MaulingMonkey:natvis-improvements, r=michaelwoeristerbors-4/+30
Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T]. No idea if these changes are reasonable - please feel free to suggest changes/rewrites. And these are some of my first real commits to any rust codebase - *don't* be gentle, and nitpick away, I need to learn! ;) ### Overview Embedding `.natvis` files into `.pdb`s allows MSVC (and potentially other debuggers) to automatically pick up the visualizers without having to do any additional configuration (other than to perhaps add the relevant .pdb paths to symbol search paths.) The native debug engine for MSVC parses the type names, making various C++ish assumptions about what they mean and adding various limitations to valid type names. `&str` cannot be matched against a visualizer, but if we emit `str&` instead, it'll be recognized as a reference to a `str`, solving the problem. `[T]` is similarly problematic, but emitting `slice<T>` instead works fine as it looks like a template. I've been unable to get e.g. `slice<u32>&` to match visualizers in VS2015u3, so I've gone with `str*` and `slice<u32>*` instead. ### Possible Issues * I'm not sure if `slice<T>` is a great mangling for `[T]` or if I should worry about name collisions. * I'm not sure if `linker.rs` is the right place to be enumerating natvis files. * I'm not sure if these type name mangling changes should actually be MSVC specific. I recall seeing gdb visualizer tests that might be broken if made more general? I'm hesitant to mess with them without a gdb install. But perhaps I'm just wracking up technical debt. Should I try `pacman -S mingw-w64-x86_64-gdb` and to make things consistent? * I haven't touched `const` / `mut` yet, and I'm worried MSVC might trip up on `mut` or their placement. * I may like terse oneliners too much. * I don't know if there's broader implications for messing with debug type names here. * I may have been mistaken about bellow test failures being ignorable / unrelated to this changelist. ### Test Failures on `x86_64-pc-windows-gnu` ``` ---- [debuginfo-gdb] debuginfo-gdb\associated-types.rs stdout ---- thread '[debuginfo-gdb] debuginfo-gdb\associated-types.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16 note: Run with `RUST_BACKTRACE=1` for a backtrace. [...identical panic causes omitted...] ---- [debuginfo-gdb] debuginfo-gdb\vec.rs stdout ---- thread '[debuginfo-gdb] debuginfo-gdb\vec.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16 ``` ### Relevant Issues * https://github.com/rust-lang/rust/issues/40460 Metaissue for Visual Studio debugging Rust * https://github.com/rust-lang/rust/issues/36503 Investigate natvis for improved msvc debugging * https://github.com/PistonDevelopers/VisualRust/issues/160 Debug visualization of Rust data structures ### Pretty Pictures ![Collapsed Watch Window](https://user-images.githubusercontent.com/75894/28180998-e44c7516-67bb-11e7-8b48-d4f9605973ae.png) ![Expanded Watch Window](https://user-images.githubusercontent.com/75894/28181000-e8da252e-67bb-11e7-96b8-d613310c04dc.png)
2017-07-19Expand one-liners, rename is_like_msvc to cpp_like_names and explain.MaulingMonkey-11/+30
2017-07-13Modify type names on MSVC to make strings and slices .natvis compatible.MaulingMonkey-4/+11