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
This commit is contained in:
Dan Gohman 2008-06-24 22:07:07 +00:00
parent 6316bc705e
commit 5ceb8b676c
1 changed files with 1 additions and 1 deletions

View File

@ -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() {