librustc: De-@mut
CrateContext::type_hashcodes
This commit is contained in:
parent
a1747a6091
commit
25337a7f9f
@ -521,14 +521,18 @@ pub fn symbol_hash(tcx: ty::ctxt,
|
||||
}
|
||||
|
||||
pub fn get_symbol_hash(ccx: &mut CrateContext, t: ty::t) -> @str {
|
||||
match ccx.type_hashcodes.find(&t) {
|
||||
Some(&h) => h,
|
||||
None => {
|
||||
let hash = symbol_hash(ccx.tcx, &mut ccx.symbol_hasher, t, &ccx.link_meta);
|
||||
ccx.type_hashcodes.insert(t, hash);
|
||||
hash
|
||||
}
|
||||
{
|
||||
let type_hashcodes = ccx.type_hashcodes.borrow();
|
||||
match type_hashcodes.get().find(&t) {
|
||||
Some(&h) => return h,
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
let mut type_hashcodes = ccx.type_hashcodes.borrow_mut();
|
||||
let hash = symbol_hash(ccx.tcx, &mut ccx.symbol_hasher, t, &ccx.link_meta);
|
||||
type_hashcodes.get().insert(t, hash);
|
||||
hash
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ pub struct CrateContext {
|
||||
llsizingtypes: RefCell<HashMap<ty::t, Type>>,
|
||||
adt_reprs: RefCell<HashMap<ty::t, @adt::Repr>>,
|
||||
symbol_hasher: Sha256,
|
||||
type_hashcodes: HashMap<ty::t, @str>,
|
||||
type_hashcodes: RefCell<HashMap<ty::t, @str>>,
|
||||
type_short_names: HashMap<ty::t, ~str>,
|
||||
all_llvm_symbols: HashSet<@str>,
|
||||
tcx: ty::ctxt,
|
||||
@ -207,7 +207,7 @@ pub fn new(sess: session::Session,
|
||||
llsizingtypes: RefCell::new(HashMap::new()),
|
||||
adt_reprs: RefCell::new(HashMap::new()),
|
||||
symbol_hasher: symbol_hasher,
|
||||
type_hashcodes: HashMap::new(),
|
||||
type_hashcodes: RefCell::new(HashMap::new()),
|
||||
type_short_names: HashMap::new(),
|
||||
all_llvm_symbols: HashSet::new(),
|
||||
tcx: tcx,
|
||||
|
Loading…
Reference in New Issue
Block a user