[llvm] [SystemZ][z/OS] Add UtcClock extension to chrono.h/.cpp (PR #67846)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 12:46:05 PDT 2023
================
@@ -50,44 +68,63 @@ raw_ostream &operator<<(raw_ostream &OS, TimePoint<> TP) {
.count()));
}
-void format_provider<TimePoint<>>::format(const TimePoint<> &T, raw_ostream &OS,
- StringRef Style) {
+template <class T>
+static void format(const T &Fractional, struct tm <, raw_ostream &OS,
+ StringRef Style) {
using namespace std::chrono;
- TimePoint<seconds> Truncated = time_point_cast<seconds>(T);
- auto Fractional = T - Truncated;
- struct tm LT = getStructTM(Truncated);
// Handle extensions first. strftime mangles unknown %x on some platforms.
- if (Style.empty()) Style = "%Y-%m-%d %H:%M:%S.%N";
+ if (Style.empty())
+ Style = "%Y-%m-%d %H:%M:%S.%N";
std::string Format;
raw_string_ostream FStream(Format);
for (unsigned I = 0; I < Style.size(); ++I) {
- if (Style[I] == '%' && Style.size() > I + 1) switch (Style[I + 1]) {
- case 'L': // Milliseconds, from Ruby.
----------------
dwblaikie wrote:
This and other parts seem to be reformatted without changes to the code? Could you remove the unrelated reformatting and/or commit it separately if there's a need?
https://github.com/llvm/llvm-project/pull/67846
More information about the llvm-commits
mailing list