rust/compiler
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
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_ast_lowering Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_ast_passes Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwco 2022-03-10 12:20:51 +01:00
rustc_ast_pretty
rustc_attr Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwco 2022-03-10 12:20:51 +01:00
rustc_borrowck Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_builtin_macros Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_codegen_cranelift Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_codegen_gcc debuginfo: Refactor debuginfo generation for types -- Rename DebugInfoMethods::create_vtable_metadata() to DebugInfoMethods::create_vtable_debuginfo() 2022-03-14 17:25:24 +01:00
rustc_codegen_llvm Auto merge of #94261 - michaelwoerister:debuginfo-types-refactor, r=wesleywiser 2022-03-15 10:52:32 +00:00
rustc_codegen_ssa Auto merge of #94261 - michaelwoerister:debuginfo-types-refactor, r=wesleywiser 2022-03-15 10:52:32 +00:00
rustc_const_eval Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead 2022-03-12 07:02:05 +00:00
rustc_data_structures
rustc_driver
rustc_error_codes
rustc_errors Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
rustc_expand Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_feature Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=Amanieu 2022-03-14 17:24:56 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir Identify anonymous lifetimes by their DefId in HIR. 2022-03-12 14:18:56 +01:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead 2022-03-12 07:02:05 +00:00
rustc_interface
rustc_lexer
rustc_lint Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
rustc_lint_defs Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
rustc_llvm RustWrapper: add missing include 2022-03-10 11:16:33 -05:00
rustc_log
rustc_macros
rustc_metadata Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_middle Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, r=flip1995,wesleywiser 2022-03-14 17:24:58 +01:00
rustc_mir_build Fix rebase conflicts with stderr files 2022-03-12 15:38:44 -05:00
rustc_mir_dataflow Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_mir_transform Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead 2022-03-12 07:02:05 +00:00
rustc_monomorphize
rustc_parse Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_parse_format
rustc_passes Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_plugin_impl
rustc_privacy Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_query_impl
rustc_query_system
rustc_resolve Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_save_analysis Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_serialize
rustc_session Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandry 2022-03-10 23:12:57 +01:00
rustc_span Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=Amanieu 2022-03-14 17:24:56 +01:00
rustc_symbol_mangling Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_target Add support for targeting riscv32im-unknown-none-elf 2022-03-09 13:51:29 -08:00
rustc_trait_selection Auto merge of #92285 - compiler-errors:dyn-proj-bounds, r=nikomatsakis 2022-03-15 01:31:42 +00:00
rustc_traits Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_ty_utils Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_type_ir
rustc_typeck Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00