about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums
AgeCommit message (Collapse)AuthorLines
2025-09-28remove explicit deref of AbiAlign for most methodsJubilee Young-2/+2
Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
2025-09-17Use `LLVMDIBuilderCreateQualifiedType`Zalathar-3/+5
2025-09-17Use `LLVMDIBuilderCreateStaticMemberType`Zalathar-21/+44
2025-08-28compiler: Include span of too huge enum with -Cdebuginfo=2Martin Nordholts-2/+3
We have a ui test to ensure we emit an error if we encounter too big enums. Before this fix, compiling the test with `-Cdebuginfo=2` would not include the span of the instantiation site, because the error is then emitted from a different code path that does not include the span. Propagate the span to the error also in the debuginfo case, so the test passes regardless of debuginfo level.
2025-06-03Change `tag_field` to `FieldIdx` in `Variants::Multiple`Scott McMurray-8/+8
It was already available as a generic parameter anyway, and it's not like we'll ever put a tag in the 5-billionth field.
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-6/+3
async_drop_in_place::{closure}, scoped async drop added.
2025-04-15Revert "Deduplicate template parameter creation"Vadim Petrochenkov-1/+0
This reverts commit 6adc2c1fd6ecde7bf83c8b8fbc71f402ced87054.
2025-03-18Create a safe wrapper around `LLVMRustDIBuilderCreateMemberType`Oli Scherer-42/+36
2025-03-18Avoid splitting up a layoutOli Scherer-10/+10
2025-03-17Deduplicate template parameter creationOli Scherer-0/+1
2025-02-12debuginfo: Set bitwidth appropriately in enum variant tagsMatthew Maurer-1/+7
Previously, we unconditionally set the bitwidth to 128-bits, the largest an discrimnator would possibly be. Then, LLVM would cut down the constant by chopping off leading zeroes before emitting the DWARF. LLVM only supported 64-bit descriminators, so this would also have occasionally resulted in truncated data (or an assert) if more than 64-bits were used. LLVM added support for 128-bit enumerators in llvm/llvm-project#125578 That patchset also trusts the constant to describe how wide the variant tag is. As a result, we went from emitting tags that looked like: DW_AT_discr_value (0xfe) (`form1`) to emitting tags that looked like: DW_AT_discr_value (<0x10> fe ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ) This makes the `DW_AT_discr_value` encode at the bitwidth of the tag, which: 1. Is probably closer to our intentions in terms of describing the data. 2. Doesn't invoke the 128-bit support which may not be supported by all debuggers / downstream tools. 3. Will result in smaller debug information.
2025-01-05Use gimli to get the values of DWARF constants needed by codegenZalathar-3/+4
The `gimli` crate is already a dependency of `thorin-dwp`, which is already a dependency of `rustc_codegen_ssa`.
2024-12-30force enum `DISCR_*` to `const u64` to allow for inspection via LLDB's ↵Walnut-17/+34
`SBTypeStaticField::GetConstantValue()`
2024-12-18fix outdated commentRalf Jung-2/+1
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2024-12-18make no-variant types a dedicated Variants variantRalf Jung-17/+15
2024-12-18Variants::Single: do not use invalid VariantIdx for uninhabited enumsRalf Jung-2/+2
2024-11-06Clean up use requirements after rebasingMatt Weber-2/+3
2024-11-06Rename option and add docMatt Weber-32/+29
2024-11-06Add additional option checksMatt Weber-8/+31
2024-11-06Move additional source location info behind -Z optionMatt Weber-15/+73
2024-11-06Refactor `type_stub` from `DefId` to tupleMatt Weber-15/+11
2024-11-06Add file and line metadata for enum variant and fieldsMatt Weber-6/+22
2024-11-06Add file and line metadata for struct/union membersMatt Weber-0/+8
2024-11-06Add file and line metadata for coroutinesMatt Weber-2/+5
2024-11-06Refactor `type_map::stub` parametersMatt Weber-23/+21
Push span lookup into `type_map::stub` and pass the `DefId` instead of doing the lookup outside and passing in the location metadata.
2024-11-06Require `type_map::stub` callers to supply file informationMatt Weber-1/+19
This change attaches file information (`DIFile` reference and line number) to struct debug info nodes. Before: ``` ; foo.ll ... !5 = !DIFile(filename: "<unknown>", directory: "") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !5, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "4cb373851db92e732c4cb5651b886dd0") ... ``` After: ``` ; foo.ll ... !3 = !DIFile(filename: "foo.rs", directory: "/home/matt/src/rust98678", checksumkind: CSK_SHA1, checksum: "bcb9f08512c8f3b8181ef4726012bc6807bc9be4") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !3, line: 3, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "9e5968c7af39c148acb253912b7f409f") ... ``` Fixes #98678
2024-11-03compiler: Directly use rustc_abi in codegenJubilee Young-3/+3
2024-10-28Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`Zalathar-12/+12
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-9/+9
2024-09-17Rename supertraits of `CodegenMethods`.Nicholas Nethercote-2/+2
Supertraits of `BuilderMethods` are all called `XyzBuilderMethods`. Supertraits of `CodegenMethods` are all called `XyzMethods`. This commit changes the latter to `XyzCodegenMethods`, for consistency.
2024-08-27Rollup merge of #126013 - nnethercote:unreachable_pub, r=UrgauMatthias Krüger-1/+1
Add `#[warn(unreachable_pub)]` to a bunch of compiler crates By default `unreachable_pub` identifies things that need not be `pub` and tells you to make them `pub(crate)`. But sometimes those things don't need any kind of visibility. So they way I did these was to remove the visibility entirely for each thing the lint identifies, and then add `pub(crate)` back in everywhere the compiler said it was necessary. (Or occasionally `pub(super)` when context suggested that was appropriate.) Tedious, but results in more `pub` removal. There are plenty more crates to do but this seems like enough for a first PR. r? `@compiler-errors`
2024-08-16Add `warn(unreachable_pub)` to `rustc_codegen_llvm`.Nicholas Nethercote-1/+1
2024-08-13Use the `enum2$` Natvis visualiser for repr128 C-style enumsbeetrees-61/+16
2024-07-29Reformat `use` declarations.Nicholas Nethercote-92/+51
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-20compiler: Never debug_assert in codegenJubilee Young-10/+10
The gains in performance are not worth the costs in correctness. This is partly because the gains are zero and the costs are unknown.
2024-06-01Uplift TypeRelation and RelateMichael Goulet-2/+2
2024-05-06Refactor float `Primitive`s to a separate `Float` typebeetrees-4/+1
2024-03-24Require coroutine kind type to be passed to TyCtxt::coroutine_layoutMichael Goulet-3/+7
2024-03-24Always use tcx.coroutine_layout over calling optimized_mir directlyMichael Goulet-3/+2
2024-02-28Add `f16` and `f128` to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`Trevor Gross-0/+2
Make changes necessary to support these types in the compiler.
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-3/+3
2023-12-15NFC don't convert types to identical typesMatthias Krüger-1/+1
2023-12-15codegen_llvm: set DW_AT_accessibilityDavid Wood-13/+24
Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute. `DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust, but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Signed-off-by: David Wood <david@davidtw.co>
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-2/+2
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-10-20s/generator/coroutine/Oli Scherer-99/+99
2023-10-20s/Generator/Coroutine/Oli Scherer-12/+12
2023-08-01Use upvar_tys in more places, make it a listMichael Goulet-0/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-12/+12
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-7/+11
2023-06-19Store generator field names in GeneratorLayout.Camille GILLOT-9/+5