[llvm-commits] [llvm] r73978 - in /llvm/trunk: include/llvm/Support/Timer.h lib/Support/Timer.cpp

Owen Anderson resistor at mac.com
Tue Jun 23 11:21:19 PDT 2009


Author: resistor
Date: Tue Jun 23 13:21:13 2009
New Revision: 73978

URL: http://llvm.org/viewvc/llvm-project?rev=73978&view=rev
Log:
Actually, these need to be signed integers, not unsigned.

Modified:
    llvm/trunk/include/llvm/Support/Timer.h
    llvm/trunk/lib/Support/Timer.cpp

Modified: llvm/trunk/include/llvm/Support/Timer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Timer.h?rev=73978&r1=73977&r2=73978&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/Timer.h (original)
+++ llvm/trunk/include/llvm/Support/Timer.h Tue Jun 23 13:21:13 2009
@@ -34,12 +34,12 @@
 /// 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 @@
   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) {

Modified: llvm/trunk/lib/Support/Timer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=73978&r1=73977&r2=73978&view=diff

==============================================================================
--- llvm/trunk/lib/Support/Timer.cpp (original)
+++ llvm/trunk/lib/Support/Timer.cpp Tue Jun 23 13:21:13 2009
@@ -112,7 +112,7 @@
 }
 
 struct TimeRecord {
-  uint64_t Elapsed, UserTime, SystemTime, MemUsed;
+  int64_t Elapsed, UserTime, SystemTime, MemUsed;
 };
 
 static TimeRecord getTimeRecord(bool Start) {
@@ -122,7 +122,7 @@
   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);





More information about the llvm-commits mailing list