12#include "llvm/Config/llvm-config.h"
39#pragma comment(lib, "psapi.lib")
49#pragma GCC diagnostic ignored "-Wformat"
50#pragma GCC diagnostic ignored "-Wformat-extra-args"
53typedef BOOL(__stdcall *PREAD_PROCESS_MEMORY_ROUTINE64)(
54 HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize,
55 LPDWORD lpNumberOfBytesRead);
57typedef PVOID(__stdcall *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE ahProcess,
60typedef DWORD64(__stdcall *PGET_MODULE_BASE_ROUTINE64)(HANDLE hProcess,
63typedef DWORD64(__stdcall *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE hProcess,
67typedef BOOL(WINAPI *fpMiniDumpWriteDump)(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
68 PMINIDUMP_EXCEPTION_INFORMATION,
69 PMINIDUMP_USER_STREAM_INFORMATION,
70 PMINIDUMP_CALLBACK_INFORMATION);
71static fpMiniDumpWriteDump fMiniDumpWriteDump;
73typedef BOOL(WINAPI *fpStackWalk64)(DWORD, HANDLE, HANDLE, LPSTACKFRAME64,
74 PVOID, PREAD_PROCESS_MEMORY_ROUTINE64,
75 PFUNCTION_TABLE_ACCESS_ROUTINE64,
76 PGET_MODULE_BASE_ROUTINE64,
77 PTRANSLATE_ADDRESS_ROUTINE64);
78static fpStackWalk64 fStackWalk64;
80typedef DWORD64(WINAPI *fpSymGetModuleBase64)(HANDLE, DWORD64);
81static fpSymGetModuleBase64 fSymGetModuleBase64;
83typedef BOOL(WINAPI *fpSymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64,
85static fpSymGetSymFromAddr64 fSymGetSymFromAddr64;
87typedef BOOL(WINAPI *fpSymGetLineFromAddr64)(HANDLE, DWORD64, PDWORD,
89static fpSymGetLineFromAddr64 fSymGetLineFromAddr64;
91typedef BOOL(WINAPI *fpSymGetModuleInfo64)(HANDLE hProcess, DWORD64 dwAddr,
92 PIMAGEHLP_MODULE64 ModuleInfo);
93static fpSymGetModuleInfo64 fSymGetModuleInfo64;
95typedef PVOID(WINAPI *fpSymFunctionTableAccess64)(HANDLE, DWORD64);
96static fpSymFunctionTableAccess64 fSymFunctionTableAccess64;
98typedef DWORD(WINAPI *fpSymSetOptions)(DWORD);
99static fpSymSetOptions fSymSetOptions;
101typedef BOOL(WINAPI *fpSymInitialize)(HANDLE, PCSTR, BOOL);
102static fpSymInitialize fSymInitialize;
104typedef BOOL(WINAPI *fpEnumerateLoadedModules)(HANDLE,
105 PENUMLOADED_MODULES_CALLBACK64,
107static fpEnumerateLoadedModules fEnumerateLoadedModules;
109static bool isDebugHelpInitialized() {
110 return fStackWalk64 && fSymInitialize && fSymSetOptions && fMiniDumpWriteDump;
113static bool load64BitDebugHelp(
void) {
115 ::LoadLibraryExA(
"Dbghelp.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
117 fMiniDumpWriteDump = (fpMiniDumpWriteDump)(
void *)::GetProcAddress(
118 hLib,
"MiniDumpWriteDump");
119 fStackWalk64 = (fpStackWalk64)(
void *)::GetProcAddress(hLib,
"StackWalk64");
120 fSymGetModuleBase64 = (fpSymGetModuleBase64)(
void *)::GetProcAddress(
121 hLib,
"SymGetModuleBase64");
122 fSymGetSymFromAddr64 = (fpSymGetSymFromAddr64)(
void *)::GetProcAddress(
123 hLib,
"SymGetSymFromAddr64");
124 fSymGetLineFromAddr64 = (fpSymGetLineFromAddr64)(
void *)::GetProcAddress(
125 hLib,
"SymGetLineFromAddr64");
126 fSymGetModuleInfo64 = (fpSymGetModuleInfo64)(
void *)::GetProcAddress(
127 hLib,
"SymGetModuleInfo64");
128 fSymFunctionTableAccess64 =
129 (fpSymFunctionTableAccess64)(
void *)::GetProcAddress(
130 hLib,
"SymFunctionTableAccess64");
132 (fpSymSetOptions)(
void *)::GetProcAddress(hLib,
"SymSetOptions");
134 (fpSymInitialize)(
void *)::GetProcAddress(hLib,
"SymInitialize");
135 fEnumerateLoadedModules =
136 (fpEnumerateLoadedModules)(
void *)::GetProcAddress(
137 hLib,
"EnumerateLoadedModules64");
139 return isDebugHelpInitialized();
145static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep);
146static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType);
149static void (*InterruptFunction)() = 0;
151static std::vector<std::string> *FilesToRemove = NULL;
152static bool RegisteredUnhandledExceptionFilter =
false;
153static bool CleanupExecuted =
false;
154static PTOP_LEVEL_EXCEPTION_FILTER OldFilter = NULL;
157static std::atomic<void (*)()> OneShotPipeSignalFunction(
nullptr);
162static CRITICAL_SECTION CriticalSection;
163static bool CriticalSectionInitialized =
false;
170#elif defined(_M_ARM64)
172#elif defined(_M_IX86)
182 HANDLE hProcess, HANDLE hThread,
183 STACKFRAME64 &StackFrameOrig,
184 CONTEXT *ContextOrig) {
186 STACKFRAME64 StackFrame = StackFrameOrig;
192 CONTEXT Context = *ContextOrig;
193 Context.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
195 static void *StackTrace[256];
197 while (fStackWalk64(NativeMachineType, hProcess, hThread, &StackFrame,
198 &Context, 0, fSymFunctionTableAccess64,
199 fSymGetModuleBase64, 0)) {
200 if (StackFrame.AddrFrame.Offset == 0)
202 StackTrace[
Depth++] = (
void *)(uintptr_t)StackFrame.AddrPC.Offset;
203 if (
Depth >= std::size(StackTrace))
211struct FindModuleData {
214 const char **Modules;
216 StringSaver *StrPool;
220static BOOL CALLBACK findModuleCallback(PCSTR
ModuleName, DWORD64 ModuleBase,
221 ULONG ModuleSize,
void *VoidData) {
222 FindModuleData *
Data = (FindModuleData *)VoidData;
223 intptr_t Beg = ModuleBase;
224 intptr_t End = Beg + ModuleSize;
225 for (
int I = 0;
I <
Data->Depth;
I++) {
226 if (
Data->Modules[
I])
228 intptr_t Addr = (intptr_t)
Data->StackTrace[
I];
229 if (Beg <= Addr && Addr < End) {
231 Data->Offsets[
I] = Addr - Beg;
238 const char **Modules, intptr_t *Offsets,
239 const char *MainExecutableName,
241 if (!fEnumerateLoadedModules)
244 Data.StackTrace = StackTrace;
246 Data.Modules = Modules;
248 Data.StrPool = &StrPool;
249 fEnumerateLoadedModules(GetCurrentProcess(), findModuleCallback, &
Data);
254 const char *MainExecutableName) {
259 HANDLE hThread, STACKFRAME64 &StackFrame,
264 if (!isDebugHelpInitialized())
268 fSymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_LOAD_LINES);
269 fSymInitialize(hProcess, NULL, TRUE);
274 if (printStackTraceWithLLVMSymbolizer(OS, hProcess, hThread, StackFrame,
280 if (!fStackWalk64(NativeMachineType, hProcess, hThread, &StackFrame,
281 Context, 0, fSymFunctionTableAccess64,
282 fSymGetModuleBase64, 0)) {
286 if (StackFrame.AddrFrame.Offset == 0)
289 using namespace llvm;
291 DWORD64 PC = StackFrame.AddrPC.Offset;
292#if defined(_M_X64) || defined(_M_ARM64)
293 OS <<
format(
"0x%016llX", PC);
294#elif defined(_M_IX86) || defined(_M_ARM)
295 OS <<
format(
"0x%08lX",
static_cast<DWORD
>(PC));
299 if (!fSymGetModuleBase64(hProcess, PC)) {
300 OS <<
" <unknown module>\n";
305 memset(&M, 0,
sizeof(IMAGEHLP_MODULE64));
306 M.SizeOfStruct =
sizeof(IMAGEHLP_MODULE64);
307 if (fSymGetModuleInfo64(hProcess, fSymGetModuleBase64(hProcess, PC), &M)) {
308 DWORD64
const disp = PC - M.BaseOfImage;
309 OS <<
format(
", %s(0x%016llX) + 0x%llX byte(s)",
310 static_cast<char *
>(M.ImageName), M.BaseOfImage,
311 static_cast<long long>(disp));
313 OS <<
", <unknown module>";
318 IMAGEHLP_SYMBOL64 *symbol =
reinterpret_cast<IMAGEHLP_SYMBOL64 *
>(buffer);
319 memset(symbol, 0,
sizeof(IMAGEHLP_SYMBOL64));
320 symbol->SizeOfStruct =
sizeof(IMAGEHLP_SYMBOL64);
321 symbol->MaxNameLength = 512 -
sizeof(IMAGEHLP_SYMBOL64);
324 if (!fSymGetSymFromAddr64(hProcess, PC, &dwDisp, symbol)) {
330 OS <<
format(
", %s() + 0x%llX byte(s)",
static_cast<char *
>(symbol->Name),
331 static_cast<long long>(dwDisp));
334 IMAGEHLP_LINE64 line = {};
336 line.SizeOfStruct =
sizeof(line);
337 if (fSymGetLineFromAddr64(hProcess, PC, &dwLineDisp, &line)) {
338 OS <<
format(
", %s, line %lu + 0x%lX byte(s)", line.FileName,
339 line.LineNumber, dwLineDisp);
358AvoidMessageBoxHook(
int ReportType,
char *Message,
int *Return) {
370extern "C" void HandleAbort(
int Sig) {
371 if (Sig == SIGABRT) {
376static void InitializeThreading() {
377 if (CriticalSectionInitialized)
382 InitializeCriticalSection(&CriticalSection);
383 CriticalSectionInitialized =
true;
386static void RegisterHandler() {
390 if (!load64BitDebugHelp()) {
391 assert(
false &&
"These APIs should always be available");
395 if (RegisteredUnhandledExceptionFilter) {
396 EnterCriticalSection(&CriticalSection);
400 InitializeThreading();
404 EnterCriticalSection(&CriticalSection);
406 RegisteredUnhandledExceptionFilter =
true;
407 OldFilter = SetUnhandledExceptionFilter(LLVMUnhandledExceptionFilter);
408 SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
418 if (CleanupExecuted) {
420 *ErrMsg =
"Process terminating -- cannot register for removal";
424 if (FilesToRemove == NULL)
425 FilesToRemove =
new std::vector<std::string>;
427 FilesToRemove->push_back(std::string(Filename));
429 LeaveCriticalSection(&CriticalSection);
435 if (FilesToRemove == NULL)
440 std::vector<std::string>::reverse_iterator
I =
442 if (
I != FilesToRemove->rend())
443 FilesToRemove->erase(
I.base() - 1);
445 LeaveCriticalSection(&CriticalSection);
450 signal(SIGABRT, HandleAbort);
455 _set_abort_behavior(0, _WRITE_ABORT_MSG);
457 _set_abort_behavior(0, _CALL_REPORTFAULT);
458 _CrtSetReportHook(AvoidMessageBoxHook);
462 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
463 SEM_NOOPENFILEERRORBOX);
464 _set_error_mode(_OUT_TO_STDERR);
470 bool DisableCrashReporting) {
473 if (DisableCrashReporting || getenv(
"LLVM_DISABLE_CRASH_REPORT"))
478 LeaveCriticalSection(&CriticalSection);
482#if LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN
483#error DebugLoc origin-tracking currently unimplemented for Windows.
486static void LocalPrintStackTrace(
raw_ostream &OS, PCONTEXT
C) {
487 STACKFRAME64 StackFrame{};
490 ::RtlCaptureContext(&Context);
494 StackFrame.AddrPC.Offset = Context.Rip;
495 StackFrame.AddrStack.Offset = Context.Rsp;
496 StackFrame.AddrFrame.Offset = Context.Rbp;
497#elif defined(_M_IX86)
498 StackFrame.AddrPC.Offset = Context.Eip;
499 StackFrame.AddrStack.Offset = Context.Esp;
500 StackFrame.AddrFrame.Offset = Context.Ebp;
501#elif defined(_M_ARM64)
502 StackFrame.AddrPC.Offset = Context.Pc;
503 StackFrame.AddrStack.Offset = Context.Sp;
504 StackFrame.AddrFrame.Offset = Context.Fp;
506 StackFrame.AddrPC.Offset = Context.Pc;
507 StackFrame.AddrStack.Offset = Context.Sp;
508 StackFrame.AddrFrame.Offset = Context.R11;
510 StackFrame.AddrPC.Mode = AddrModeFlat;
511 StackFrame.AddrStack.Mode = AddrModeFlat;
512 StackFrame.AddrFrame.Mode = AddrModeFlat;
513 PrintStackTraceForThread(OS, GetCurrentProcess(), GetCurrentThread(),
519 LocalPrintStackTrace(OS,
nullptr);
524 InterruptFunction =
IF;
525 LeaveCriticalSection(&CriticalSection);
533 OneShotPipeSignalFunction.exchange(Handler);
540void llvm::sys::CallOneShotPipeSignalHandler() {
541 if (
auto OldOneShotPipeFunction = OneShotPipeSignalFunction.exchange(
nullptr))
542 OldOneShotPipeFunction();
552 LeaveCriticalSection(&CriticalSection);
555static void Cleanup(
bool ExecuteSignalHandlers) {
559 EnterCriticalSection(&CriticalSection);
563 CleanupExecuted =
true;
566 if (FilesToRemove != NULL)
567 while (!FilesToRemove->empty()) {
569 FilesToRemove->pop_back();
572 if (ExecuteSignalHandlers)
575 LeaveCriticalSection(&CriticalSection);
583 InitializeThreading();
590static HKEY FindWERKey(
const llvm::Twine &RegistryLocation) {
592 if (ERROR_SUCCESS != ::RegOpenKeyExA(HKEY_LOCAL_MACHINE,
593 RegistryLocation.
str().c_str(), 0,
594 KEY_QUERY_VALUE | KEY_READ, &
Key))
604static bool GetDumpFolder(HKEY
Key,
606 using llvm::sys::windows::UTF16ToUTF8;
611 DWORD BufferLengthBytes = 0;
613 if (ERROR_SUCCESS != ::RegGetValueW(
Key, 0, L
"DumpFolder", REG_EXPAND_SZ,
614 NULL, NULL, &BufferLengthBytes))
619 if (ERROR_SUCCESS != ::RegGetValueW(
Key, 0, L
"DumpFolder", REG_EXPAND_SZ,
620 NULL, Buffer.data(), &BufferLengthBytes))
623 DWORD ExpandBufferSize = ::ExpandEnvironmentStringsW(Buffer.data(), NULL, 0);
625 if (!ExpandBufferSize)
630 if (ExpandBufferSize != ::ExpandEnvironmentStringsW(Buffer.data(),
635 if (UTF16ToUTF8(ExpandBuffer.data(), ExpandBufferSize - 1, ResultDirectory))
654static bool GetDumpType(HKEY
Key, MINIDUMP_TYPE &ResultType) {
660 if (ERROR_SUCCESS != ::RegGetValueW(
Key, NULL, L
"DumpType", RRF_RT_REG_DWORD,
667 if (ERROR_SUCCESS != ::RegGetValueW(
Key, NULL, L
"CustomDumpFlags",
668 RRF_RT_REG_DWORD, NULL, &Flags,
672 ResultType =
static_cast<MINIDUMP_TYPE
>(Flags);
676 ResultType = MiniDumpNormal;
679 ResultType = MiniDumpWithFullMemory;
692static std::error_code WINAPI
693WriteWindowsDumpFile(PMINIDUMP_EXCEPTION_INFORMATION ExceptionInfo) {
694 struct ScopedCriticalSection {
695 ScopedCriticalSection() { EnterCriticalSection(&CriticalSection); }
696 ~ScopedCriticalSection() { LeaveCriticalSection(&CriticalSection); }
699 using namespace llvm;
705 if (MainExecutableName.empty()) {
719 "SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps";
723 ScopedRegHandle DefaultLocalDumpsKey(FindWERKey(LocalDumpsRegistryLocation));
729 FindWERKey(
Twine(LocalDumpsRegistryLocation) +
"\\" + ProgramName));
735 MINIDUMP_TYPE DumpType;
736 if (!GetDumpType(AppSpecificKey, DumpType))
737 if (!GetDumpType(DefaultLocalDumpsKey, DumpType))
738 DumpType = MiniDumpNormal;
746 bool ExplicitDumpDirectorySet =
true;
748 if (DumpDirectory.empty())
749 if (!GetDumpFolder(AppSpecificKey, DumpDirectory))
750 if (!GetDumpFolder(DefaultLocalDumpsKey, DumpDirectory))
751 ExplicitDumpDirectorySet =
false;
756 if (ExplicitDumpDirectorySet) {
760 Twine(DumpDirectory) +
"\\" + ProgramName +
".%%%%%%.dmp", FD,
763 }
else if (std::error_code EC =
770 if (!fMiniDumpWriteDump(::GetCurrentProcess(), ::GetCurrentProcessId(),
771 FileHandle, DumpType, ExceptionInfo, NULL, NULL))
774 llvm::errs() <<
"Wrote crash dump file \"" << DumpPath <<
"\"\n";
775 return std::error_code();
779 LPEXCEPTION_POINTERS EP = (LPEXCEPTION_POINTERS)Context;
784 unsigned RetCode = EP->ExceptionRecord->ExceptionCode;
785 if (RetCode == (0xE0000000 | EX_IOERR))
787 LLVMUnhandledExceptionFilter(EP);
790static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
794 if (ep && ep->ExceptionRecord)
796 ep->ExceptionRecord->ExceptionCode)
804 MINIDUMP_EXCEPTION_INFORMATION ExceptionInfo;
805 ExceptionInfo.ThreadId = ::GetCurrentThreadId();
806 ExceptionInfo.ExceptionPointers = ep;
807 ExceptionInfo.ClientPointers = FALSE;
809 if (std::error_code EC = WriteWindowsDumpFile(&ExceptionInfo))
810 llvm::errs() <<
"Could not write crash dump file: " <<
EC.message()
818 memcpy(&ContextCopy, ep->ContextRecord,
sizeof(ContextCopy));
820 LocalPrintStackTrace(
llvm::errs(), ep ? &ContextCopy :
nullptr);
822 return EXCEPTION_EXECUTE_HANDLER;
825static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
827 EnterCriticalSection(&CriticalSection);
835 void (*IF)() = InterruptFunction;
836 InterruptFunction = 0;
842 LeaveCriticalSection(&CriticalSection);
847 LeaveCriticalSection(&CriticalSection);
856#pragma GCC diagnostic warning "-Wformat"
857#pragma GCC diagnostic warning "-Wformat-extra-args"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_BUILTIN_TRAP
LLVM_BUILTIN_UNREACHABLE - On compilers which support it, expands to an expression which states that ...
#define LLVM_ATTRIBUTE_UNUSED
This file contains definitions of exit codes for exit() function.
static const HTTPClientCleanup Cleanup
Provides a library for accessing information about this process and other processes on the operating ...
static LLVM_ATTRIBUTE_USED bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, int Depth, llvm::raw_ostream &OS)
Helper that launches llvm-symbolizer and symbolizes a backtrace.
static bool findModulesAndOffsets(void **StackTrace, int Depth, const char **Modules, intptr_t *Offsets, const char *MainExecutableName, StringSaver &StrPool)
static ManagedStatic< std::string > CrashDiagnosticsDirectory
static bool printMarkupContext(raw_ostream &OS, const char *MainExecutableName)
static void insertSignalHandler(sys::SignalHandlerCallback FnPtr, void *Cookie)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
This class implements an extremely fast bulk output stream that can only output to a stream.
static LLVM_ABI void Exit(int RetCode, bool NoCleanup=false)
Equivalent to exit(), except when running inside a CrashRecoveryContext.
static LLVM_ABI bool AreCoreFilesPrevented()
true if PreventCoreFiles has been called, false otherwise.
static LLVM_ABI void PreventCoreFiles()
This function makes the necessary calls to the operating system to prevent core files or any other ki...
@ IMAGE_FILE_MACHINE_ARM64
@ IMAGE_FILE_MACHINE_UNKNOWN
@ IMAGE_FILE_MACHINE_AMD64
@ IMAGE_FILE_MACHINE_I386
@ IMAGE_FILE_MACHINE_ARMNT
LLVM_ABI std::error_code createUniqueFile(const Twine &Model, int &ResultFD, SmallVectorImpl< char > &ResultPath, OpenFlags Flags=OF_None, unsigned Mode=all_read|all_write)
Create a uniquely named file.
LLVM_ABI std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
LLVM_ABI std::string getMainExecutable(const char *argv0, void *MainExecAddr)
Return the path to the main executable, given the value of argv[0] from program startup and the addre...
LLVM_ABI std::error_code create_directories(const Twine &path, bool IgnoreExisting=true, perms Perms=owner_all|group_all)
Create all the non-existent directories in path.
LLVM_ABI std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix, int &ResultFD, SmallVectorImpl< char > &ResultPath, OpenFlags Flags=OF_None)
Create a file in the system temporary directory.
LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get filename.
LLVM_ABI void DefaultOneShotPipeSignalHandler()
On Unix systems and Windows, this function exits with an "IO error" exit code.
LLVM_ABI void PrintStackTrace(raw_ostream &OS, int Depth=0)
Print the stack trace using the given raw_ostream object.
LLVM_ABI void DisableSystemDialogsOnCrash()
Disable all system dialog boxes that appear when the process crashes.
LLVM_ABI void unregisterHandlers()
LLVM_ABI void DontRemoveFileOnSignal(StringRef Filename)
This function removes a file from the list of files to be removed on signal delivery.
LLVM_ABI bool RemoveFileOnSignal(StringRef Filename, std::string *ErrMsg=nullptr)
This function registers signal handlers to ensure that if a signal gets delivered that the named file...
LLVM_ABI void SetInfoSignalFunction(void(*Handler)())
Registers a function to be called when an "info" signal is delivered to the process.
LLVM_ABI void SetOneShotPipeSignalFunction(void(*Handler)())
Registers a function to be called in a "one-shot" manner when a pipe signal is delivered to the proce...
LLVM_ABI void SetInterruptFunction(void(*IF)())
This function registers a function to be called when the user "interrupts" the program (typically by ...
LLVM_ABI void RunSignalHandlers()
LLVM_ABI void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie)
Add a function to be called when an abort/kill signal is delivered to the process.
LLVM_ABI void CleanupOnSignal(uintptr_t Context)
This function does the following:
LLVM_ABI void RunInterruptHandlers()
This function runs all the registered interrupt handlers, including the removal of files registered b...
LLVM_ABI void PrintStackTraceOnErrorSignal(StringRef Argv0, bool DisableCrashReporting=false)
When an error signal (such as SIGABRT or SIGSEGV) is delivered to the process, print a stack trace an...
void(*)(void *) SignalHandlerCallback
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
ScopedHandle< CommonHandleTraits > ScopedCommonHandle
auto reverse(ContainerTy &&C)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
ScopedHandle< RegTraits > ScopedRegHandle
LLVM_ABI std::error_code mapWindowsError(unsigned EV)