-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debuginfo: split method declaration and definition #111167
Conversation
When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration.
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
Nominating for 1.70-beta, because in Fedora we ran into the @rustbot label +beta-nominated |
…michaelwoerister debuginfo: split method declaration and definition When we're adding a method to a type DIE, we only want a DW_AT_declaration there, because LLVM LTO can't unify type definitions when a child DIE is a full subprogram definition. Now the subprogram definition gets added at the CU level with a specification link back to the abstract declaration. Both GCC and Clang write debuginfo this way for C++ class methods. Fixes rust-lang#109730. Fixes rust-lang#109934.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#110577 (Use fulfillment to check `Drop` impl compatibility) - rust-lang#110610 (Add Terminator conversion from MIR to SMIR, part #1) - rust-lang#110985 (Fix spans in LLVM-generated inline asm errors) - rust-lang#110989 (Make the BUG_REPORT_URL configurable by tools ) - rust-lang#111167 (debuginfo: split method declaration and definition) - rust-lang#111230 (add hint for =< as <=) - rust-lang#111279 (More robust debug assertions for `Instance::resolve` on built-in traits with non-standard trait items) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Will rust 1.69.1 release soon? Because this patch cannot be applied to 1.69.0 tarball without modification. |
I wasn't thinking of proposing this for 1.69-stable, since the official release using LLVM 15 didn't suffer that "cannot represent a difference across sections" error. You can use the backport patch I applied in Fedora though: |
This reverts rust-lang#46722, commit e0ab5d5. Since rust-lang#111167, commit 10b69dd, we are generating DWARF subprograms in a way that is meant to be more compatible with LLVM's expectations, so hopefully we don't need this workaround rewriting CUs anymore.
Remove the ThinLTO CU hack This reverts rust-lang#46722, commit e0ab5d5. Since rust-lang#111167, commit 10b69dd, we are generating DWARF subprograms in a way that is meant to be more compatible with LLVM's expectations, so hopefully we don't need this workaround rewriting CUs anymore.
[beta] backport - debuginfo: split method declaration and definition rust-lang#111167 - Encode VariantIdx so we can decode ADT variants in the right order rust-lang#111494 - Simplify find_width_of_character_at_span. rust-lang#111560 r? cuviper
…isubprogram, r=cuviper DebugInfo: Updates test cases that add method declarations. We've investigated one reason why debugging information often goes wrong at https://reviews.llvm.org/D152095. > LLVM can't handle IR where subprogram definitions are nested within DICompositeType when doing LTO builds, because there's no good way to cross the CU boundary to insert a nested DISubprogram definition in one CU into a type defined in another CU. In rust-lang#111167, we added a declaration for the DISubprogram for the method. This PR completes this test case. stream history: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Dwarf.20CUs/near/384269475.
When we're adding a method to a type DIE, we only want a DW_AT_declaration
there, because LLVM LTO can't unify type definitions when a child DIE is a
full subprogram definition. Now the subprogram definition gets added at the
CU level with a specification link back to the abstract declaration.
Both GCC and Clang write debuginfo this way for C++ class methods.
Fixes #109730.
Fixes #109934.