rust/compiler/rustc_codegen_ssa/src
bors 2545459bff Auto merge of #85269 - dpaoliello:dpaoliello/DebugSymbols, r=michaelwoerister
Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger

There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types).

Instead, each debug symbol name should be unique and useful:
* Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified.
* Qualify the principal trait for dynamic types.
* If there is no principal trait for a dynamic type, emit all other traits instead.
* Respect the `qualified` argument when emitting ref and pointer types.
* For implementations, emit the disambiguator.
* Print const generics when emitting generic parameters or arguments.

Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly:
* Avoid characters with special meaning (`#`, `[`, `"`, `+`).
* Never start a name with `<` or `{` as this is treated as an operator.
* `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this).
* Emit function declarations using C/C++ style syntax (e.g., leading return type).
* Emit arrays as a synthetic `array$<type, size>` type.
* Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
2021-07-02 17:19:32 +00:00
..
back Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkov 2021-07-01 19:00:08 +00:00
coverageinfo Reland - Report coverage 0 of dead blocks 2021-06-01 13:28:59 -07:00
debuginfo Update cdb tests for expected output 2021-07-01 14:26:20 -04:00
mir Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa 2021-06-21 04:03:51 +00:00
traits Rollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkov 2021-07-01 11:15:41 +02:00
base.rs Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkov 2021-07-01 19:00:08 +00:00
common.rs Remove support for floating-point constants in asm! 2021-05-14 14:58:21 +01:00
glue.rs Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
lib.rs Auto merge of #85810 - bjorn3:further_driver_cleanup, r=varkor 2021-06-07 02:30:24 +00:00
meth.rs Update other codegens to use tcx managed vtable allocations. 2021-06-28 19:39:48 +08:00
mono_item.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
target_features.rs std: Stabilize wasm simd intrinsics 2021-06-10 19:42:05 -07:00