[PATCH] D25416: Add Chrono.h - std::chrono support header

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 09:25:26 PDT 2016

zturner accepted this revision.
zturner added a comment.
This revision is now accepted and ready to land.

Feel free to commit after addressing the comments below.

Comment at: lib/Support/Chrono.cpp:1
+//===- lib/Chrono.h --- Utilities for Timing Manipulation -------*- C++ -*-===//

Comment at: lib/Support/Chrono.cpp:28
+#elif defined(LLVM_ON_WIN32)
+  __time64_t OurTime = toTimeT(TP);
+  int Error = ::_localtime64_s(&Storage, &OurTime);
I believe `std::time_t` still works here (and moreover that it's incorrect as written, in the case that `_USE_32BIT_TIME_T` is defined.  This can probably be raised out of the `#if`

Comment at: lib/Support/Chrono.cpp:32-34
+#error Unimplemented
I would probably write this as:

#if defined(LLVM_ON_WIN32)


More information about the llvm-commits mailing list