Skip to content

Commit 21e4e41

Browse files
committed
librustc: De-@mut n_closures in the stats
1 parent c010d08 commit 21e4e41

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/librustc/middle/trans/base.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,8 @@ pub fn trans_closure(ccx: @CrateContext,
19141914
_attributes: &[ast::Attribute],
19151915
output_type: ty::t,
19161916
maybe_load_env: |@FunctionContext|) {
1917-
ccx.stats.n_closures += 1;
1917+
ccx.stats.n_closures.set(ccx.stats.n_closures.get() + 1);
1918+
19181919
let _icx = push_ctxt("trans_closure");
19191920
set_uwtable(llfndecl);
19201921

@@ -3253,7 +3254,7 @@ pub fn trans_crate(sess: session::Session,
32533254
println!("n_fns: {}", ccx.stats.n_fns.get());
32543255
println!("n_monos: {}", ccx.stats.n_monos.get());
32553256
println!("n_inlines: {}", ccx.stats.n_inlines.get());
3256-
println!("n_closures: {}", ccx.stats.n_closures);
3257+
println!("n_closures: {}", ccx.stats.n_closures.get());
32573258
println("fn stats:");
32583259

32593260
ccx.stats.fn_stats.sort_by(|&(_, _, insns_a), &(_, _, insns_b)| insns_b.cmp(&insns_a));

src/librustc/middle/trans/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub struct Stats {
133133
n_fns: Cell<uint>,
134134
n_monos: Cell<uint>,
135135
n_inlines: Cell<uint>,
136-
n_closures: uint,
136+
n_closures: Cell<uint>,
137137
n_llvm_insns: uint,
138138
llvm_insn_ctxt: ~[~str],
139139
llvm_insns: HashMap<~str, uint>,

src/librustc/middle/trans/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl CrateContext {
218218
n_fns: Cell::new(0u),
219219
n_monos: Cell::new(0u),
220220
n_inlines: Cell::new(0u),
221-
n_closures: 0u,
221+
n_closures: Cell::new(0u),
222222
n_llvm_insns: 0u,
223223
llvm_insn_ctxt: ~[],
224224
llvm_insns: HashMap::new(),

0 commit comments

Comments
 (0)