aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-24 22:07:07 +0000
committerDan Gohman <gohman@apple.com>2008-06-24 22:07:07 +0000
commitf6930f97f1c029c67f60b72dd494f48c3dacc274 (patch)
tree1700fd9cd23d9cef1c8300c59a38ad0e937af467
parent649b32cb4cd0337ba1e35848f2e440167d9b2a2e (diff)
downloadexternal_llvm-f6930f97f1c029c67f60b72dd494f48c3dacc274.zip
external_llvm-f6930f97f1c029c67f60b72dd494f48c3dacc274.tar.gz
external_llvm-f6930f97f1c029c67f60b72dd494f48c3dacc274.tar.bz2
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
-rw-r--r--lib/Support/Timer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index 9cbb3c7..c8678d3 100644
--- a/lib/Support/Timer.cpp
+++ b/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() {