10#include "llvm/Config/llvm-config.h"
27 std::time_t OurTime =
toTimeT(TP);
29#if defined(LLVM_ON_UNIX)
30 struct tm *LT = ::localtime_r(&OurTime, &Storage);
35 int Error = ::localtime_s(&Storage, &OurTime);
45 std::time_t OurTime =
toTimeT(TP);
47#if defined(LLVM_ON_UNIX)
48 struct tm *LT = ::gmtime_r(&OurTime, &Storage);
53 int Error = ::gmtime_s(&Storage, &OurTime);
63 char Buffer[
sizeof(
"YYYY-MM-DD HH:MM:SS")];
64 strftime(Buffer,
sizeof(Buffer),
"%Y-%m-%d %H:%M:%S", <);
65 return OS << Buffer <<
'.'
67 long((TP.time_since_epoch() % std::chrono::seconds(1))
74 using namespace std::chrono;
76 if (Style.empty()) Style =
"%Y-%m-%d %H:%M:%S.%N";
79 for (
unsigned I = 0;
I < Style.size(); ++
I) {
80 if (Style[
I] ==
'%' && Style.size() >
I + 1)
switch (Style[
I + 1]) {
83 "%.3lu", (
long)duration_cast<milliseconds>(Fractional).
count());
88 "%.6lu", (
long)duration_cast<microseconds>(Fractional).
count());
93 "%.9lu", (
long)duration_cast<nanoseconds>(Fractional).
count());
105 size_t Len = strftime(Buffer,
sizeof(Buffer),
Format.c_str(), <);
106 OS << (Len ? Buffer :
"BAD-DATE-FORMAT");
109void format_provider<UtcTime<std::chrono::seconds>>
::format(
110 const UtcTime<std::chrono::seconds> &
T, raw_ostream &
OS, StringRef Style) {
111 using namespace std::chrono;
112 UtcTime<seconds> Truncated =
113 UtcTime<seconds>(duration_cast<seconds>(
T.time_since_epoch()));
114 auto Fractional =
T - Truncated;
119void format_provider<TimePoint<>>
::format(
const TimePoint<> &
T, raw_ostream &
OS,
121 using namespace std::chrono;
122 TimePoint<seconds> Truncated = time_point_cast<seconds>(
T);
123 auto Fractional =
T - Truncated;
Given that RA is a live value
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
std::chrono::time_point< UtcClock, D > UtcTime
std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
This is an optimization pass for GlobalISel generic memory operations.
static struct tm getStructTM(TimePoint<> TP)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
static struct tm getStructTMUtc(UtcTime<> TP)
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)