Go to the documentation of this file.
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 char Buffer[
sizeof(
"YYYY-MM-DD HH:MM:SS")];
46 strftime(Buffer,
sizeof(Buffer),
"%Y-%m-%d %H:%M:%S", &
LT);
47 return OS << Buffer <<
'.'
49 long((TP.time_since_epoch() % std::chrono::seconds(1))
53 void format_provider<TimePoint<>>
::format(
const TimePoint<> &
T, raw_ostream &OS,
55 using namespace std::chrono;
56 TimePoint<seconds> Truncated = time_point_cast<seconds>(
T);
57 auto Fractional =
T - Truncated;
60 if (
Style.empty())
Style =
"%Y-%m-%d %H:%M:%S.%N";
62 raw_string_ostream FStream(
Format);
63 for (
unsigned I = 0;
I <
Style.size(); ++
I) {
67 "%.3lu", (
long)duration_cast<milliseconds>(Fractional).
count());
72 "%.6lu", (
long)duration_cast<microseconds>(Fractional).
count());
77 "%.6lu", (
long)duration_cast<nanoseconds>(Fractional).
count());
89 size_t Len = strftime(Buffer,
sizeof(Buffer),
Format.c_str(), &
LT);
90 OS << (
Len ? Buffer :
"BAD-DATE-FORMAT");
This is an optimization pass for GlobalISel generic memory operations.
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
This class implements an extremely fast bulk output stream that can only output to a stream.
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
Lightweight error class with error context and mandatory checking.
static struct tm getStructTM(TimePoint<> TP)
raw_ostream & operator<<(raw_ostream &OS, const Memory::ProtectionFlags &PF)
Debugging output for Memory::ProtectionFlags.