From 11479d1babcfba5d4972363c38d31b13c786b8bd Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 27 Nov 2017 17:06:42 +0000 Subject: [PATCH] Remove custom TimePoint-formatting code This was a temporary thing, until llvm has proper support for formatting time. That time has come, so we can remove the relevant code. There should be no change in the format of the time. llvm-svn: 319048 --- lldb/source/Commands/CommandObjectTarget.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 583ab2a..c83061d 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -52,6 +52,7 @@ #include "lldb/Utility/Timer.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/FormatAdapters.h" // C Includes // C++ Includes @@ -135,25 +136,6 @@ static uint32_t DumpTargetList(TargetList &target_list, return num_targets; } -// TODO: Remove this once llvm can pretty-print time points -static void DumpTimePoint(llvm::sys::TimePoint<> tp, Stream &s, uint32_t width) { -#ifndef LLDB_DISABLE_POSIX - char time_buf[32]; - time_t time = llvm::sys::toTimeT(tp); - char *time_cstr = ::ctime_r(&time, time_buf); - if (time_cstr) { - char *newline = ::strpbrk(time_cstr, "\n\r"); - if (newline) - *newline = '\0'; - if (width > 0) - s.Printf("%-*s", width, time_cstr); - else - s.PutCString(time_cstr); - } else if (width > 0) - s.Printf("%-*s", width, ""); -#endif -} - #pragma mark CommandObjectTargetCreate //------------------------------------------------------------------------- @@ -3176,7 +3158,8 @@ protected: } break; case 'm': - DumpTimePoint(module->GetModificationTime(), strm, width); + strm.Format("{0:%c}", llvm::fmt_align(module->GetModificationTime(), + llvm::AlignStyle::Left, width)); break; case 'p': -- 2.7.4