LLVM  8.0.1
Public Types | Public Member Functions | List of all members
llvm::orc::RTDyldObjectLinkingLayer Class Reference

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

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

Public Types

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

Public Member Functions

 RTDyldObjectLinkingLayer (ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager, NotifyLoadedFunction NotifyLoaded=NotifyLoadedFunction(), NotifyEmittedFunction NotifyEmitted=NotifyEmittedFunction())
 Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors. More...
 
void emit (MaterializationResponsibility R, std::unique_ptr< MemoryBuffer > O) override
 Emit the object. More...
 
RTDyldObjectLinkingLayersetProcessAllSections (bool ProcessAllSections)
 Set the 'ProcessAllSections' flag. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from llvm::orc::ObjectLayer
 ObjectLayer (ExecutionSession &ES)
 
virtual ~ObjectLayer ()
 
ExecutionSessiongetExecutionSession ()
 Returns the execution session for this layer. More...
 
virtual Error add (JITDylib &JD, std::unique_ptr< MemoryBuffer > O, VModuleKey K=VModuleKey())
 Adds a MaterializationUnit representing the given IR to the given JITDylib. More...
 

Detailed Description

Definition at line 39 of file RTDyldObjectLinkingLayer.h.

Member Typedef Documentation

◆ GetMemoryManagerFunction

Definition at line 50 of file RTDyldObjectLinkingLayer.h.

◆ NotifyEmittedFunction

Functor for receiving finalization notifications.

Definition at line 47 of file RTDyldObjectLinkingLayer.h.

◆ NotifyLoadedFunction

Functor for receiving object-loaded notifications.

Definition at line 44 of file RTDyldObjectLinkingLayer.h.

Constructor & Destructor Documentation

◆ RTDyldObjectLinkingLayer()

llvm::orc::RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer ( ExecutionSession ES,
GetMemoryManagerFunction  GetMemoryManager,
NotifyLoadedFunction  NotifyLoaded = NotifyLoadedFunction(),
NotifyEmittedFunction  NotifyEmitted = NotifyEmittedFunction() 
)

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

Definition at line 80 of file RTDyldObjectLinkingLayer.cpp.

Member Function Documentation

◆ emit()

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

◆ 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 100 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 83 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 69 of file RTDyldObjectLinkingLayer.h.


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