mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
librustc: De-@mut
llvm_insns
in the stats
This commit is contained in:
parent
8c3a552ac5
commit
e84f79feb1
@ -3268,7 +3268,8 @@ pub fn trans_crate(sess: session::Session,
|
||||
}
|
||||
}
|
||||
if ccx.sess.count_llvm_insns() {
|
||||
for (k, v) in ccx.stats.llvm_insns.iter() {
|
||||
let llvm_insns = ccx.stats.llvm_insns.borrow();
|
||||
for (k, v) in llvm_insns.get().iter() {
|
||||
println!("{:7u} {}", *v, *k);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ impl Builder {
|
||||
}
|
||||
if self.ccx.sess.count_llvm_insns() {
|
||||
base::with_insn_ctxt(|v| {
|
||||
let h = &mut self.ccx.stats.llvm_insns;
|
||||
let mut h = self.ccx.stats.llvm_insns.borrow_mut();
|
||||
|
||||
// Build version of path with cycles removed.
|
||||
|
||||
@ -82,11 +82,11 @@ impl Builder {
|
||||
s.push_char('/');
|
||||
s.push_str(category);
|
||||
|
||||
let n = match h.find(&s) {
|
||||
let n = match h.get().find(&s) {
|
||||
Some(&n) => n,
|
||||
_ => 0u
|
||||
};
|
||||
h.insert(s, n+1u);
|
||||
h.get().insert(s, n+1u);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ pub struct Stats {
|
||||
n_inlines: Cell<uint>,
|
||||
n_closures: Cell<uint>,
|
||||
n_llvm_insns: Cell<uint>,
|
||||
llvm_insns: HashMap<~str, uint>,
|
||||
llvm_insns: RefCell<HashMap<~str, uint>>,
|
||||
fn_stats: ~[(~str, uint, uint)] // (ident, time-in-ms, llvm-instructions)
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ impl CrateContext {
|
||||
n_inlines: Cell::new(0u),
|
||||
n_closures: Cell::new(0u),
|
||||
n_llvm_insns: Cell::new(0u),
|
||||
llvm_insns: HashMap::new(),
|
||||
llvm_insns: RefCell::new(HashMap::new()),
|
||||
fn_stats: ~[]
|
||||
},
|
||||
tydesc_type: tydesc_type,
|
||||
|
Loading…
Reference in New Issue
Block a user