LLVM: lib/ExecutionEngine/Orc/IRCompileLayer.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

11namespace llvm {

12namespace orc {

13

15

17 std::unique_ptr Compile)

18 : IRLayer(ES, ManglingOpts), BaseLayer(BaseLayer),

19 Compile(std::move(Compile)) {

20 ManglingOpts = &this->Compile->getManglingOptions();

21}

22

24 std::lock_guardstd::mutex Lock(IRLayerMutex);

25 this->NotifyCompiled = std::move(NotifyCompiled);

26}

27

30 assert(TSM && "Module must not be null");

31

33 {

34 std::lock_guardstd::mutex Lock(IRLayerMutex);

35 if (NotifyCompiled)

36 NotifyCompiled(*R, std::move(TSM));

37 else

39 }

40 BaseLayer.emit(std::move(R), std::move(*Obj));

41 } else {

42 R->failMaterialization();

44 }

45}

46

47}

48}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

An ExecutionSession represents a running JIT program.

void reportError(Error Err)

Report a error for this execution session.

void emit(std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM) override

Emit should materialize the given IR.

Definition IRCompileLayer.cpp:28

std::function< void( MaterializationResponsibility &R, ThreadSafeModule TSM)> NotifyCompiledFunction

void setNotifyCompiled(NotifyCompiledFunction NotifyCompiled)

Definition IRCompileLayer.cpp:23

IRCompileLayer(ExecutionSession &ES, ObjectLayer &BaseLayer, std::unique_ptr< IRCompiler > Compile)

Definition IRCompileLayer.cpp:16

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

ExecutionSession & getExecutionSession()

Returns the ExecutionSession for this layer.

Interface for Layers that accept object files.

An LLVM Module together with a shared ThreadSafeContext.

decltype(auto) withModuleDo(Func &&F)

Locks the associated ThreadSafeContext and calls the given function on the contained Module.

This is an optimization pass for GlobalISel generic memory operations.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.