librustc: De-@mut CrateContext::all_llvm_symbols

This commit is contained in:
Patrick Walton 2013-12-18 18:07:16 -08:00
parent b895ba52bc
commit 02bdda2776
2 changed files with 5 additions and 4 deletions

View File

@ -507,10 +507,11 @@ pub fn set_no_split_stack(f: ValueRef) {
// Double-check that we never ask LLVM to declare the same symbol twice. It
// silently mangles such symbols, breaking our linkage model.
pub fn note_unique_llvm_symbol(ccx: &mut CrateContext, sym: @str) {
if ccx.all_llvm_symbols.contains(&sym) {
let mut all_llvm_symbols = ccx.all_llvm_symbols.borrow_mut();
if all_llvm_symbols.get().contains(&sym) {
ccx.sess.bug(~"duplicate LLVM symbol: " + sym);
}
ccx.all_llvm_symbols.insert(sym);
all_llvm_symbols.get().insert(sym);
}

View File

@ -97,7 +97,7 @@ pub struct CrateContext {
adt_reprs: RefCell<HashMap<ty::t, @adt::Repr>>,
symbol_hasher: Sha256,
type_hashcodes: RefCell<HashMap<ty::t, @str>>,
all_llvm_symbols: HashSet<@str>,
all_llvm_symbols: RefCell<HashSet<@str>>,
tcx: ty::ctxt,
maps: astencode::Maps,
stats: @mut Stats,
@ -207,7 +207,7 @@ impl CrateContext {
adt_reprs: RefCell::new(HashMap::new()),
symbol_hasher: symbol_hasher,
type_hashcodes: RefCell::new(HashMap::new()),
all_llvm_symbols: HashSet::new(),
all_llvm_symbols: RefCell::new(HashSet::new()),
tcx: tcx,
maps: maps,
stats: @mut Stats {