LLVM  10.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::IRTransformLayer Class Reference

A layer that applies a transform to emitted modules. More...

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

Inheritance diagram for llvm::orc::IRTransformLayer:
Inheritance graph
Collaboration diagram for llvm::orc::IRTransformLayer:
Collaboration graph

Public Types

using TransformFunction = std::function< Expected< ThreadSafeModule >(ThreadSafeModule, const MaterializationResponsibility &R)>

Public Member Functions

 IRTransformLayer (ExecutionSession &ES, IRLayer &BaseLayer, TransformFunction Transform=identityTransform)
void setTransform (TransformFunction Transform)
void emit (MaterializationResponsibility R, ThreadSafeModule TSM) override
 Emit should materialize the given IR. More...
- Public Member Functions inherited from llvm::orc::IRLayer
 IRLayer (ExecutionSession &ES)
virtual ~IRLayer ()
ExecutionSessiongetExecutionSession ()
 Returns the ExecutionSession 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 (JITDylib &JD, ThreadSafeModule TSM, VModuleKey K=VModuleKey())
 Adds a MaterializationUnit representing the given IR to the given JITDylib. More...

Static Public Member Functions

static ThreadSafeModule identityTransform (ThreadSafeModule TSM, const MaterializationResponsibility &R)

Detailed Description

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 28 of file IRTransformLayer.h.

Member Typedef Documentation

◆ TransformFunction

Definition at line 31 of file IRTransformLayer.h.

Constructor & Destructor Documentation

◆ IRTransformLayer()

llvm::orc::IRTransformLayer::IRTransformLayer ( ExecutionSession ES,
IRLayer BaseLayer,
TransformFunction  Transform = identityTransform 

Definition at line 15 of file IRTransformLayer.cpp.

Member Function Documentation

◆ emit()

void llvm::orc::IRTransformLayer::emit ( MaterializationResponsibility  R,
ThreadSafeModule  TSM 

◆ identityTransform()

static ThreadSafeModule llvm::orc::IRTransformLayer::identityTransform ( ThreadSafeModule  TSM,
const MaterializationResponsibility R 

Definition at line 43 of file IRTransformLayer.h.

◆ setTransform()

void llvm::orc::IRTransformLayer::setTransform ( TransformFunction  Transform)

Definition at line 36 of file IRTransformLayer.h.

References emit().

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