class RTDyldObjectLinkingLayer

Declaration

class RTDyldObjectLinkingLayer : public RTTIExtends,
                                 private ResourceManager { /* full declaration omitted */ };

Description

Inheritance utility for extensible RTTI. Supports single inheritance only: A class can only have one ExtensibleRTTI-parent (i.e. a parent for which the isa < > test will work), though it can have many non-ExtensibleRTTI parents. RTTIExtents uses CRTP so the first template argument to RTTIExtends is the newly introduced type, and the *second* argument is the parent class. class MyType : public RTTIExtends <MyType , RTTIRoot> { public: static char ID; }; class MyDerivedType : public RTTIExtends <MyDerivedType , MyType> { public: static char ID; };

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:37

Inherits from: RTTIExtends, ResourceManager

Member Variables

private std::mutex RTDyldLayerMutex
private llvm::orc::RTDyldObjectLinkingLayer:: GetMemoryManagerFunction GetMemoryManager
private llvm::orc::RTDyldObjectLinkingLayer:: NotifyLoadedFunction NotifyLoaded
private llvm::orc::RTDyldObjectLinkingLayer:: NotifyEmittedFunction NotifyEmitted
private bool ProcessAllSections = false
private bool OverrideObjectFlags = false
private bool AutoClaimObjectSymbols = false
private DenseMap<llvm::orc::ResourceKey, std::vector<MemoryManagerUP>> MemMgrs
private std::vector<JITEventListener*> EventListeners
public static char ID

Method Overview

  • public RTDyldObjectLinkingLayer(llvm::orc::ExecutionSession & ES, llvm::orc::RTDyldObjectLinkingLayer::GetMemoryManagerFunction GetMemoryManager)
  • public void emit(std::unique_ptr<MaterializationResponsibility> R, std::unique_ptr<MemoryBuffer> O)
  • private llvm::Error handleRemoveResources(llvm::orc::ResourceKey K)
  • private void handleTransferResources(llvm::orc::ResourceKey DstKey, llvm::orc::ResourceKey SrcKey)
  • private void onObjEmit(llvm::orc::MaterializationResponsibility & R, object::OwningBinary<object::ObjectFile> O, std::unique_ptr<RuntimeDyld::MemoryManager> MemMgr, std::unique_ptr<RuntimeDyld::LoadedObjectInfo> LoadedObjInfo, llvm::Error Err)
  • private llvm::Error onObjLoad(llvm::orc::MaterializationResponsibility & R, const object::ObjectFile & Obj, RuntimeDyld::MemoryManager & MemMgr, RuntimeDyld::LoadedObjectInfo & LoadedObjInfo, std::map<StringRef, JITEvaluatedSymbol> Resolved, std::set<StringRef> & InternalSymbols)
  • public void registerJITEventListener(llvm::JITEventListener & L)
  • public llvm::orc::RTDyldObjectLinkingLayer & setAutoClaimResponsibilityForObjectSymbols(bool AutoClaimObjectSymbols)
  • public llvm::orc::RTDyldObjectLinkingLayer & setNotifyEmitted(llvm::orc::RTDyldObjectLinkingLayer::NotifyEmittedFunction NotifyEmitted)
  • public llvm::orc::RTDyldObjectLinkingLayer & setNotifyLoaded(llvm::orc::RTDyldObjectLinkingLayer::NotifyLoadedFunction NotifyLoaded)
  • public llvm::orc::RTDyldObjectLinkingLayer & setOverrideObjectFlagsWithResponsibilityFlags(bool OverrideObjectFlags)
  • public llvm::orc::RTDyldObjectLinkingLayer & setProcessAllSections(bool ProcessAllSections)
  • public void unregisterJITEventListener(llvm::JITEventListener & L)
  • public ~RTDyldObjectLinkingLayer()

Methods

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

Description

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

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:57

Parameters

llvm::orc::ExecutionSession& ES
llvm::orc::RTDyldObjectLinkingLayer:: GetMemoryManagerFunction GetMemoryManager

void emit(std::unique_ptr<
              MaterializationResponsibility> R,
          std::unique_ptr<MemoryBuffer> O)

Description

Emit the object.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:63

Parameters

std::unique_ptr<MaterializationResponsibility> R
std::unique_ptr<MemoryBuffer> O

llvm::Error handleRemoveResources(
    llvm::orc::ResourceKey K)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:143

Parameters

llvm::orc::ResourceKey K

void handleTransferResources(
    llvm::orc::ResourceKey DstKey,
    llvm::orc::ResourceKey SrcKey)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:144

Parameters

llvm::orc::ResourceKey DstKey
llvm::orc::ResourceKey SrcKey

void onObjEmit(
    llvm::orc::MaterializationResponsibility& R,
    object::OwningBinary<object::ObjectFile> O,
    std::unique_ptr<RuntimeDyld::MemoryManager>
        MemMgr,
    std::unique_ptr<RuntimeDyld::LoadedObjectInfo>
        LoadedObjInfo,
    llvm::Error Err)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:137

Parameters

llvm::orc::MaterializationResponsibility& R
object::OwningBinary<object::ObjectFile> O
std::unique_ptr<RuntimeDyld::MemoryManager> MemMgr
std::unique_ptr<RuntimeDyld::LoadedObjectInfo> LoadedObjInfo
llvm::Error Err

llvm::Error onObjLoad(
    llvm::orc::MaterializationResponsibility& R,
    const object::ObjectFile& Obj,
    RuntimeDyld::MemoryManager& MemMgr,
    RuntimeDyld::LoadedObjectInfo& LoadedObjInfo,
    std::map<StringRef, JITEvaluatedSymbol>
        Resolved,
    std::set<StringRef>& InternalSymbols)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:130

Parameters

llvm::orc::MaterializationResponsibility& R
const object::ObjectFile& Obj
RuntimeDyld::MemoryManager& MemMgr
RuntimeDyld::LoadedObjectInfo& LoadedObjInfo
std::map<StringRef, JITEvaluatedSymbol> Resolved
std::set<StringRef>& InternalSymbols

void registerJITEventListener(
    llvm::JITEventListener& L)

Description

Register a JITEventListener.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:122

Parameters

llvm::JITEventListener& L

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

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:116

Parameters

bool AutoClaimObjectSymbols

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

Description

Set the NotifyEmitted callback.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:74

Parameters

llvm::orc::RTDyldObjectLinkingLayer:: NotifyEmittedFunction NotifyEmitted

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

Description

Set the NotifyLoaded callback.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:67

Parameters

llvm::orc::RTDyldObjectLinkingLayer:: NotifyLoadedFunction NotifyLoaded

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

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:99

Parameters

bool OverrideObjectFlags

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

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:85

Parameters

bool ProcessAllSections

void unregisterJITEventListener(
    llvm::JITEventListener& L)

Description

Unregister a JITEventListener.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:125

Parameters

llvm::JITEventListener& L

~RTDyldObjectLinkingLayer()

Declared at: llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h:60