rustc: Write names of local variables into the LLVM IR when debug mode is on

This commit is contained in:
Patrick Walton 2011-07-15 16:40:04 -07:00
parent fafb42e6b1
commit 6e114a367f

View File

@ -6743,6 +6743,9 @@ fn alloc_ty(&@block_ctxt cx, &ty::t t) -> result {
fn alloc_local(&@block_ctxt cx, &@ast::local local) -> result {
auto t = node_id_type(cx.fcx.lcx.ccx, local.node.id);
auto r = alloc_ty(cx, t);
if (cx.fcx.lcx.ccx.sess.get_opts().debuginfo) {
llvm::LLVMSetValueName(r.val, str::buf(local.node.ident));
}
r.bcx.fcx.lllocals.insert(local.node.id, r.val);
ret r;
}