class LocalCXXRuntimeOverridesBase
Declaration
class LocalCXXRuntimeOverridesBase { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:171
Member Variables
- protected llvm::orc::LocalCXXRuntimeOverridesBase:: CXXDestructorDataPairList DSOHandleOverride
Method Overview
- protected static int CXAAtExitOverride(llvm::orc::LocalCXXRuntimeOverridesBase::DestructorPtr Destructor, void * Arg, void * DSOHandle)
- public void runDestructors()
- protected template <typename PtrTy>llvm::JITTargetAddress toTargetAddress(PtrTy * P)
Methods
¶static int CXAAtExitOverride(
llvm::orc::LocalCXXRuntimeOverridesBase::
DestructorPtr Destructor,
void* Arg,
void* DSOHandle)
static int CXAAtExitOverride(
llvm::orc::LocalCXXRuntimeOverridesBase::
DestructorPtr Destructor,
void* Arg,
void* DSOHandle)
Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:186
Parameters
- llvm::orc::LocalCXXRuntimeOverridesBase:: DestructorPtr Destructor
- void* Arg
- void* DSOHandle
¶void runDestructors()
void runDestructors()
Description
Run any destructors recorded by the overriden __cxa_atexit function (CXAAtExitOverride).
Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:175
¶template <typename PtrTy>
llvm::JITTargetAddress toTargetAddress(PtrTy* P)
template <typename PtrTy>
llvm::JITTargetAddress toTargetAddress(PtrTy* P)
Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:178
Templates
- PtrTy
Parameters
- PtrTy* P