summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-23 18:21:13 +0000
committerOwen Anderson <resistor@mac.com>2009-06-23 18:21:13 +0000
commit14112e51697e56788fcb32f4255833499c2738b5 (patch)
treedfa48dfb8069dfcfc07f4ca70b12063242cd42f5
parente499f970585c2462e2de8a38f67f6d11683a6bb0 (diff)
downloadllvm-14112e51697e56788fcb32f4255833499c2738b5.tar.gz
llvm-14112e51697e56788fcb32f4255833499c2738b5.tar.bz2
llvm-14112e51697e56788fcb32f4255833499c2738b5.tar.xz
Actually, these need to be signed integers, not unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73978 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/Timer.h20
-rw-r--r--lib/Support/Timer.cpp4
2 files changed, 12 insertions, 12 deletions
diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h
index 9e19a1c432..f34fc95410 100644
--- a/include/llvm/Support/Timer.h
+++ b/include/llvm/Support/Timer.h
@@ -34,12 +34,12 @@ class TimerGroup;
/// if they are never started.
///
class Timer {
- uint64_t Elapsed; // Wall clock time elapsed in seconds
- uint64_t UserTime; // User time elapsed
- uint64_t SystemTime; // System time elapsed
- uint64_t MemUsed; // Memory allocated (in bytes)
- uint64_t PeakMem; // Peak memory used
- uint64_t PeakMemBase; // Temporary for peak calculation...
+ int64_t Elapsed; // Wall clock time elapsed in seconds
+ int64_t UserTime; // User time elapsed
+ int64_t SystemTime; // System time elapsed
+ int64_t MemUsed; // Memory allocated (in bytes)
+ int64_t PeakMem; // Peak memory used
+ int64_t PeakMemBase; // Temporary for peak calculation...
std::string Name; // The name of this time variable
bool Started; // Has this time variable ever been started?
TimerGroup *TG; // The TimerGroup this Timer is in.
@@ -49,10 +49,10 @@ public:
Timer(const Timer &T);
~Timer();
- uint64_t getProcessTime() const { return UserTime+SystemTime; }
- uint64_t getWallTime() const { return Elapsed; }
- uint64_t getMemUsed() const { return MemUsed; }
- uint64_t getPeakMem() const { return PeakMem; }
+ int64_t getProcessTime() const { return UserTime+SystemTime; }
+ int64_t getWallTime() const { return Elapsed; }
+ int64_t getMemUsed() const { return MemUsed; }
+ int64_t getPeakMem() const { return PeakMem; }
std::string getName() const { return Name; }
const Timer &operator=(const Timer &T) {
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index f4e97c4dc7..69f967c738 100644
--- a/lib/Support/Timer.cpp
+++ b/lib/Support/Timer.cpp
@@ -112,7 +112,7 @@ static inline size_t getMemUsage() {
}
struct TimeRecord {
- uint64_t Elapsed, UserTime, SystemTime, MemUsed;
+ int64_t Elapsed, UserTime, SystemTime, MemUsed;
};
static TimeRecord getTimeRecord(bool Start) {
@@ -122,7 +122,7 @@ static TimeRecord getTimeRecord(bool Start) {
sys::TimeValue user(0,0);
sys::TimeValue sys(0,0);
- uint64_t MemUsed = 0;
+ int64_t MemUsed = 0;
if (Start) {
MemUsed = getMemUsage();
sys::Process::GetTimeUsage(now,user,sys);