Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debuginfo: Make sure that all calls to drop glue are associated with …
…debug locations. This commit makes rustc emit debug locations for all call and invoke statements in LLVM IR, if they are contained within a function that debuginfo is enabled for. This is important because LLVM does not handle the case where a function body containing debuginfo is inlined into another function with debuginfo, but the inlined call statement does not have a debug location. In this case, LLVM will not know where (in terms of source code coordinates) the function was inlined to and we end up with some statements still linked to the source locations in there original, non-inlined function without any indication that they are indeed an inline-copy. Later, when generating DWARF from the IR, LLVM will interpret this as corrupt IR and abort. Unfortunately, the undesirable case described above can still occur when using LTO. If there is a crate compiled without debuginfo calling into a crate compiled with debuginfo, we again end up with the conditions triggering the error. This is why some LTO tests still fail with the dreaded assertion, if the standard library was built with debuginfo enabled. That is, `RUSTFLAGS_STAGE2=-g make rustc-stage2` will succeed but `RUSTFLAGS_STAGE2=-g make check` will still fail after this commit has been merged. This is a problem that has to be dealt with separately. Fixes #17201 Fixes #15816 Fixes #15156
- Loading branch information
1 parent
d299baf
commit 302486e
Showing
10 changed files
with
284 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
302486e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from luqmana
at michaelwoerister@302486e
302486e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging michaelwoerister/rust/function-call-locs = 302486e into auto
302486e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
michaelwoerister/rust/function-call-locs = 302486e merged ok, testing candidate = 496b68d
302486e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1575
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1572
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1566
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1572
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1569
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1568
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1568
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1572
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1566
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1565
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1568
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1223
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/1221
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/1224
success: http://buildbot.rust-lang.org/builders/auto-win-64-opt/builds/57
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-t/builds/55
success: http://buildbot.rust-lang.org/builders/auto-win-64-nopt-c/builds/56
302486e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 496b68d