rust/compiler/rustc_codegen_llvm/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 Add first cut of functionality for #58713: support for #[link(kind = "raw-dylib")]. 2021-06-04 18:01:35 -07:00
coverageinfo Auto merge of #85178 - cjgillot:local-crate, r=oli-obk 2021-05-17 01:42:03 +00:00
debuginfo Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger 2021-06-30 11:10:29 -07:00
llvm Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
abi.rs Enable mutable noalias by default for LLVM 12 2021-03-21 20:10:54 +01:00
allocator.rs Remove redundant to_string calls 2021-02-17 11:25:55 +01:00
asm.rs Add support for BPF inline assembly 2021-05-23 18:03:27 +10:00
attributes.rs Add support for leaf fn frame pointer elimination 2021-06-30 19:45:17 +03:00
base.rs Drop metadata_encoding_version. 2021-06-01 21:12:27 +02:00
builder.rs Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
callee.rs Fix static relocation model for PowerPC64 2021-05-28 03:48:39 +02:00
common.rs Update other codegens to use tcx managed vtable allocations. 2021-06-28 19:39:48 +08:00
consts.rs Fix static relocation model for PowerPC64 2021-05-28 03:48:39 +02:00
context.rs Add support for leaf fn frame pointer elimination 2021-06-30 19:45:17 +03:00
declare.rs Make declare_cfn more flexible 2021-01-23 17:19:49 -05:00
intrinsic.rs Add support for leaf fn frame pointer elimination 2021-06-30 19:45:17 +03:00
lib.rs Update to new bootstrap compiler 2021-06-28 11:30:49 -04:00
llvm_util.rs Remove dropping of loaded plugins and better debug info 2021-06-26 19:30:09 +02:00
mono_item.rs Fix static relocation model for PowerPC64 2021-05-28 03:48:39 +02:00
type_.rs Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
type_of.rs Revert "cg_llvm: fewer_names in uncached_llvm_type" 2020-12-17 16:40:47 +00:00
va_arg.rs Add big-endian support for AArch64 va_arg 2021-01-27 22:47:56 +00:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00