mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
debuginfo: slices are DW_TAG_array_type's Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like `Rc<str>` (eg rust-lang/rust#114195). Specifically, these three structs would have essentially the same debug info (modulo some names): ```rust struct Foo { a: u32, s: str } // unsized struct Bar { a: u32, s: [u8] } // unsized struct Baz { a: u32, s: u8 } ``` This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.
The codegen crate contains the code to convert from MIR into LLVM IR,
and then from LLVM IR into machine code. In general it contains code
that runs towards the end of the compilation process.
For more information about how codegen works, see the rustc dev guide.