Skip to content

Commit fa6d871

Browse files
committed
Build fix.
1 parent e383004 commit fa6d871

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/comp/middle/debuginfo.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ fn get_ty_metadata(cx: @crate_ctxt, t: ty::t, ty: @ast::ty) -> @metadata<tydesc_
253253
let llnode = llmdnode(lldata);
254254
let mdval = @{node: llnode, data: {hash: ty::hash_ty(t)}};
255255
update_cache(cache, BasicTypeDescriptorTag, tydesc_metadata(mdval));
256+
llvm::LLVMAddNamedMetadataOperand(cx.llmod, as_buf("llvm.dbg.ty"),
257+
str::byte_len("llvm.dbg.ty"),
258+
llnode);
256259
ret mdval;
257260
}
258261

@@ -295,21 +298,21 @@ fn get_local_var_metadata(bcx: @block_ctxt, local: @ast::local)
295298
}
296299
};
297300
let declargs = [llmdnode([llptr]), mdnode];
298-
let instr = trans_build::Call(bcx, cx.intrinsics.get("llvm.dbg.declare"),
299-
declargs);
301+
trans_build::Call(bcx, cx.intrinsics.get("llvm.dbg.declare"),
302+
declargs);
300303
llvm::LLVMAddNamedMetadataOperand(cx.llmod, as_buf("llvm.dbg.vars"),
301304
str::byte_len("llvm.dbg.vars"),
302305
mdnode);
303306
ret mdval;
304307
}
305308

306-
fn update_source_pos<T>(cx: @block_ctxt, s: T) {
309+
fn update_source_pos(cx: @block_ctxt, s: codemap::span) {
307310
if !bcx_ccx(cx).sess.get_opts().debuginfo {
308311
ret;
309312
}
310313
cx.source_pos = option::some(
311314
codemap::lookup_char_pos(bcx_ccx(cx).sess.get_codemap(),
312-
s.span.lo)); //XXX maybe hi
315+
s.lo)); //XXX maybe hi
313316

314317
}
315318

src/comp/middle/trans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,7 +3519,7 @@ fn trans_temp_expr(bcx: @block_ctxt, e: @ast::expr) -> result {
35193519
// - exprs with non-immediate type never get dest=by_val
35203520
fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
35213521
let tcx = bcx_tcx(bcx);
3522-
debuginfo::update_source_pos(bcx, e);
3522+
debuginfo::update_source_pos(bcx, e.span);
35233523

35243524
if expr_is_lval(bcx, e) {
35253525
ret lval_to_dps(bcx, e, dest);
@@ -4014,7 +4014,7 @@ fn trans_stmt(cx: @block_ctxt, s: ast::stmt) -> @block_ctxt {
40144014
}
40154015

40164016
let bcx = cx;
4017-
debuginfo::update_source_pos(cx, s);
4017+
debuginfo::update_source_pos(cx, s.span);
40184018

40194019
alt s.node {
40204020
ast::stmt_expr(e, _) { bcx = trans_expr(cx, e, ignore); }
@@ -4263,7 +4263,7 @@ fn trans_block(bcx: @block_ctxt, b: ast::blk) -> @block_ctxt {
42634263
fn trans_block_dps(bcx: @block_ctxt, b: ast::blk, dest: dest)
42644264
-> @block_ctxt {
42654265
let bcx = bcx;
4266-
debuginfo::update_source_pos(bcx, b);
4266+
debuginfo::update_source_pos(bcx, b.span);
42674267
block_locals(b) {|local| bcx = alloc_local(bcx, local); };
42684268
for s: @ast::stmt in b.node.stmts {
42694269
bcx = trans_stmt(bcx, *s);

0 commit comments

Comments
 (0)