summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
AgeCommit message (Collapse)AuthorLines
2023-05-19Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillotbors-2/+1
Fix dependency tracking for debugger visualizers This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves. TODO: - [x] perf.rlo - [x] Needs a bit more documentation in some places - [x] Needs regression test for the incr. comp. case Fixes https://github.com/rust-lang/rust/issues/111226 Fixes https://github.com/rust-lang/rust/issues/111227 Fixes https://github.com/rust-lang/rust/issues/111295 r? `@wesleywiser` cc `@gibbyfree`
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-2/+1
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-2/+1
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-16Move DebuggerVisualizerFile types from rustc_span to rustc_middleMichael Woerister-2/+1
2023-05-06make (try_)subst_and_normalize_erasing_regions take EarlyBinderKyle Matsuda-2/+2
2023-05-03debuginfo: split method declaration and definitionJosh Stone-34/+51
When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration.
2023-04-27rename `needs_subst` to `has_param`Boxy-1/+1
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-4/+4
2023-04-19Move `GenericArgKind::as_{type,const,region}` to `GenericArg`Maybe Waffle-2/+2
2023-04-19Add `GenericArgKind::as_{type,const,region}`Maybe Waffle-14/+9
2023-04-18Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillotbors-1/+2
Encode hashes as bytes, not varint In a few places, we store hashes as `u64` or `u128` and then apply `derive(Decodable, Encodable)` to the enclosing struct/enum. It is more efficient to encode hashes directly than try to apply some varint encoding. This PR adds two new types `Hash64` and `Hash128` which are produced by `StableHasher` and replace every use of storing a `u64` or `u128` that represents a hash. Distribution of the byte lengths of leb128 encodings, from `x build --stage 2` with `incremental = true` Before: ``` ( 1) 373418203 (53.7%, 53.7%): 1 ( 2) 196240113 (28.2%, 81.9%): 3 ( 3) 108157958 (15.6%, 97.5%): 2 ( 4) 17213120 ( 2.5%, 99.9%): 4 ( 5) 223614 ( 0.0%,100.0%): 9 ( 6) 216262 ( 0.0%,100.0%): 10 ( 7) 15447 ( 0.0%,100.0%): 5 ( 8) 3633 ( 0.0%,100.0%): 19 ( 9) 3030 ( 0.0%,100.0%): 8 ( 10) 1167 ( 0.0%,100.0%): 18 ( 11) 1032 ( 0.0%,100.0%): 7 ( 12) 1003 ( 0.0%,100.0%): 6 ( 13) 10 ( 0.0%,100.0%): 16 ( 14) 10 ( 0.0%,100.0%): 17 ( 15) 5 ( 0.0%,100.0%): 12 ( 16) 4 ( 0.0%,100.0%): 14 ``` After: ``` ( 1) 372939136 (53.7%, 53.7%): 1 ( 2) 196240140 (28.3%, 82.0%): 3 ( 3) 108014969 (15.6%, 97.5%): 2 ( 4) 17192375 ( 2.5%,100.0%): 4 ( 5) 435 ( 0.0%,100.0%): 5 ( 6) 83 ( 0.0%,100.0%): 18 ( 7) 79 ( 0.0%,100.0%): 10 ( 8) 50 ( 0.0%,100.0%): 9 ( 9) 6 ( 0.0%,100.0%): 19 ``` The remaining 9 or 10 and 18 or 19 are `u64` and `u128` respectively that have the high bits set. As far as I can tell these are coming primarily from `SwitchTargets`.
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-1/+2
2023-04-17Spelling - compilerJosh Soref-3/+3
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-08Auto merge of #109862 - klensy:llvm-dd, r=nikicbors-20/+8
llvm: replace some deprecated functions, add fixmes Replace some deprecated llvm functions, add FIXME's (for simpler future work), replace some rust custom functions with llvm ones.
2023-04-05reviewklensy-18/+7
2023-04-04Auto merge of #109808 - jyn514:debuginfo-options, r=michaelwoeristerbors-19/+2
Extend -Cdebuginfo with new options and named aliases This is a rebase of https://github.com/rust-lang/rust/pull/83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: https://github.com/rust-lang/rust/pull/83947#issuecomment-878384979 Closes https://github.com/rust-lang/rust/pull/109311. Helps with https://github.com/rust-lang/rust/pull/104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix https://github.com/rust-lang/rust/issues/60020 Fix https://github.com/rust-lang/rust/issues/64405
2023-04-04replace LLVMRustMetadataAsValue with LLVMMetadataAsValueklensy-1/+1
2023-04-04replace deprecated LLVMSetCurrentDebugLocation with LLVMSetCurrentDebugLocation2klensy-2/+1
2023-04-02Use `&IndexSlice` instead of `&IndexVec` where possibleScott McMurray-2/+2
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
2023-03-31Preserve, clarify, and extend debug informationJulia Tatz-19/+2
`-Cdebuginfo=1` was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for line tables only was added. Additionally an option for line info directives only was added, which is well needed for some targets. The debug info options should now behave the same as clang's debug info options.
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-1/+2
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-28Move `mir::Field` → `abi::FieldIdx`Scott McMurray-3/+5
The first PR for https://github.com/rust-lang/compiler-team/issues/606 This is just the move-and-rename, because it's plenty big-and-bitrotty already. Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-27Rollup merge of #109635 - Nilstrieb:debrrruginfo, r=compiler=errorsMatthias Krüger-5/+4
debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of This avoids some type interning and a query execution. It also just makes the code simpler.
2023-03-26debuginfo: Get pointer size/align from tcx.data_layout instead of layout_ofNilstrieb-5/+4
This avoids some type interning and a query execution. It also just makes the code simpler.
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-2/+2
2023-03-11Address the new odd backticks tidy lint in compiler/est31-0/+1
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-22Remove type-traversal trait aliasesAlan Egerton-1/+1
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-1/+1
2023-02-14s/eval_usize/eval_target_usize/ for clarityOli Scherer-1/+1
2023-01-27Don't merge vtables when full debuginfo is enabled.Michael Woerister-0/+5
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-1/+2
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-4/+4
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-07Move closure/generator type info methods to TyCtxtMichael Goulet-75/+8
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-2/+2
2022-11-21Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisabors-11/+7
Pass 128-bit C-style enum enumerator values to LLVM Pass the full 128 bits of C-style enum enumerators through to LLVM. This means that debuginfo for C-style repr128 enums is now emitted correctly for DWARF platforms (as compared to not being correctly emitted on any platform). Tracking issue: #56071
2022-11-15Introduce composite debuginfo.Camille GILLOT-1/+11
2022-11-13add is_sized method on Abi and Layout, and use itRalf Jung-1/+1
2022-10-09Pass 128-bit C-style enum enumerator values to LLVMbeetrees-11/+7
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-13/+13
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-2/+1
by module
2022-09-01Directly use the `instrument` macro instead of its full pathOli Scherer-2/+0
2022-08-27rustc_middle: Remove `Visibility::Invisible`Vadim Petrochenkov-11/+5
2022-08-12[debuginfo] Use IndexMap instead of FxHashMap while generating cpp-like ↵Michael Woerister-6/+15
generator debuginfo.
2022-08-12[debuginfo] Update cpp-like enum decoding docs to account for wrapping tag ↵Michael Woerister-2/+12
ranges.
2022-08-12[debuginfo] Don't mark fields and types as artificial in CPP-like enum ↵Michael Woerister-5/+5
debuginfo encoding. LLDB historically has had problems with "artificial" entries and there is no real benefit to emitting that flag.
2022-08-12[debuginfo] Remove the notion of a 'fallback variant' from the CPP-like enum ↵Michael Woerister-19/+69
debuginfo encoding.
2022-08-12Use enum2<_> instead of enum<_> for Cpp-like debuginfo enum type names.Michael Woerister-6/+21
And add more comments about niche tag enum encoding.