From 153d28a414d087cbe20d17329fed358f7fa1258b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 24 Jun 2008 22:07:07 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52693 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 9cbb3c705c5..c8678d3ae2c 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -132,13 +132,13 @@ static ManagedStatic > 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() { -- 2.34.1