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

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 03:42:49 PDT 2016


labath updated this revision to Diff 74971.
labath added a comment.

Summary of changes:

- Made TimePoint a template. User can specify the desired precision, but the default will be nanoseconds. I decided to go with the first proposal as there is to typedef for std::ratio<1>. If one wants to override precision, he should use the duration types (std::chrono::seconds).
- Added tests that verify that: a) result of toTimePoint can be stored in any timepoint with less-than-second precision; b) toTimeT accepts timepoints with more-than-nanosecond precisions
- use LLVM_ATTRIBUTE_ALWAYS_INLINE for the tiny wrapper functions
- move Chrono.inc files back into Chrono.cpp


https://reviews.llvm.org/D25416

Files:
  include/llvm/Support/Chrono.h
  include/llvm/Support/TimeValue.h
  lib/Support/CMakeLists.txt
  lib/Support/Chrono.cpp
  lib/Support/TimeValue.cpp
  lib/Support/Unix/TimeValue.inc
  lib/Support/Windows/TimeValue.inc
  unittests/Support/CMakeLists.txt
  unittests/Support/Chrono.cpp
  unittests/Support/TimeValueTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25416.74971.patch
Type: text/x-patch
Size: 13539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161018/fdf91683/attachment.bin>


More information about the llvm-commits mailing list