LLVM 17.0.0git
|
Mediates between COFF initialization and ExecutionSession state. More...
#include "llvm/ExecutionEngine/Orc/COFFPlatform.h"
Public Types | |
using | LoadDynamicLibrary = unique_function< Error(JITDylib &JD, StringRef DLLFileName)> |
A function that will be called with the name of dll file that must be loaded. | |
Public Member Functions | |
ExecutionSession & | getExecutionSession () const |
ObjectLinkingLayer & | getObjectLinkingLayer () const |
Error | setupJITDylib (JITDylib &JD) override |
This method will be called outside the session lock each time a JITDylib is created (unless it is created with EmptyJITDylib set) to allow the Platform to install any JITDylib specific standard symbols (e.g __dso_handle). | |
Error | teardownJITDylib (JITDylib &JD) override |
This method will be called outside the session lock each time a JITDylib is removed to allow the Platform to remove any JITDylib-specific data. | |
Error | notifyAdding (ResourceTracker &RT, const MaterializationUnit &MU) override |
This method will be called under the ExecutionSession lock each time a MaterializationUnit is added to a JITDylib. | |
Error | notifyRemoving (ResourceTracker &RT) override |
This method will be called under the ExecutionSession lock when a ResourceTracker is removed. | |
![]() | |
virtual | ~Platform () |
virtual Error | setupJITDylib (JITDylib &JD)=0 |
This method will be called outside the session lock each time a JITDylib is created (unless it is created with EmptyJITDylib set) to allow the Platform to install any JITDylib specific standard symbols (e.g __dso_handle). | |
virtual Error | teardownJITDylib (JITDylib &JD)=0 |
This method will be called outside the session lock each time a JITDylib is removed to allow the Platform to remove any JITDylib-specific data. | |
virtual Error | notifyAdding (ResourceTracker &RT, const MaterializationUnit &MU)=0 |
This method will be called under the ExecutionSession lock each time a MaterializationUnit is added to a JITDylib. | |
virtual Error | notifyRemoving (ResourceTracker &RT)=0 |
This method will be called under the ExecutionSession lock when a ResourceTracker is removed. | |
Static Public Member Functions | |
static Expected< std::unique_ptr< COFFPlatform > > | Create (ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer, JITDylib &PlatformJD, const char *OrcRuntimePath, LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime=false, const char *VCRuntimePath=nullptr, std::optional< SymbolAliasMap > RuntimeAliases=std::nullopt) |
Try to create a COFFPlatform instance, adding the ORC runtime to the given JITDylib. | |
static SymbolAliasMap | standardPlatformAliases (ExecutionSession &ES) |
Returns an AliasMap containing the default aliases for the COFFPlatform. | |
static ArrayRef< std::pair< const char *, const char * > > | requiredCXXAliases () |
Returns the array of required CXX aliases. | |
static ArrayRef< std::pair< const char *, const char * > > | standardRuntimeUtilityAliases () |
Returns the array of standard runtime utility aliases for COFF. | |
static bool | isInitializerSection (StringRef Name) |
static StringRef | getSEHFrameSectionName () |
![]() | |
static Expected< DenseMap< JITDylib *, SymbolMap > > | lookupInitSymbols (ExecutionSession &ES, const DenseMap< JITDylib *, SymbolLookupSet > &InitSyms) |
A utility function for looking up initializer symbols. | |
static void | lookupInitSymbolsAsync (unique_function< void(Error)> OnComplete, ExecutionSession &ES, const DenseMap< JITDylib *, SymbolLookupSet > &InitSyms) |
Performs an async lookup for the given symbols in each of the given JITDylibs, calling the given handler once all lookups have completed. | |
Mediates between COFF initialization and ExecutionSession state.
Definition at line 33 of file COFFPlatform.h.
using llvm::orc::COFFPlatform::LoadDynamicLibrary = unique_function<Error(JITDylib &JD, StringRef DLLFileName)> |
A function that will be called with the name of dll file that must be loaded.
Definition at line 37 of file COFFPlatform.h.
|
static |
Try to create a COFFPlatform instance, adding the ORC runtime to the given JITDylib.
Definition at line 163 of file COFFPlatform.cpp.
References llvm::orc::absoluteSymbols(), llvm::orc::JITDylib::addToLinkOrder(), llvm::orc::ExecutionSession::createBareJITDylib(), llvm::orc::JITDylib::define(), llvm::JITSymbolFlags::Exported, llvm::orc::ExecutionSession::getExecutorProcessControl(), llvm::inconvertibleErrorCode(), llvm::orc::ExecutionSession::intern(), P, standardPlatformAliases(), llvm::Error::success(), and llvm::orc::symbolAliases().
|
inline |
Definition at line 49 of file COFFPlatform.h.
|
inline |
Definition at line 50 of file COFFPlatform.h.
|
inlinestatic |
Definition at line 74 of file COFFPlatform.h.
Definition at line 70 of file COFFPlatform.h.
References Name.
Referenced by llvm::orc::getCOFFObjectFileSymbolInfo().
|
overridevirtual |
This method will be called under the ExecutionSession lock each time a MaterializationUnit is added to a JITDylib.
Implements llvm::orc::Platform.
Definition at line 290 of file COFFPlatform.cpp.
References llvm::dbgs(), llvm::orc::MaterializationUnit::getInitializerSymbol(), llvm::orc::ResourceTracker::getJITDylib(), llvm::orc::MaterializationUnit::getName(), LLVM_DEBUG, llvm::Error::success(), and llvm::orc::WeaklyReferencedSymbol.
|
overridevirtual |
This method will be called under the ExecutionSession lock when a ResourceTracker is removed.
Implements llvm::orc::Platform.
Definition at line 307 of file COFFPlatform.cpp.
References llvm_unreachable.
|
static |
Returns the array of required CXX aliases.
Definition at line 318 of file COFFPlatform.cpp.
Referenced by setupJITDylib().
This method will be called outside the session lock each time a JITDylib is created (unless it is created with EmptyJITDylib set) to allow the Platform to install any JITDylib specific standard symbols (e.g __dso_handle).
Implements llvm::orc::Platform.
Definition at line 234 of file COFFPlatform.cpp.
References llvm::orc::ObjectLinkingLayer::add(), llvm::orc::addAliases(), llvm::orc::JITDylib::addGenerator(), llvm::orc::DLLImportDefinitionGenerator::Create(), llvm::orc::JITDylib::define(), llvm::MemoryBuffer::getMemBuffer(), llvm::orc::getObjectFileInterface(), I, llvm::Lib, llvm::orc::ExecutionSession::lookup(), requiredCXXAliases(), llvm::Error::success(), and llvm::orc::symbolAliases().
|
static |
Returns an AliasMap containing the default aliases for the COFFPlatform.
This can be modified by clients when constructing the platform to add or remove aliases.
Definition at line 311 of file COFFPlatform.cpp.
References llvm::orc::addAliases(), and standardRuntimeUtilityAliases().
Referenced by Create().
|
static |
Returns the array of standard runtime utility aliases for COFF.
Definition at line 328 of file COFFPlatform.cpp.
Referenced by standardPlatformAliases().
This method will be called outside the session lock each time a JITDylib is removed to allow the Platform to remove any JITDylib-specific data.
Implements llvm::orc::Platform.
Definition at line 278 of file COFFPlatform.cpp.
References assert(), I, and llvm::Error::success().