about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
AgeCommit message (Collapse)AuthorLines
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.
2022-08-12debuginfo: Change C++-like encoding for enums.Michael Woerister-202/+570
The updated encoding should be able to handle niche layouts where more than one variant has fields.
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-4/+4
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-1/+1
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-07-14fix dwarf debuginfo being used in addition to CodeView on windowsRémy Rakic-17/+20
Fixes the debuginfo size increase regression introduced by the DWARF5 support.
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-6/+6
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-08Implement support for DWARF version 5.Patrick Walton-8/+8
DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-2/+3
2022-07-06Update TypeVisitor pathsAlan Egerton-1/+1
2022-06-16Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}`Maybe Waffle-1/+1
2022-06-14Add metadata generation for vtables when using VFEflip1995-7/+92
This adds the typeid and `vcall_visibility` metadata to vtables when the -Cvirtual-function-elimination flag is set. The typeid is generated in the same way as for the `llvm.type.checked.load` intrinsic from the trait_ref. The offset that is added to the typeid is always 0. This is because LLVM assumes that vtables are constructed according to the definition in the Itanium ABI. This includes an "address point" of the vtable. In C++ this is the offset in the vtable where information for RTTI is placed. Since there is no RTTI information in Rust's vtables, this "address point" is always 0. This "address point" in combination with the offset passed to the `llvm.type.checked.load` intrinsic determines the final function that should be loaded from the vtable in the `WholeProgramDevirtualization` pass in LLVM. That's why the `llvm.type.checked.load` intrinsics are generated with the typeid of the trait, rather than with that of the function that is called. This matches what `clang` does for C++. The vcall_visibility metadata depends on three factors: 1. LTO level: Currently this is always fat LTO, because LLVM only supports this optimization with fat LTO. 2. Visibility of the trait: If the trait is publicly visible, VFE can only act on its vtables after linking. 3. Number of CGUs: if there is more than one CGU, also vtables with restricted visibility could be seen outside of the CGU, so VFE can only act on them after linking. To reflect this, there are three visibility levels: Public, LinkageUnit, and TranslationUnit.
2022-06-07Specify DWARF alignment in bits, not bytes.Patrick Walton-1/+1
In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
2022-05-29Auto merge of #97287 - compiler-errors:type-interner, r=jackh726,oli-obkbors-2/+2
Move things to `rustc_type_ir` Finishes some work proposed in https://github.com/rust-lang/compiler-team/issues/341. r? `@ghost`