Skip to content

Commit 846c6ba

Browse files
committed
---
yaml --- r: 147537 b: refs/heads/try2 c: 61768de h: refs/heads/master i: 147535: 7de5156 v: v3
1 parent 5b61d07 commit 846c6ba

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
@@ -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: d2bcd1462fa515ead889ecc49c70b00513798f43
8+
refs/heads/try2: 61768de5e9d29125239a2485f508ea0663e8a94f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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)