LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Attributes | List of all members
llvm::orc::RTDyldObjectLinkingLayer Class Reference

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

Inheritance diagram for llvm::orc::RTDyldObjectLinkingLayer:
Inheritance graph
[legend]

Public Types

using NotifyLoadedFunction = std::function< void(MaterializationResponsibility &R, const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &)>
 Functor for receiving object-loaded notifications.
 
using NotifyEmittedFunction = std::function< void(MaterializationResponsibility &R, std::unique_ptr< MemoryBuffer >)>
 Functor for receiving finalization notifications.
 
using GetMemoryManagerFunction = unique_function< std::unique_ptr< RuntimeDyld::MemoryManager >()>
 

Public Member Functions

 RTDyldObjectLinkingLayer (ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager)
 Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors.
 
 ~RTDyldObjectLinkingLayer ()
 
void emit (std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O) override
 Emit the object.
 
RTDyldObjectLinkingLayersetNotifyLoaded (NotifyLoadedFunction NotifyLoaded)
 Set the NotifyLoaded callback.
 
RTDyldObjectLinkingLayersetNotifyEmitted (NotifyEmittedFunction NotifyEmitted)
 Set the NotifyEmitted callback.
 
RTDyldObjectLinkingLayersetProcessAllSections (bool ProcessAllSections)
 Set the 'ProcessAllSections' flag.
 
RTDyldObjectLinkingLayersetOverrideObjectFlagsWithResponsibilityFlags (bool OverrideObjectFlags)
 Instructs this RTDyldLinkingLayer2 instance to override the symbol flags returned by RuntimeDyld for any given object file with the flags supplied by the MaterializationResponsibility instance.
 
RTDyldObjectLinkingLayersetAutoClaimResponsibilityForObjectSymbols (bool AutoClaimObjectSymbols)
 If set, this RTDyldObjectLinkingLayer instance will claim responsibility for any symbols provided by a given object file that were not already in the MaterializationResponsibility instance.
 
void registerJITEventListener (JITEventListener &L)
 Register a JITEventListener.
 
void unregisterJITEventListener (JITEventListener &L)
 Unregister a JITEventListener.
 
- Public Member Functions inherited from llvm::RTTIExtends< RTDyldObjectLinkingLayer, ObjectLayer >
const void * dynamicClassID () const override
 
bool isA (const void *const ClassID) const override
 

Static Public Attributes

static char ID
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::RTTIExtends< RTDyldObjectLinkingLayer, ObjectLayer >
static const void * classID ()
 
static bool classof (const RTTIRoot *R)
 

Detailed Description

Definition at line 36 of file RTDyldObjectLinkingLayer.h.

Member Typedef Documentation

◆ GetMemoryManagerFunction

Definition at line 51 of file RTDyldObjectLinkingLayer.h.

◆ NotifyEmittedFunction

Functor for receiving finalization notifications.

Definition at line 48 of file RTDyldObjectLinkingLayer.h.

◆ NotifyLoadedFunction

Functor for receiving object-loaded notifications.

Definition at line 43 of file RTDyldObjectLinkingLayer.h.

Constructor & Destructor Documentation

◆ RTDyldObjectLinkingLayer()

llvm::orc::RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer ( ExecutionSession ES,
GetMemoryManagerFunction  GetMemoryManager 
)

Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors.

Definition at line 82 of file RTDyldObjectLinkingLayer.cpp.

References llvm::orc::ExecutionSession::registerResourceManager().

◆ ~RTDyldObjectLinkingLayer()

llvm::orc::RTDyldObjectLinkingLayer::~RTDyldObjectLinkingLayer ( )

Member Function Documentation

◆ emit()

void llvm::orc::RTDyldObjectLinkingLayer::emit ( std::unique_ptr< MaterializationResponsibility R,
std::unique_ptr< MemoryBuffer O 
)
override

◆ registerJITEventListener()

void llvm::orc::RTDyldObjectLinkingLayer::registerJITEventListener ( JITEventListener L)

◆ setAutoClaimResponsibilityForObjectSymbols()

RTDyldObjectLinkingLayer & llvm::orc::RTDyldObjectLinkingLayer::setAutoClaimResponsibilityForObjectSymbols ( bool  AutoClaimObjectSymbols)
inline

If set, this RTDyldObjectLinkingLayer instance will claim responsibility for any symbols provided by a given object file that were not already in the MaterializationResponsibility instance.

Setting this flag allows higher-level program representations (e.g. LLVM IR) to be added based on only a subset of the symbols they provide, without having to write intervening layers to scan and add the additional symbols. This trades diagnostic quality for convenience however: If all symbols are enumerated up-front then clashes can be detected and reported early (and usually deterministically). If this option is set, clashes for the additional symbols may not be detected until late, and detection may depend on the flow of control through JIT'd code. Use with care.

Definition at line 115 of file RTDyldObjectLinkingLayer.h.

◆ setNotifyEmitted()

RTDyldObjectLinkingLayer & llvm::orc::RTDyldObjectLinkingLayer::setNotifyEmitted ( NotifyEmittedFunction  NotifyEmitted)
inline

Set the NotifyEmitted callback.

Definition at line 73 of file RTDyldObjectLinkingLayer.h.

◆ setNotifyLoaded()

RTDyldObjectLinkingLayer & llvm::orc::RTDyldObjectLinkingLayer::setNotifyLoaded ( NotifyLoadedFunction  NotifyLoaded)
inline

Set the NotifyLoaded callback.

Definition at line 66 of file RTDyldObjectLinkingLayer.h.

◆ setOverrideObjectFlagsWithResponsibilityFlags()

RTDyldObjectLinkingLayer & llvm::orc::RTDyldObjectLinkingLayer::setOverrideObjectFlagsWithResponsibilityFlags ( bool  OverrideObjectFlags)
inline

Instructs this RTDyldLinkingLayer2 instance to override the symbol flags returned by RuntimeDyld for any given object file with the flags supplied by the MaterializationResponsibility instance.

This is a workaround to support symbol visibility in COFF, which does not use the libObject's SF_Exported flag. Use only when generating / adding COFF object files.

FIXME: We should be able to remove this if/when COFF properly tracks exported symbols.

Definition at line 98 of file RTDyldObjectLinkingLayer.h.

◆ setProcessAllSections()

RTDyldObjectLinkingLayer & llvm::orc::RTDyldObjectLinkingLayer::setProcessAllSections ( bool  ProcessAllSections)
inline

Set the 'ProcessAllSections' flag.

If set to true, all sections in each object file will be allocated using the memory manager, rather than just the sections required for execution.

This is kludgy, and may be removed in the future.

Definition at line 84 of file RTDyldObjectLinkingLayer.h.

◆ unregisterJITEventListener()

void llvm::orc::RTDyldObjectLinkingLayer::unregisterJITEventListener ( JITEventListener L)

Unregister a JITEventListener.

Definition at line 215 of file RTDyldObjectLinkingLayer.cpp.

References assert(), llvm::find(), and I.

Member Data Documentation

◆ ID

char llvm::orc::RTDyldObjectLinkingLayer::ID
static

Definition at line 40 of file RTDyldObjectLinkingLayer.h.


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