13#ifndef LLVM_EXECUTIONENGINE_ORC_LAYER_H
14#define LLVM_EXECUTIONENGINE_ORC_LAYER_H
92 this->CloneToNewContextOnEmit = CloneToNewContextOnEmit;
109 virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
113 bool CloneToNewContextOnEmit =
false;
127 void materialize(std::unique_ptr<MaterializationResponsibility> R)
override;
166 virtual void emit(std::unique_ptr<MaterializationResponsibility> R,
167 std::unique_ptr<MemoryBuffer> O) = 0;
182 std::unique_ptr<MemoryBuffer> O,
189 void materialize(std::unique_ptr<MaterializationResponsibility> R)
override;
193 std::unique_ptr<MemoryBuffer> O;
Module.h This file contains the declarations for the Module class.
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Inheritance utility for extensible RTTI.
StringRef - Represent a constant reference to a string, i.e.
MaterializationUnit that materializes modules by calling the 'emit' method on the given IRLayer.
Materializes the given object file (represented by a MemoryBuffer instance) by calling 'emit' on the ...
static Expected< std::unique_ptr< BasicObjectLayerMaterializationUnit > > Create(ObjectLayer &L, std::unique_ptr< MemoryBuffer > O)
Create using the default object interface builder function.
StringRef getName() const override
Return the buffer's identifier as the name for this MaterializationUnit.
An ExecutionSession represents a running JIT program.
Interface for layers that accept LLVM IR.
IRLayer(ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO)
virtual void emit(std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0
Emit should materialize the given IR.
virtual Error add(ResourceTrackerSP RT, ThreadSafeModule TSM)
Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker.
ExecutionSession & getExecutionSession()
Returns the ExecutionSession for this layer.
void setCloneToNewContextOnEmit(bool CloneToNewContextOnEmit)
Sets the CloneToNewContextOnEmit flag (false by default).
Error add(JITDylib &JD, ThreadSafeModule TSM)
Adds a MaterializationUnit representing the given IR to the given JITDylib.
const IRSymbolMapper::ManglingOptions *& getManglingOptions() const
Get the mangling options for this layer.
bool getCloneToNewContextOnEmit() const
Returns the current value of the CloneToNewContextOnEmit flag.
IRMaterializationUnit is a convenient base class for MaterializationUnits wrapping LLVM IR.
StringRef getName() const override
Return the ModuleIdentifier as the name for this MaterializationUnit.
SymbolNameToDefinitionMap SymbolToDefinition
const ThreadSafeModule & getModule() const
Return a reference to the contained ThreadSafeModule.
std::map< SymbolStringPtr, GlobalValue * > SymbolNameToDefinitionMap
Represents a JIT'd dynamic library.
ResourceTrackerSP getDefaultResourceTracker()
Get the default resource tracker for this JITDylib.
A MaterializationUnit represents a set of symbol definitions that can be materialized as a group,...
Interface for Layers that accept object files.
Error add(JITDylib &JD, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I)
Adds a MaterializationUnit for the object file in the given memory buffer to the given JITDylib.
virtual void emit(std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O)=0
Emit should materialize the given IR.
virtual Error add(ResourceTrackerSP RT, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I)
Adds a MaterializationUnit for the object file in the given memory buffer to the JITDylib for the giv...
ExecutionSession & getExecutionSession()
Returns the execution session for this layer.
Pointer to a pooled string representing a symbol name.
An LLVM Module together with a shared ThreadSafeContext.
This is an optimization pass for GlobalISel generic memory operations.