Skip to content

Commit 26bd0f9

Browse files
committed
---
yaml --- r: 147608 b: refs/heads/try2 c: 13e1bf1 h: refs/heads/master v: v3
1 parent a22a1e5 commit 26bd0f9

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: a74138ed2253b792760f1fa6ab88d6b3d28a07e9
8+
refs/heads/try2: 13e1bf1881f2523edd315a73412f74339a2168db
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ struct FunctionDebugContextData {
251251
scope_map: RefCell<HashMap<ast::NodeId, DIScope>>,
252252
fn_metadata: DISubprogram,
253253
argument_counter: Cell<uint>,
254-
source_locations_enabled: bool,
254+
source_locations_enabled: Cell<bool>,
255255
}
256256

257257
enum VariableAccess<'a> {
@@ -569,7 +569,7 @@ pub fn set_source_location(fcx: &FunctionContext,
569569

570570
debug!("set_source_location: {}", cx.sess.codemap.span_to_str(span));
571571

572-
if fcx.debug_context.get_ref(cx, span).source_locations_enabled {
572+
if fcx.debug_context.get_ref(cx, span).source_locations_enabled.get() {
573573
let loc = span_start(cx, span);
574574
let scope = scope_metadata(fcx, node_id, span);
575575

@@ -598,7 +598,9 @@ pub fn clear_source_location(fcx: &FunctionContext) {
598598
/// translated.
599599
pub fn start_emitting_source_locations(fcx: &mut FunctionContext) {
600600
match fcx.debug_context {
601-
FunctionDebugContext(~ref mut data) => data.source_locations_enabled = true,
601+
FunctionDebugContext(~ref mut data) => {
602+
data.source_locations_enabled.set(true)
603+
},
602604
_ => { /* safe to ignore */ }
603605
}
604606
}
@@ -765,7 +767,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
765767
scope_map: RefCell::new(HashMap::new()),
766768
fn_metadata: fn_metadata,
767769
argument_counter: Cell::new(1),
768-
source_locations_enabled: false,
770+
source_locations_enabled: Cell::new(false),
769771
};
770772

771773
let arg_pats = fn_decl.inputs.map(|arg_ref| arg_ref.pat);
@@ -1049,7 +1051,11 @@ fn declare_local(bcx: @Block,
10491051

10501052
match variable_kind {
10511053
ArgumentVariable(_) | CapturedVariable => {
1052-
assert!(!bcx.fcx.debug_context.get_ref(cx, span).source_locations_enabled);
1054+
assert!(!bcx.fcx
1055+
.debug_context
1056+
.get_ref(cx, span)
1057+
.source_locations_enabled
1058+
.get());
10531059
set_debug_location(cx, UnknownLocation);
10541060
}
10551061
_ => { /* nothing to do */ }

0 commit comments

Comments
 (0)