summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-02-07 18:11:33 +0000
committerPavel Labath <labath@google.com>2017-02-07 18:11:33 +0000
commit24cb6548e5fbf22841128db4cdcbaef2bf64f1b8 (patch)
tree0e9d941d4a1c9398b855f4bc73ca85c5b2e60f31 /llvm/lib/Support
parent8c99ca3df086ad4c4d1682dc28439639d24950ad (diff)
downloadbcm5719-llvm-24cb6548e5fbf22841128db4cdcbaef2bf64f1b8.tar.gz
bcm5719-llvm-24cb6548e5fbf22841128db4cdcbaef2bf64f1b8.zip
[Support] Add FormatVariadic support for chrono types
Summary: The formatter has three knobs: - the user can choose which time unit to use for formatting (default: whatever is the unit of the input) - he can choose whether the unit gets displayed (default: yes) - he can affect the way the number itself is formatted via standard number formatting options (default:default) Reviewers: zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29481 llvm-svn: 294326
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Chrono.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/Chrono.cpp b/llvm/lib/Support/Chrono.cpp
index cdadbd87997..ef81edc9269 100644
--- a/llvm/lib/Support/Chrono.cpp
+++ b/llvm/lib/Support/Chrono.cpp
@@ -16,6 +16,13 @@ namespace llvm {
using namespace sys;
+constexpr char detail::unit<std::ratio<3600>>::value[];
+constexpr char detail::unit<std::ratio<60>>::value[];
+constexpr char detail::unit<std::ratio<1>>::value[];
+constexpr char detail::unit<std::milli>::value[];
+constexpr char detail::unit<std::micro>::value[];
+constexpr char detail::unit<std::nano>::value[];
+
static inline struct tm getStructTM(TimePoint<> TP) {
struct tm Storage;
std::time_t OurTime = toTimeT(TP);
OpenPOWER on IntegriCloud