LLVM 20.0.0git
|
Support class for static dtor execution. More...
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
Public Member Functions | |
void | runDestructors () |
Run any destructors recorded by the overriden __cxa_atexit function (CXAAtExitOverride). | |
Protected Types | |
using | DestructorPtr = void(*)(void *) |
using | CXXDestructorDataPair = std::pair< DestructorPtr, void * > |
using | CXXDestructorDataPairList = std::vector< CXXDestructorDataPair > |
Static Protected Member Functions | |
static int | CXAAtExitOverride (DestructorPtr Destructor, void *Arg, void *DSOHandle) |
Protected Attributes | |
CXXDestructorDataPairList | DSOHandleOverride |
Support class for static dtor execution.
For hosted (in-process) JITs only!
If a __cxa_atexit function isn't found C++ programs that use static destructors will fail to link. However, we don't want to use the host process's __cxa_atexit, because it will schedule JIT'd destructors to run after the JIT has been torn down, which is no good. This class makes it easy to override __cxa_atexit (and the related __dso_handle).
To use, clients should manually call searchOverrides from their symbol resolver. This should generally be done after attempting symbol resolution inside the JIT, but before searching the host process's symbol table. When the client determines that destructors should be run (generally at JIT teardown or after a return from main), the runDestructors method should be called.
Definition at line 175 of file ExecutionUtils.h.
|
protected |
Definition at line 183 of file ExecutionUtils.h.
|
protected |
Definition at line 184 of file ExecutionUtils.h.
|
protected |
Definition at line 182 of file ExecutionUtils.h.
|
staticprotected |
Definition at line 177 of file ExecutionUtils.cpp.
Referenced by llvm::orc::LocalCXXRuntimeOverrides::enable().
void llvm::orc::LocalCXXRuntimeOverridesBase::runDestructors | ( | ) |
Run any destructors recorded by the overriden __cxa_atexit function (CXAAtExitOverride).
Definition at line 170 of file ExecutionUtils.cpp.
References DSOHandleOverride, and P.
|
protected |
Definition at line 185 of file ExecutionUtils.h.
Referenced by llvm::orc::LocalCXXRuntimeOverrides::enable(), and runDestructors().