17 :
IRLayer(ES), BaseLayer(BaseLayer), Compile(
std::move(Compile)) {}
20 std::lock_guard<std::mutex>
Lock(IRLayerMutex);
21 this->NotifyCompiled = std::move(NotifyCompiled);
28 if (
auto Obj = Compile(*TSM.
getModule())) {
30 std::lock_guard<std::mutex>
Lock(IRLayerMutex);
36 BaseLayer.
emit(std::move(R), std::move(*Obj));
void setNotifyCompiled(NotifyCompiledFunction NotifyCompiled)
IRCompileLayer(ExecutionSession &ES, ObjectLayer &BaseLayer, CompileFunction Compile)
This class represents lattice values for constants.
void emit(MaterializationResponsibility R, ThreadSafeModule TSM) override
Emit should materialize the given IR.
std::function< Expected< std::unique_ptr< MemoryBuffer > >(Module &)> CompileFunction
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
ExecutionSession & getExecutionSession()
Returns the ExecutionSession for this layer.
Module * getModule()
Get the module wrapped by this ThreadSafeModule.
VModuleKey getVModuleKey() const
Returns the VModuleKey for this instance.
An LLVM Module together with a shared ThreadSafeContext.
virtual void emit(MaterializationResponsibility R, std::unique_ptr< MemoryBuffer > O)=0
Emit should materialize the given IR.
Interface for layers that accept LLVM IR.
An ExecutionSession represents a running JIT program.
void reportError(Error Err)
Report a error for this execution session.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void failMaterialization()
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has o...
Interface for Layers that accept object files.
std::function< void(VModuleKey K, ThreadSafeModule TSM)> NotifyCompiledFunction