rust/compiler/rustc_codegen_llvm/src
bors 040703018c Auto merge of #94261 - michaelwoerister:debuginfo-types-refactor, r=wesleywiser
debuginfo: Refactor debuginfo generation for types

This PR implements the refactoring of the `rustc_codegen_llvm::debuginfo::metadata` module as described in MCP https://github.com/rust-lang/compiler-team/issues/482.

In particular it
- changes names to use `di_node` instead of `metadata`
- uniformly names all functions that build new debuginfo nodes `build_xyz_di_node`
- renames `CrateDebugContext` to `CodegenUnitDebugContext` (which is more accurate)
- removes outdated parts from `compiler/rustc_codegen_llvm/src/debuginfo/doc.md`
- moves `TypeMap` and functions that work directly work with it to a new `type_map` module
- moves enum related builder functions to a new `enums` module
- splits enum debuginfo building for the native and cpp-like cases, since they are mostly separate
- uses `SmallVec` instead of `Vec` in many places
- removes the old infrastructure for dealing with recursion cycles (`create_and_register_recursive_type_forward_declaration()`, `RecursiveTypeDescription`, `set_members_of_composite_type()`, `MemberDescription`, `MemberDescriptionFactory`, `prepare_xyz_metadata()`, etc)
- adds `type_map::build_type_with_children()` as a replacement for dealing with recursion cycles
- adds many (doc-)comments explaining what's going on
- changes cpp-like naming for C-Style enums so they don't get a `enum$<...>` name (because the NatVis visualizer does not apply to them)
- fixes detection of what is a C-style enum because some enums where classified as C-style even though they have fields
- changes cpp-like naming for generator enums so that NatVis works for them
- changes the position of discriminant debuginfo node so it is consistently nested inside the top-level union instead of, sometimes, next to it

The following could be done in subsequent PRs:
- add caching for `closure_saved_names_of_captured_variables`
- add caching for `generator_layout_and_saved_local_names`
- fix inconsistent handling of what is considered a C-style enum wrt to debuginfo
- rename `metadata` module to `types`
- move common generator fields to front instead of appending them

This PR is based on https://github.com/rust-lang/rust/pull/93644 which is not merged yet.

Right now, the changes are all done in one big commit. They could be split into smaller commits but hopefully the list of changes above makes it tractable to review them as a single commit too.

For now: r? `@ghost` (let's see if this affects compile times)
2022-03-15 10:52:32 +00:00
..
back Improved error message for failed bitcode load 2022-03-06 15:25:05 +01:00
coverageinfo add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
debuginfo debuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo() 2022-03-14 17:25:24 +01:00
llvm Auto merge of #94539 - tmiasko:string-attributes, r=nikic 2022-03-04 10:38:11 +00:00
abi.rs Pass LLVM string attributes as string slices 2022-03-03 00:28:50 +01:00
allocator.rs debuginfo: Refactor debuginfo generation for types 2022-03-14 16:49:06 +01:00
asm.rs Add LLVM attributes in batches instead of individually 2022-02-26 13:14:55 -05:00
attributes.rs Always include global target features in function attributes 2022-03-04 16:57:34 +01:00
base.rs Add LLVM attributes in batches instead of individually 2022-02-26 13:14:55 -05:00
builder.rs Auto merge of #94159 - erikdesjardins:align-load, r=nikic 2022-03-04 08:14:31 +00:00
callee.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
common.rs Auto merge of #94638 - erikdesjardins:noextranull, r=nagisa 2022-03-07 02:07:36 +00:00
consts.rs debuginfo: Refactor debuginfo generation for types 2022-03-14 16:49:06 +01:00
context.rs debuginfo: Refactor debuginfo generation for types 2022-03-14 16:49:06 +01:00
declare.rs Remove LLVM attribute removal 2022-02-28 00:02:11 -05:00
intrinsic.rs Clarify Layout interning. 2022-03-07 13:41:47 +11:00
lib.rs rename ErrorReported -> ErrorGuaranteed 2022-03-02 09:45:25 -06:00
llvm_util.rs Tie fp and neon 2022-03-14 10:54:21 +00:00
mono_item.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
type_.rs Remove in_band_lifetimes from rustc_codegen_llvm 2021-12-16 14:43:32 -05:00
type_of.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
va_arg.rs Introduce Bx::switch_to_block 2022-02-24 12:18:21 +01:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00