about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@gmail>2013-12-13 12:27:22 +0100
committerMichael Woerister <michaelwoerister@gmail>2013-12-16 10:23:28 +0100
commit184d39414d779b620fec719cbd8308960634b277 (patch)
tree7dcfd438a8499061b8e9729ec647532ef6911116
parent08bc0721415c54033dbd64934b2b3d10835fce36 (diff)
downloadrust-184d39414d779b620fec719cbd8308960634b277.tar.gz
rust-184d39414d779b620fec719cbd8308960634b277.zip
debuginfo: Clear source positions where they'd confuse LLVM otherwise.
-rw-r--r--src/librustc/middle/trans/base.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index d829236a4dc..00cd3d86437 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();
 }