Skip to content

Commit 6326ff4

Browse files
committed
---
yaml --- r: 56791 b: refs/heads/try c: 10d930d h: refs/heads/master i: 56789: 7f6effd 56787: 7b9a42d 56783: 1554c31 v: v3
1 parent 5296d54 commit 6326ff4

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: cf22d749eb9717e1e5befa727db5a9f7c47e8f48
5+
refs/heads/try: 10d930d51ea6a00349c08b53ecf6ffb1ee514219
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ impl get_insn_ctxt for fn_ctxt {
131131
}
132132
}
133133

134+
fn fcx_has_nonzero_span(fcx: fn_ctxt) -> bool {
135+
match fcx.span {
136+
None => true,
137+
Some(span) => *span.lo != 0 || *span.hi != 0
138+
}
139+
}
140+
134141
pub fn log_fn_time(ccx: @CrateContext, +name: ~str, start: time::Timespec,
135142
end: time::Timespec) {
136143
let elapsed = 1000 * ((end.sec - start.sec) as int) +
@@ -1158,7 +1165,8 @@ pub fn trans_stmt(cx: block, s: ast::stmt) -> block {
11581165
ast::decl_local(ref locals) => {
11591166
for locals.each |local| {
11601167
bcx = init_local(bcx, *local);
1161-
if cx.sess().opts.extra_debuginfo {
1168+
if cx.sess().opts.extra_debuginfo
1169+
&& fcx_has_nonzero_span(bcx.fcx) {
11621170
debuginfo::create_local_var(bcx, *local);
11631171
}
11641172
}
@@ -1738,7 +1746,7 @@ pub fn copy_args_to_allocas(fcx: fn_ctxt,
17381746
17391747
fcx.llargs.insert(arg_id, local_mem(llarg));
17401748
1741-
if fcx.ccx.sess.opts.extra_debuginfo {
1749+
if fcx.ccx.sess.opts.extra_debuginfo && fcx_has_nonzero_span(fcx) {
17421750
debuginfo::create_arg(bcx, args[arg_n], args[arg_n].ty.span);
17431751
}
17441752
}
@@ -1861,7 +1869,8 @@ pub fn trans_fn(ccx: @CrateContext,
18611869
trans_closure(ccx, path, decl, body, llfndecl, ty_self,
18621870
param_substs, id, impl_id,
18631871
|fcx| {
1864-
if ccx.sess.opts.extra_debuginfo {
1872+
if ccx.sess.opts.extra_debuginfo
1873+
&& fcx_has_nonzero_span(fcx) {
18651874
debuginfo::create_function(fcx);
18661875
}
18671876
},

branches/try/src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ pub fn create_arg(bcx: block, arg: ast::arg, sp: span)
946946
}
947947
948948
pub fn update_source_pos(cx: block, s: span) {
949-
if !cx.sess().opts.debuginfo {
949+
if !cx.sess().opts.debuginfo || (*s.lo == 0 && *s.hi == 0) {
950950
return;
951951
}
952952
let cm = cx.sess().codemap;

0 commit comments

Comments
 (0)