From 184d39414d779b620fec719cbd8308960634b277 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 13 Dec 2013 12:27:22 +0100 Subject: [PATCH] debuginfo: Clear source positions where they'd confuse LLVM otherwise. --- src/librustc/middle/trans/base.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index d829236a4dc5..00cd3d864372 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -1551,6 +1551,7 @@ pub fn alloca_maybe_zeroed(cx: @mut Block, ty: Type, name: &str, zero: bool) -> return llvm::LLVMGetUndef(ty.ptr_to().to_ref()); } } + debuginfo::clear_source_location(cx.fcx); let p = Alloca(cx, ty, name); if zero { let b = cx.fcx.ccx.builder(); @@ -1567,6 +1568,7 @@ pub fn arrayalloca(cx: @mut Block, ty: Type, v: ValueRef) -> ValueRef { return llvm::LLVMGetUndef(ty.to_ref()); } } + debuginfo::clear_source_location(cx.fcx); return ArrayAlloca(cx, ty, v); } @@ -1810,6 +1812,7 @@ pub fn finish_fn(fcx: @mut FunctionContext, last_bcx: @mut Block) { None => last_bcx }; build_return_block(fcx, ret_cx); + debuginfo::clear_source_location(fcx); fcx.cleanup(); }