LLVM
8.0.1
|
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). More... | |
Protected Types | |
using | DestructorPtr = void(*)(void *) |
using | CXXDestructorDataPair = std::pair< DestructorPtr, void * > |
using | CXXDestructorDataPairList = std::vector< CXXDestructorDataPair > |
Protected Member Functions | |
template<typename PtrTy > | |
JITTargetAddress | toTargetAddress (PtrTy *P) |
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 161 of file ExecutionUtils.h.
|
protected |
Definition at line 173 of file ExecutionUtils.h.
|
protected |
Definition at line 174 of file ExecutionUtils.h.
|
protected |
Definition at line 172 of file ExecutionUtils.h.
|
staticprotected |
Definition at line 159 of file ExecutionUtils.cpp.
void llvm::orc::LocalCXXRuntimeOverridesBase::runDestructors | ( | ) |
Run any destructors recorded by the overriden __cxa_atexit function (CXAAtExitOverride).
Definition at line 152 of file ExecutionUtils.cpp.
References P.
|
inlineprotected |
Definition at line 168 of file ExecutionUtils.h.
References P.
|
protected |
Definition at line 175 of file ExecutionUtils.h.