Skip to content

Commit a0d6313

Browse files
committed
---
yaml --- r: 90740 b: refs/heads/master c: 6ac286b h: refs/heads/master v: v3
1 parent 5c2c0de commit a0d6313

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fc92f92572c0b87e17eb4c3b289a0d47c0a7bf8f
2+
refs/heads/master: 6ac286b518c8a0db9753ffd188326234457a4719
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/src/librustc/middle/trans/debuginfo.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ use middle::pat_util;
142142
use util::ppaux;
143143

144144
use std::c_str::ToCStr;
145+
use std::cell::RefCell;
145146
use std::hashmap::HashMap;
146147
use std::hashmap::HashSet;
147148
use std::libc::{c_uint, c_ulonglong, c_longlong};
@@ -175,7 +176,7 @@ pub struct CrateDebugContext {
175176
priv llcontext: ContextRef,
176177
priv builder: DIBuilderRef,
177178
priv current_debug_location: DebugLocation,
178-
priv created_files: HashMap<~str, DIFile>,
179+
priv created_files: RefCell<HashMap<~str, DIFile>>,
179180
priv created_types: HashMap<uint, DIType>,
180181
priv namespace_map: HashMap<~[ast::Ident], @NamespaceTreeNode>,
181182
// This collection is used to assert that composite types (structs, enums, ...) have their
@@ -194,7 +195,7 @@ impl CrateDebugContext {
194195
llcontext: llcontext,
195196
builder: builder,
196197
current_debug_location: UnknownLocation,
197-
created_files: HashMap::new(),
198+
created_files: RefCell::new(HashMap::new()),
198199
created_types: HashMap::new(),
199200
namespace_map: HashMap::new(),
200201
composite_types_completed: HashSet::new(),
@@ -1031,9 +1032,12 @@ fn declare_local(bcx: @Block,
10311032
}
10321033

10331034
fn file_metadata(cx: &mut CrateContext, full_path: &str) -> DIFile {
1034-
match debug_context(cx).created_files.find_equiv(&full_path) {
1035-
Some(file_metadata) => return *file_metadata,
1036-
None => ()
1035+
{
1036+
let created_files = debug_context(cx).created_files.borrow();
1037+
match created_files.get().find_equiv(&full_path) {
1038+
Some(file_metadata) => return *file_metadata,
1039+
None => ()
1040+
}
10371041
}
10381042

10391043
debug!("file_metadata: {}", full_path);
@@ -1056,7 +1060,8 @@ fn file_metadata(cx: &mut CrateContext, full_path: &str) -> DIFile {
10561060
})
10571061
});
10581062

1059-
debug_context(cx).created_files.insert(full_path.to_owned(), file_metadata);
1063+
let mut created_files = debug_context(cx).created_files.borrow_mut();
1064+
created_files.get().insert(full_path.to_owned(), file_metadata);
10601065
return file_metadata;
10611066
}
10621067

0 commit comments

Comments
 (0)