@@ -142,7 +142,7 @@ use middle::pat_util;
142
142
use util:: ppaux;
143
143
144
144
use std:: c_str:: ToCStr ;
145
- use std:: cell:: RefCell ;
145
+ use std:: cell:: { Cell , RefCell } ;
146
146
use std:: hashmap:: HashMap ;
147
147
use std:: hashmap:: HashSet ;
148
148
use std:: libc:: { c_uint, c_ulonglong, c_longlong} ;
@@ -175,7 +175,7 @@ pub struct CrateDebugContext {
175
175
priv crate_file : ~str ,
176
176
priv llcontext : ContextRef ,
177
177
priv builder : DIBuilderRef ,
178
- priv current_debug_location : DebugLocation ,
178
+ priv current_debug_location : Cell < DebugLocation > ,
179
179
priv created_files : RefCell < HashMap < ~str , DIFile > > ,
180
180
priv created_types : RefCell < HashMap < uint , DIType > > ,
181
181
priv namespace_map : RefCell < HashMap < ~[ ast:: Ident ] , @NamespaceTreeNode > > ,
@@ -194,7 +194,7 @@ impl CrateDebugContext {
194
194
crate_file: crate ,
195
195
llcontext : llcontext,
196
196
builder : builder,
197
- current_debug_location : UnknownLocation ,
197
+ current_debug_location : Cell :: new ( UnknownLocation ) ,
198
198
created_files : RefCell :: new ( HashMap :: new ( ) ) ,
199
199
created_types : RefCell :: new ( HashMap :: new ( ) ) ,
200
200
namespace_map : RefCell :: new ( HashMap :: new ( ) ) ,
@@ -2193,7 +2193,7 @@ impl DebugLocation {
2193
2193
}
2194
2194
2195
2195
fn set_debug_location ( cx : & mut CrateContext , debug_location : DebugLocation ) {
2196
- if debug_location == debug_context ( cx) . current_debug_location {
2196
+ if debug_location == debug_context ( cx) . current_debug_location . get ( ) {
2197
2197
return ;
2198
2198
}
2199
2199
@@ -2220,7 +2220,7 @@ fn set_debug_location(cx: &mut CrateContext, debug_location: DebugLocation) {
2220
2220
llvm:: LLVMSetCurrentDebugLocation ( cx. builder . B , metadata_node) ;
2221
2221
}
2222
2222
2223
- debug_context ( cx) . current_debug_location = debug_location;
2223
+ debug_context ( cx) . current_debug_location . set ( debug_location) ;
2224
2224
}
2225
2225
2226
2226
//=-------------------------------------------------------------------------------------------------
0 commit comments