Skip to content

Commit 7cee5cf

Browse files
committed
---
yaml --- r: 147689 b: refs/heads/try2 c: 97ceac7 h: refs/heads/master i: 147687: fdcf2e9 v: v3
1 parent d2f19c4 commit 7cee5cf

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 21e4e410a955014cca789550c2e2ee091fe67a96
8+
refs/heads/try2: 97ceac73776288fc2409e33abc14adae232e92b9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'a> StatRecorder<'a> {
146146
} else {
147147
0
148148
};
149-
let istart = ccx.stats.n_llvm_insns;
149+
let istart = ccx.stats.n_llvm_insns.get();
150150
StatRecorder {
151151
ccx: ccx,
152152
name: name,
@@ -162,13 +162,13 @@ impl<'a> Drop for StatRecorder<'a> {
162162
if self.ccx.sess.trans_stats() {
163163
let end = time::precise_time_ns();
164164
let elapsed = ((end - self.start) / 1_000_000) as uint;
165-
let iend = self.ccx.stats.n_llvm_insns;
165+
let iend = self.ccx.stats.n_llvm_insns.get();
166166
self.ccx.stats.fn_stats.push((self.name.to_owned(),
167167
elapsed,
168168
iend - self.istart));
169169
self.ccx.stats.n_fns.set(self.ccx.stats.n_fns.get() + 1);
170170
// Reset LLVM insn count to avoid compound costs.
171-
self.ccx.stats.n_llvm_insns = self.istart;
171+
self.ccx.stats.n_llvm_insns.set(self.istart);
172172
}
173173
}
174174
}

branches/try2/src/librustc/middle/trans/builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ impl Builder {
4747

4848
pub fn count_insn(&self, category: &str) {
4949
if self.ccx.sess.trans_stats() {
50-
self.ccx.stats.n_llvm_insns += 1;
50+
self.ccx.stats.n_llvm_insns.set(self.ccx
51+
.stats
52+
.n_llvm_insns
53+
.get() + 1);
5154
}
5255
if self.ccx.sess.count_llvm_insns() {
5356
base::with_insn_ctxt(|v| {

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub struct Stats {
134134
n_monos: Cell<uint>,
135135
n_inlines: Cell<uint>,
136136
n_closures: Cell<uint>,
137-
n_llvm_insns: uint,
137+
n_llvm_insns: Cell<uint>,
138138
llvm_insn_ctxt: ~[~str],
139139
llvm_insns: HashMap<~str, uint>,
140140
fn_stats: ~[(~str, uint, uint)] // (ident, time-in-ms, llvm-instructions)

branches/try2/src/librustc/middle/trans/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl CrateContext {
219219
n_monos: Cell::new(0u),
220220
n_inlines: Cell::new(0u),
221221
n_closures: Cell::new(0u),
222-
n_llvm_insns: 0u,
222+
n_llvm_insns: Cell::new(0u),
223223
llvm_insn_ctxt: ~[],
224224
llvm_insns: HashMap::new(),
225225
fn_stats: ~[]

0 commit comments

Comments
 (0)