auto merge of #17533 : michaelwoerister/rust/function-call-locs, r=luqmana

This PR 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 PR has been merged. I will open a separate issue for this problem.
This commit is contained in:
bors 2014-09-29 01:03:06 +00:00
commit 496b68d485
10 changed files with 285 additions and 74 deletions

View file

@ -130,8 +130,8 @@ fn main() {
let i32_val: i32 = -32;
let i32_ref: &i32 = &i32_val;
let uint_val: i64 = -64;
let i64_ref: &i64 = &uint_val;
let i64_val: i64 = -64;
let i64_ref: &i64 = &i64_val;
let uint_val: uint = 1;
let uint_ref: &uint = &uint_val;