#include "lldb/Utility/Timer.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormatAdapters.h"
// C Includes
// C++ Includes
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
//-------------------------------------------------------------------------
} break;
case 'm':
- DumpTimePoint(module->GetModificationTime(), strm, width);
+ strm.Format("{0:%c}", llvm::fmt_align(module->GetModificationTime(),
+ llvm::AlignStyle::Left, width));
break;
case 'p':