LLVM  3.7.0
Classes | Public Types | Public Member Functions | List of all members
llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor > Class Template Reference

Bare bones object linking layer. More...

#include <ObjectLinkingLayer.h>

Inheritance diagram for llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >:
[legend]
Collaboration diagram for llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >:
[legend]

Public Types

typedef std::vector
< std::unique_ptr
< RuntimeDyld::LoadedObjectInfo > > 
LoadedObjInfoList
 LoadedObjectInfo list. More...
 
typedef std::function< void(ObjSetHandleT)> NotifyFinalizedFtor
 Functor for receiving finalization notifications. More...
 
- Public Types inherited from llvm::orc::ObjectLinkingLayerBase
typedef
LinkedObjectSetListT::iterator 
ObjSetHandleT
 Handle to a set of loaded objects. More...
 

Public Member Functions

 ObjectLinkingLayer (NotifyLoadedFtor NotifyLoaded=NotifyLoadedFtor(), NotifyFinalizedFtor NotifyFinalized=NotifyFinalizedFtor())
 Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyFinalized functors. More...
 
template<typename ObjSetT , typename MemoryManagerPtrT , typename SymbolResolverPtrT >
ObjSetHandleT addObjectSet (const ObjSetT &Objects, MemoryManagerPtrT MemMgr, SymbolResolverPtrT Resolver)
 Add a set of objects (or archives) that will be treated as a unit for the purposes of symbol lookup and memory management. More...
 
void removeObjectSet (ObjSetHandleT H)
 Remove the set of objects associated with handle H. More...
 
JITSymbol findSymbol (StringRef Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (ObjSetHandleT H, StringRef Name, bool ExportedSymbolsOnly)
 Search for the given named symbol in the context of the set of loaded objects represented by the handle H. More...
 
void mapSectionAddress (ObjSetHandleT H, const void *LocalAddress, TargetAddress TargetAddr)
 Map section addresses for the objects associated with the handle H. More...
 
void emitAndFinalize (ObjSetHandleT H)
 Immediately emit and finalize the object set represented by the given handle. More...
 
- Public Member Functions inherited from llvm::orc::ObjectLinkingLayerBase
template<typename OwningMBSet >
void takeOwnershipOfBuffers (ObjSetHandleT H, OwningMBSet MBs)
 

Additional Inherited Members

- Protected Types inherited from llvm::orc::ObjectLinkingLayerBase
typedef std::list
< std::unique_ptr
< LinkedObjectSet > > 
LinkedObjectSetListT
 

Detailed Description

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
class llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >

Bare bones object linking layer.

This class is intended to be used as the base layer for a JIT. It allows object files to be loaded into memory, linked, and the addresses of their symbols queried. All objects added to this layer can see each other's symbols.

Definition at line 113 of file ObjectLinkingLayer.h.

Member Typedef Documentation

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
typedef std::vector<std::unique_ptr<RuntimeDyld::LoadedObjectInfo> > llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::LoadedObjInfoList

LoadedObjectInfo list.

Contains a list of owning pointers to RuntimeDyld::LoadedObjectInfo instances.

Definition at line 150 of file ObjectLinkingLayer.h.

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
typedef std::function<void(ObjSetHandleT)> llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::NotifyFinalizedFtor

Functor for receiving finalization notifications.

Definition at line 153 of file ObjectLinkingLayer.h.

Constructor & Destructor Documentation

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::ObjectLinkingLayer ( NotifyLoadedFtor  NotifyLoaded = NotifyLoadedFtor(),
NotifyFinalizedFtor  NotifyFinalized = NotifyFinalizedFtor() 
)
inline

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

Definition at line 157 of file ObjectLinkingLayer.h.

Member Function Documentation

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
template<typename ObjSetT , typename MemoryManagerPtrT , typename SymbolResolverPtrT >
ObjSetHandleT llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::addObjectSet ( const ObjSetT &  Objects,
MemoryManagerPtrT  MemMgr,
SymbolResolverPtrT  Resolver 
)
inline

Add a set of objects (or archives) that will be treated as a unit for the purposes of symbol lookup and memory management.

Returns
A pair containing (1) A handle that can be used to free the memory allocated for the objects, and (2) a LoadedObjInfoList containing one LoadedObjInfo instance for each object at the corresponding index in the Objects list.

This version of this method allows the client to pass in an RTDyldMemoryManager instance that will be used to allocate memory and look up external symbol addresses for the given objects.

Definition at line 177 of file ObjectLinkingLayer.h.

Referenced by llvm::orc::OrcMCJITReplacement::addObjectFile().

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
void llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::emitAndFinalize ( ObjSetHandleT  H)
inline

Immediately emit and finalize the object set represented by the given handle.

Parameters
HHandle for object set to emit/finalize.

Definition at line 269 of file ObjectLinkingLayer.h.

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
JITSymbol llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::findSymbol ( StringRef  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol.

Parameters
NameThe name of the symbol to search for.
ExportedSymbolsOnlyIf true, search only for exported symbols.
Returns
A handle for the given named symbol, if it exists.

Definition at line 213 of file ObjectLinkingLayer.h.

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
JITSymbol llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::findSymbolIn ( ObjSetHandleT  H,
StringRef  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol in the context of the set of loaded objects represented by the handle H.

Parameters
HThe handle for the object set to search in.
NameThe name of the symbol to search for.
ExportedSymbolsOnlyIf true, search only for exported symbols.
Returns
A handle for the given named symbol, if it is found in the given object set.

Definition at line 229 of file ObjectLinkingLayer.h.

Referenced by llvm::orc::ObjectLinkingLayer< NotifyObjectLoadedT >::findSymbol().

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
void llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::mapSectionAddress ( ObjSetHandleT  H,
const void *  LocalAddress,
TargetAddress  TargetAddr 
)
inline

Map section addresses for the objects associated with the handle H.

Definition at line 261 of file ObjectLinkingLayer.h.

Referenced by llvm::orc::OrcMCJITReplacement::mapSectionAddress().

template<typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
void llvm::orc::ObjectLinkingLayer< NotifyLoadedFtor >::removeObjectSet ( ObjSetHandleT  H)
inline

Remove the set of objects associated with handle H.

All memory allocated for the objects will be freed, and the sections and symbols they provided will no longer be available. No attempt is made to re-emit the missing symbols, and any use of these symbols (directly or indirectly) will result in undefined behavior. If dependence tracking is required to detect or resolve such issues it should be added at a higher layer.

Definition at line 204 of file ObjectLinkingLayer.h.


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