LLVM 20.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. | |
Public Member Functions inherited from llvm::orc::Platform | |
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, std::unique_ptr< MemoryBuffer > OrcRuntimeArchiveBuffer, 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 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) |
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 StringRef | getSEHFrameSectionName () |
Static Public Member Functions inherited from llvm::orc::Platform | |
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 |
Definition at line 226 of file COFFPlatform.cpp.
References Create(), llvm::createFileError(), and llvm::MemoryBuffer::getFile().
|
static |
Try to create a COFFPlatform instance, adding the ORC runtime to the given JITDylib.
Definition at line 162 of file COFFPlatform.cpp.
References llvm::orc::absoluteSymbols(), llvm::orc::JITDylib::addToLinkOrder(), llvm::cantFail(), llvm::object::Archive::create(), llvm::orc::StaticLibraryDefinitionGenerator::Create(), llvm::orc::ExecutionSession::createBareJITDylib(), llvm::orc::JITDylib::define(), llvm::JITSymbolFlags::Exported, llvm::orc::ExecutionSession::getExecutorProcessControl(), llvm::orc::ExecutionSession::getTargetTriple(), llvm::inconvertibleErrorCode(), llvm::orc::ExecutionSession::intern(), P, standardPlatformAliases(), llvm::Triple::str(), llvm::Error::success(), and llvm::orc::symbolAliases().
Referenced by Create(), and llvm::orc::ExecutorNativePlatform::operator()().
|
inline |
Definition at line 57 of file COFFPlatform.h.
|
inline |
Definition at line 58 of file COFFPlatform.h.
|
inlinestatic |
Definition at line 78 of file COFFPlatform.h.
|
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 323 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 340 of file COFFPlatform.cpp.
References llvm_unreachable.
|
static |
Returns the array of required CXX aliases.
Definition at line 351 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 267 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 344 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 361 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 311 of file COFFPlatform.cpp.
References assert(), I, and llvm::Error::success().