[llvm-commits] CVS: llvm/lib/System/SunOS/TimeValue.cpp

Reid Spencer reid at x10sys.com
Sun Nov 14 20:37:23 PST 2004



Changes in directory llvm/lib/System/SunOS:

TimeValue.cpp updated: 1.2 -> 1.3
---
Log message:

Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.


---
Diffs of the changes:  (+1 -14)

Index: llvm/lib/System/SunOS/TimeValue.cpp
diff -u llvm/lib/System/SunOS/TimeValue.cpp:1.2 llvm/lib/System/SunOS/TimeValue.cpp:1.3
--- llvm/lib/System/SunOS/TimeValue.cpp:1.2	Sat Sep 25 03:32:37 2004
+++ llvm/lib/System/SunOS/TimeValue.cpp	Sun Nov 14 22:36:35 2004
@@ -12,8 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 // Include the generic Unix implementation
-#include "../Unix/Unix.h"
-#include <sys/time.h>
+#include "../Unix/Unix.cpp"
 
 namespace llvm {
 using namespace sys;
@@ -23,18 +22,6 @@
 //===          and must not be generic UNIX code (see ../Unix/TimeValue.cpp)
 //===----------------------------------------------------------------------===//
 
-TimeValue TimeValue::now() {
-  struct timeval the_time;
-  timerclear(&the_time);
-  if (0 != ::gettimeofday(&the_time,0)) 
-      ThrowErrno("Couldn't obtain time of day");
-
-  return TimeValue(
-    static_cast<TimeValue::SecondsType>( the_time.tv_sec ), 
-    static_cast<TimeValue::NanoSecondsType>( the_time.tv_usec * 
-      NANOSECONDS_PER_MICROSECOND ) );
-}
-
 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab
 
 }






More information about the llvm-commits mailing list