Skip to content

Commit 72fbae4

Browse files
committed
---
yaml --- r: 96997 b: refs/heads/dist-snap c: 61768de h: refs/heads/master i: 96995: 88baff5 v: v3
1 parent b201146 commit 72fbae4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d2bcd1462fa515ead889ecc49c70b00513798f43
9+
refs/heads/dist-snap: 61768de5e9d29125239a2485f508ea0663e8a94f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#[allow(non_uppercase_pattern_statics)];
1212

1313
use std::c_str::ToCStr;
14+
use std::cell::RefCell;
1415
use std::hashmap::HashMap;
1516
use std::libc::{c_uint, c_ushort, c_void, free};
1617
use std::str::raw::from_c_str;
@@ -1804,22 +1805,24 @@ pub fn SetFunctionAttribute(Fn: ValueRef, attr: Attribute) {
18041805
/* Memory-managed object interface to type handles. */
18051806

18061807
pub struct TypeNames {
1807-
named_types: HashMap<~str, TypeRef>
1808+
named_types: RefCell<HashMap<~str, TypeRef>>,
18081809
}
18091810

18101811
impl TypeNames {
18111812
pub fn new() -> TypeNames {
18121813
TypeNames {
1813-
named_types: HashMap::new()
1814+
named_types: RefCell::new(HashMap::new())
18141815
}
18151816
}
18161817

1817-
pub fn associate_type(&mut self, s: &str, t: &Type) {
1818-
assert!(self.named_types.insert(s.to_owned(), t.to_ref()));
1818+
pub fn associate_type(&self, s: &str, t: &Type) {
1819+
let mut named_types = self.named_types.borrow_mut();
1820+
assert!(named_types.get().insert(s.to_owned(), t.to_ref()));
18191821
}
18201822

18211823
pub fn find_type(&self, s: &str) -> Option<Type> {
1822-
self.named_types.find_equiv(&s).map(|x| Type::from_ref(*x))
1824+
let named_types = self.named_types.borrow();
1825+
named_types.get().find_equiv(&s).map(|x| Type::from_ref(*x))
18231826
}
18241827

18251828
pub fn type_to_str(&self, ty: Type) -> ~str {

branches/dist-snap/src/librustc/middle/trans/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl CrateContext {
147147
let targ_cfg = sess.targ_cfg;
148148

149149
let td = mk_target_data(sess.targ_cfg.target_strs.data_layout);
150-
let mut tn = TypeNames::new();
150+
let tn = TypeNames::new();
151151

152152
let mut intrinsics = base::declare_intrinsics(llmod);
153153
if sess.opts.extra_debuginfo {

0 commit comments

Comments
 (0)