LLVM  14.0.0git
Public Member Functions | List of all members
llvm::orc::IRLayer Class Referenceabstract

Interface for layers that accept LLVM IR. More...

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

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

Public Member Functions

 IRLayer (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO)
 
virtual ~IRLayer ()
 
ExecutionSessiongetExecutionSession ()
 Returns the ExecutionSession for this layer. More...
 
const IRSymbolMapper::ManglingOptions *& getManglingOptions () const
 Get the mangling options for this layer. More...
 
void setCloneToNewContextOnEmit (bool CloneToNewContextOnEmit)
 Sets the CloneToNewContextOnEmit flag (false by default). More...
 
bool getCloneToNewContextOnEmit () const
 Returns the current value of the CloneToNewContextOnEmit flag. More...
 
virtual Error add (ResourceTrackerSP RT, ThreadSafeModule TSM)
 Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker. More...
 
Error add (JITDylib &JD, ThreadSafeModule TSM)
 Adds a MaterializationUnit representing the given IR to the given JITDylib. More...
 
virtual void emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0
 Emit should materialize the given IR. More...
 

Detailed Description

Interface for layers that accept LLVM IR.

Definition at line 68 of file Layer.h.

Constructor & Destructor Documentation

◆ IRLayer()

llvm::orc::IRLayer::IRLayer ( ExecutionSession ES,
const IRSymbolMapper::ManglingOptions *&  MO 
)
inline

Definition at line 70 of file Layer.h.

◆ ~IRLayer()

llvm::orc::IRLayer::~IRLayer ( )
virtual

Definition at line 23 of file Layer.cpp.

Member Function Documentation

◆ add() [1/2]

Error llvm::orc::IRLayer::add ( JITDylib JD,
ThreadSafeModule  TSM 
)
inline

Adds a MaterializationUnit representing the given IR to the given JITDylib.

If RT is not specif

Definition at line 105 of file Layer.h.

References add(), llvm::orc::JITDylib::getDefaultResourceTracker(), and move.

◆ add() [2/2]

Error llvm::orc::IRLayer::add ( ResourceTrackerSP  RT,
ThreadSafeModule  TSM 
)
virtual

Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker.

Definition at line 25 of file Layer.cpp.

References assert(), getManglingOptions(), and move.

Referenced by add().

◆ emit()

virtual void llvm::orc::IRLayer::emit ( std::unique_ptr< MaterializationResponsibility R,
ThreadSafeModule  TSM 
)
pure virtual

◆ getCloneToNewContextOnEmit()

bool llvm::orc::IRLayer::getCloneToNewContextOnEmit ( ) const
inline

Returns the current value of the CloneToNewContextOnEmit flag.

Definition at line 97 of file Layer.h.

◆ getExecutionSession()

ExecutionSession& llvm::orc::IRLayer::getExecutionSession ( )
inline

◆ getManglingOptions()

const IRSymbolMapper::ManglingOptions*& llvm::orc::IRLayer::getManglingOptions ( ) const
inline

Get the mangling options for this layer.

Definition at line 79 of file Layer.h.

Referenced by add().

◆ setCloneToNewContextOnEmit()

void llvm::orc::IRLayer::setCloneToNewContextOnEmit ( bool  CloneToNewContextOnEmit)
inline

Sets the CloneToNewContextOnEmit flag (false by default).

When set, IR modules added to this layer will be cloned on to a new context before emit is called. This can be used by clients who want to load all IR using one LLVMContext (to save memory via type and constant uniquing), but want to move Modules to fresh contexts before compiling them to enable concurrent compilation. Single threaded clients, or clients who load every module on a new context, need not set this.

Definition at line 92 of file Layer.h.


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