LLVM 17.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::COFFPlatform:
Collaboration graph
[legend]

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

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 ()
 
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 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 33 of file COFFPlatform.h.

Member Typedef Documentation

◆ LoadDynamicLibrary

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

Definition at line 37 of file COFFPlatform.h.

Member Function Documentation

◆ Create()

Expected< std::unique_ptr< COFFPlatform > > llvm::orc::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

◆ getExecutionSession()

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

Definition at line 49 of file COFFPlatform.h.

◆ getObjectLinkingLayer()

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

Definition at line 50 of file COFFPlatform.h.

◆ getSEHFrameSectionName()

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

Definition at line 74 of file COFFPlatform.h.

◆ isInitializerSection()

static bool llvm::orc::COFFPlatform::isInitializerSection ( StringRef  Name)
inlinestatic

Definition at line 70 of file COFFPlatform.h.

References Name.

Referenced by llvm::orc::getCOFFObjectFileSymbolInfo().

◆ notifyAdding()

Error llvm::orc::COFFPlatform::notifyAdding ( ResourceTracker RT,
const MaterializationUnit MU 
)
overridevirtual

◆ 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 307 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 318 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 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().

◆ 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 311 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 328 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 278 of file COFFPlatform.cpp.

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


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