]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Clear source positions where they'd confuse LLVM otherwise.
authorMichael Woerister <michaelwoerister@gmail>
Fri, 13 Dec 2013 11:27:22 +0000 (12:27 +0100)
committerMichael Woerister <michaelwoerister@gmail>
Mon, 16 Dec 2013 09:23:28 +0000 (10:23 +0100)
src/librustc/middle/trans/base.rs

index d829236a4dc5271a7bc17cc8377a52012188d653..00cd3d864372eb4f85dee9a997ddc17506d393ed 100644 (file)
@@ -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();
 }