diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-24 22:07:07 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-24 22:07:07 +0000 |
commit | 5ceb8b676cab2d057a5c59a78c2cdacc17a77f4d (patch) | |
tree | 207170a3fc837961d63292d12b09e93321fcca09 /llvm/lib/Support/Timer.cpp | |
parent | 6316bc705e0a9d0302217624a209c4c45d09ece5 (diff) | |
download | bcm5719-llvm-5ceb8b676cab2d057a5c59a78c2cdacc17a77f4d.tar.gz bcm5719-llvm-5ceb8b676cab2d057a5c59a78c2cdacc17a77f4d.zip |
Append to the ActiveTimers std::vector before looking at the timer instead
of after, so that any reallocation it does doesn't get counted for the pass
being timed. This probably doesn't account for a timing discrepancy I was
looking into, but I'm fixing it anyway.
llvm-svn: 52693
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 9cbb3c705c5..c8678d3ae2c 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -132,13 +132,13 @@ static ManagedStatic<std::vector<Timer*> > ActiveTimers; void Timer::startTimer() { Started = true; + ActiveTimers->push_back(this); TimeRecord TR = getTimeRecord(true); Elapsed -= TR.Elapsed; UserTime -= TR.UserTime; SystemTime -= TR.SystemTime; MemUsed -= TR.MemUsed; PeakMemBase = TR.MemUsed; - ActiveTimers->push_back(this); } void Timer::stopTimer() { |