Go to the documentation of this file.
13 #ifndef LLVM_LIB_SUPPORT_UNIX_UNIX_H
14 #define LLVM_LIB_SUPPORT_UNIX_UNIX_H
21 #include "llvm/Config/config.h"
32 #include <sys/types.h>
39 #ifdef HAVE_SYS_TIME_H
40 # include <sys/time.h>
60 std::string* ErrMsg,
const std::string& prefix,
int errnum = -1) {
81 inline std::chrono::microseconds
toDuration(
const struct timeval &TV) {
82 return std::chrono::seconds(TV.tv_sec) +
83 std::chrono::microseconds(TV.tv_usec);
88 using namespace std::chrono;
90 struct timespec RetVal;
92 RetVal.tv_nsec = (TP.time_since_epoch() % seconds(1)).
count();
98 using namespace std::chrono;
100 struct timeval RetVal;
102 RetVal.tv_usec = (TP.time_since_epoch() % seconds(1)).
count();
std::string StrError()
Returns a string representation of the errno value, using whatever thread-safe variant of strerror() ...
This is an optimization pass for GlobalISel generic memory operations.
static bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix, int errnum=-1)
This function builds an error message into ErrMsg using the prefix string and the Unix error number g...
std::chrono::time_point< std::chrono::system_clock, D > TimePoint
A time point on the system clock.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
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...
struct timeval toTimeVal(TimePoint< std::chrono::microseconds > TP)
Convert a time point to struct timeval.
const CustomOperand< const MCSubtargetInfo & > Msg[]
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::time_t toTimeT(TimePoint<> TP)
Convert a TimePoint to std::time_t.
std::chrono::nanoseconds toDuration(FILETIME Time)
static void ReportErrnumFatal(const char *Msg, int errnum)
struct timespec toTimeSpec(TimePoint<> TP)
Convert a time point to struct timespec.