LLVM 22.0.0git
llvm::orc::COFFPlatform Class Reference

Mediates between COFF initialization and ExecutionSession state. More...

#include "llvm/ExecutionEngine/Orc/COFFPlatform.h"

Inheritance diagram for llvm::orc::COFFPlatform:
[legend]

Public Types

using LoadDynamicLibrary
 A function that will be called with the name of dll file that must be loaded.

Public Member Functions

ExecutionSessiongetExecutionSession () const
ObjectLinkingLayergetObjectLinkingLayer () 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 ()

Static Public Member Functions

static Expected< std::unique_ptr< COFFPlatform > > Create (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 (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.

Detailed Description

Mediates between COFF initialization and ExecutionSession state.

Definition at line 35 of file COFFPlatform.h.

Member Typedef Documentation

◆ LoadDynamicLibrary

Initial value:
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Represents a JIT'd dynamic library.
Definition Core.h:902
unique_function is a type-erasing functor similar to std::function.

A function that will be called with the name of dll file that must be loaded.

Definition at line 39 of file COFFPlatform.h.

Member Function Documentation

◆ Create() [1/2]

Expected< std::unique_ptr< COFFPlatform > > llvm::orc::COFFPlatform::Create ( ObjectLinkingLayer & ObjLinkingLayer,
JITDylib & PlatformJD,
const char * OrcRuntimePath,
LoadDynamicLibrary LoadDynLibrary,
bool StaticVCRuntime = false,
const char * VCRuntimePath = nullptr,
std::optional< SymbolAliasMap > RuntimeAliases = std::nullopt )
static

◆ Create() [2/2]

Expected< std::unique_ptr< COFFPlatform > > llvm::orc::COFFPlatform::Create ( ObjectLinkingLayer & ObjLinkingLayer,
JITDylib & PlatformJD,
std::unique_ptr< MemoryBuffer > OrcRuntimeArchiveBuffer,
LoadDynamicLibrary LoadDynLibrary,
bool StaticVCRuntime = false,
const char * VCRuntimePath = nullptr,
std::optional< SymbolAliasMap > RuntimeAliases = std::nullopt )
static

◆ getExecutionSession()

ExecutionSession & llvm::orc::COFFPlatform::getExecutionSession ( ) const
inline

Definition at line 57 of file COFFPlatform.h.

◆ getObjectLinkingLayer()

ObjectLinkingLayer & llvm::orc::COFFPlatform::getObjectLinkingLayer ( ) const
inline

Definition at line 58 of file COFFPlatform.h.

◆ getSEHFrameSectionName()

StringRef llvm::orc::COFFPlatform::getSEHFrameSectionName ( )
inlinestatic

Definition at line 78 of file COFFPlatform.h.

◆ notifyAdding()

◆ notifyRemoving()

Error llvm::orc::COFFPlatform::notifyRemoving ( ResourceTracker & RT)
overridevirtual

This method will be called under the ExecutionSession lock when a ResourceTracker is removed.

Implements llvm::orc::Platform.

Definition at line 337 of file COFFPlatform.cpp.

References llvm_unreachable.

◆ requiredCXXAliases()

ArrayRef< std::pair< const char *, const char * > > llvm::orc::COFFPlatform::requiredCXXAliases ( )
static

Returns the array of required CXX aliases.

Definition at line 348 of file COFFPlatform.cpp.

Referenced by setupJITDylib().

◆ setupJITDylib()

Error llvm::orc::COFFPlatform::setupJITDylib ( JITDylib & JD)
overridevirtual

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 264 of file COFFPlatform.cpp.

References llvm::orc::addAliases(), llvm::orc::JITDylib::addGenerator(), llvm::orc::DLLImportDefinitionGenerator::Create(), llvm::orc::JITDylib::define(), llvm::MemoryBuffer::getMemBuffer(), llvm::orc::getObjectFileInterface(), I, llvm::Lib, requiredCXXAliases(), llvm::Error::success(), and llvm::orc::symbolAliases().

◆ standardPlatformAliases()

SymbolAliasMap llvm::orc::COFFPlatform::standardPlatformAliases ( ExecutionSession & ES)
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 341 of file COFFPlatform.cpp.

References llvm::orc::addAliases(), and standardRuntimeUtilityAliases().

Referenced by Create().

◆ standardRuntimeUtilityAliases()

ArrayRef< std::pair< const char *, const char * > > llvm::orc::COFFPlatform::standardRuntimeUtilityAliases ( )
static

Returns the array of standard runtime utility aliases for COFF.

Definition at line 358 of file COFFPlatform.cpp.

Referenced by standardPlatformAliases().

◆ teardownJITDylib()

Error llvm::orc::COFFPlatform::teardownJITDylib ( JITDylib & JD)
overridevirtual

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 308 of file COFFPlatform.cpp.

References assert(), I, and llvm::Error::success().


The documentation for this class was generated from the following files: