Skip to content

Commit 184d394

Browse files
debuginfo: Clear source positions where they'd confuse LLVM otherwise.
1 parent 08bc072 commit 184d394

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,7 @@ pub fn alloca_maybe_zeroed(cx: @mut Block, ty: Type, name: &str, zero: bool) ->
15511551
return llvm::LLVMGetUndef(ty.ptr_to().to_ref());
15521552
}
15531553
}
1554+
debuginfo::clear_source_location(cx.fcx);
15541555
let p = Alloca(cx, ty, name);
15551556
if zero {
15561557
let b = cx.fcx.ccx.builder();
@@ -1567,6 +1568,7 @@ pub fn arrayalloca(cx: @mut Block, ty: Type, v: ValueRef) -> ValueRef {
15671568
return llvm::LLVMGetUndef(ty.to_ref());
15681569
}
15691570
}
1571+
debuginfo::clear_source_location(cx.fcx);
15701572
return ArrayAlloca(cx, ty, v);
15711573
}
15721574

@@ -1810,6 +1812,7 @@ pub fn finish_fn(fcx: @mut FunctionContext, last_bcx: @mut Block) {
18101812
None => last_bcx
18111813
};
18121814
build_return_block(fcx, ret_cx);
1815+
debuginfo::clear_source_location(fcx);
18131816
fcx.cleanup();
18141817
}
18151818

0 commit comments

Comments
 (0)