librustc: De-@mut n_llvm_insns in the stats
This commit is contained in:
parent
21e4e410a9
commit
97ceac7377
4 changed files with 9 additions and 6 deletions
|
|
@ -146,7 +146,7 @@ impl<'a> StatRecorder<'a> {
|
|||
} else {
|
||||
0
|
||||
};
|
||||
let istart = ccx.stats.n_llvm_insns;
|
||||
let istart = ccx.stats.n_llvm_insns.get();
|
||||
StatRecorder {
|
||||
ccx: ccx,
|
||||
name: name,
|
||||
|
|
@ -162,13 +162,13 @@ impl<'a> Drop for StatRecorder<'a> {
|
|||
if self.ccx.sess.trans_stats() {
|
||||
let end = time::precise_time_ns();
|
||||
let elapsed = ((end - self.start) / 1_000_000) as uint;
|
||||
let iend = self.ccx.stats.n_llvm_insns;
|
||||
let iend = self.ccx.stats.n_llvm_insns.get();
|
||||
self.ccx.stats.fn_stats.push((self.name.to_owned(),
|
||||
elapsed,
|
||||
iend - self.istart));
|
||||
self.ccx.stats.n_fns.set(self.ccx.stats.n_fns.get() + 1);
|
||||
// Reset LLVM insn count to avoid compound costs.
|
||||
self.ccx.stats.n_llvm_insns = self.istart;
|
||||
self.ccx.stats.n_llvm_insns.set(self.istart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,10 @@ impl Builder {
|
|||
|
||||
pub fn count_insn(&self, category: &str) {
|
||||
if self.ccx.sess.trans_stats() {
|
||||
self.ccx.stats.n_llvm_insns += 1;
|
||||
self.ccx.stats.n_llvm_insns.set(self.ccx
|
||||
.stats
|
||||
.n_llvm_insns
|
||||
.get() + 1);
|
||||
}
|
||||
if self.ccx.sess.count_llvm_insns() {
|
||||
base::with_insn_ctxt(|v| {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ pub struct Stats {
|
|||
n_monos: Cell<uint>,
|
||||
n_inlines: Cell<uint>,
|
||||
n_closures: Cell<uint>,
|
||||
n_llvm_insns: uint,
|
||||
n_llvm_insns: Cell<uint>,
|
||||
llvm_insn_ctxt: ~[~str],
|
||||
llvm_insns: HashMap<~str, uint>,
|
||||
fn_stats: ~[(~str, uint, uint)] // (ident, time-in-ms, llvm-instructions)
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ impl CrateContext {
|
|||
n_monos: Cell::new(0u),
|
||||
n_inlines: Cell::new(0u),
|
||||
n_closures: Cell::new(0u),
|
||||
n_llvm_insns: 0u,
|
||||
n_llvm_insns: Cell::new(0u),
|
||||
llvm_insn_ctxt: ~[],
|
||||
llvm_insns: HashMap::new(),
|
||||
fn_stats: ~[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue