LLVM 20.0.0git
|
A layer that applies a transform to emitted modules. More...
#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
Public Types | |
using | TransformFunction = unique_function< Expected< ThreadSafeModule >(ThreadSafeModule, MaterializationResponsibility &R)> |
Public Member Functions | |
IRTransformLayer (ExecutionSession &ES, IRLayer &BaseLayer, TransformFunction Transform=identityTransform) | |
void | setTransform (TransformFunction Transform) |
void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM) override |
Emit should materialize the given IR. | |
Public Member Functions inherited from llvm::orc::IRLayer | |
IRLayer (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO) | |
virtual | ~IRLayer () |
ExecutionSession & | getExecutionSession () |
Returns the ExecutionSession for this layer. | |
const IRSymbolMapper::ManglingOptions *& | getManglingOptions () const |
Get the mangling options for this layer. | |
void | setCloneToNewContextOnEmit (bool CloneToNewContextOnEmit) |
Sets the CloneToNewContextOnEmit flag (false by default). | |
bool | getCloneToNewContextOnEmit () const |
Returns the current value of the CloneToNewContextOnEmit flag. | |
virtual Error | add (ResourceTrackerSP RT, ThreadSafeModule TSM) |
Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker. | |
Error | add (JITDylib &JD, ThreadSafeModule TSM) |
Adds a MaterializationUnit representing the given IR to the given JITDylib. | |
virtual void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0 |
Emit should materialize the given IR. | |
Static Public Member Functions | |
static ThreadSafeModule | identityTransform (ThreadSafeModule TSM, MaterializationResponsibility &R) |
A layer that applies a transform to emitted modules.
The transform function is responsible for locking the ThreadSafeContext before operating on the module.
Definition at line 27 of file IRTransformLayer.h.
using llvm::orc::IRTransformLayer::TransformFunction = unique_function<Expected<ThreadSafeModule>( ThreadSafeModule, MaterializationResponsibility &R)> |
Definition at line 29 of file IRTransformLayer.h.
llvm::orc::IRTransformLayer::IRTransformLayer | ( | ExecutionSession & | ES, |
IRLayer & | BaseLayer, | ||
TransformFunction | Transform = identityTransform |
||
) |
Definition at line 15 of file IRTransformLayer.cpp.
|
overridevirtual |
Emit should materialize the given IR.
Implements llvm::orc::IRLayer.
Definition at line 20 of file IRTransformLayer.cpp.
References assert(), llvm::orc::IRLayer::emit(), llvm::orc::IRLayer::getExecutionSession(), and llvm::orc::ExecutionSession::reportError().
|
inlinestatic |
Definition at line 42 of file IRTransformLayer.h.
|
inline |
Definition at line 35 of file IRTransformLayer.h.