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 remove unused jemallocator crate 2022-01-28 16:56:05 +01:00
rustc_apfloat Stabilize iter::zip. 2021-12-14 18:50:31 -04:00
rustc_arena Remove unused dep from rustc_arena 2022-02-02 17:37:14 +01:00
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 Change syntax for TyAlias where clauses 2022-03-05 13:13:45 -05:00
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 add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
rustc_driver Rollup merge of #93913 - bjorn3:remove_everybody_loops, r=jackh726 2022-03-04 02:06:38 +01:00
rustc_error_codes Rollup merge of #94555 - cuishuang:master, r=oli-obk 2022-03-03 20:01:48 +01:00
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 Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
rustc_hir Identify anonymous lifetimes by their DefId in HIR. 2022-03-12 14:18:56 +01:00
rustc_hir_pretty resolve: Fix incorrect results of opt_def_kind query for some built-in macros 2022-02-24 22:54:36 +03:00
rustc_incremental all: fix some typos 2022-03-03 19:47:23 +08:00
rustc_index Add comment linking to closed PR for future optimizers 2022-03-07 19:06:42 +01:00
rustc_infer Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead 2022-03-12 07:02:05 +00:00
rustc_interface Rollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkov 2022-03-04 22:58:34 +01:00
rustc_lexer Improve scan_escape. 2022-02-24 17:01:01 +11:00
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 Make rustc_log doc test runnable 2022-01-03 22:31:56 -08:00
rustc_macros add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
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 Introduce ConstAllocation. 2022-03-07 08:25:50 +11:00
rustc_parse Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00
rustc_parse_format Correctly mark the span of captured arguments in format_args!() 2022-02-16 07:34:06 +00:00
rustc_passes Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_plugin_impl replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
rustc_query_impl Auto merge of #94084 - Mark-Simulacrum:drop-sharded, r=cjgillot 2022-02-27 14:04:07 +00:00
rustc_query_system rename ErrorReported -> ErrorGuaranteed 2022-03-02 09:45:25 -06:00
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 Delete Decoder::read_unit 2022-02-22 18:14:51 -05:00
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 Inline UnifyKey::index and UnifyKey::from_index 2022-02-15 19:07:06 +01:00
rustc_typeck Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuber 2022-03-15 03:56:33 +00:00