diff options
author | Sam McCall <sammccall@google.com> | 2019-10-23 15:34:48 +0200 |
---|---|---|
committer | Sam McCall <sammccall@google.com> | 2019-10-23 15:51:44 +0200 |
commit | a9c3c176ad741b9c2b915abc59dd977d0299c53f (patch) | |
tree | 9b3ea3806dcff715124291d8ed990d771165add2 /llvm/lib/Support/Unix/Unix.h | |
parent | 10c8dbcb840c744002a824950e8293ef0a1fd61a (diff) | |
download | bcm5719-llvm-a9c3c176ad741b9c2b915abc59dd977d0299c53f.tar.gz bcm5719-llvm-a9c3c176ad741b9c2b915abc59dd977d0299c53f.zip |
Reland "[Support] Add a way to run a function on a detached thread""
This reverts commit 7bc7fe6b789d25d48d6dc71d533a411e9e981237.
The immediate callers have been fixed to pass nullopt where appropriate.
Diffstat (limited to 'llvm/lib/Support/Unix/Unix.h')
-rw-r--r-- | llvm/lib/Support/Unix/Unix.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Unix.h b/llvm/lib/Support/Unix/Unix.h index 86309b0567f..1fc9a414f74 100644 --- a/llvm/lib/Support/Unix/Unix.h +++ b/llvm/lib/Support/Unix/Unix.h @@ -21,6 +21,7 @@ #include "llvm/Config/config.h" #include "llvm/Support/Chrono.h" #include "llvm/Support/Errno.h" +#include "llvm/Support/ErrorHandling.h" #include <algorithm> #include <assert.h> #include <cerrno> @@ -69,6 +70,14 @@ static inline bool MakeErrMsg( return true; } +// Include StrError(errnum) in a fatal error message. +LLVM_ATTRIBUTE_NORETURN static inline void ReportErrnumFatal(const char *Msg, + int errnum) { + std::string ErrMsg; + MakeErrMsg(&ErrMsg, Msg, errnum); + llvm::report_fatal_error(ErrMsg); +} + namespace llvm { namespace sys { |