LLVM
8.0.1
|
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT. More...
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
Public Member Functions | |
~LLJIT () | |
Destruct this instance. More... | |
ExecutionSession & | getExecutionSession () |
Returns the ExecutionSession for this instance. More... | |
JITDylib & | getMainJITDylib () |
Returns a reference to the JITDylib representing the JIT'd main program. More... | |
JITDylib & | createJITDylib (std::string Name) |
Create a new JITDylib with the given name and return a reference to it. More... | |
Error | defineAbsolute (StringRef Name, JITEvaluatedSymbol Address) |
Convenience method for defining an absolute symbol. More... | |
Error | addIRModule (JITDylib &JD, ThreadSafeModule TSM) |
Convenience method for defining an. More... | |
Error | addIRModule (ThreadSafeModule TSM) |
Adds an IR module to the Main JITDylib. More... | |
Error | addObjectFile (JITDylib &JD, std::unique_ptr< MemoryBuffer > Obj) |
Adds an object file to the given JITDylib. More... | |
Error | addObjectFile (std::unique_ptr< MemoryBuffer > Obj) |
Adds an object file to the given JITDylib. More... | |
Expected< JITEvaluatedSymbol > | lookupLinkerMangled (JITDylib &JD, StringRef Name) |
Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead). More... | |
Expected< JITEvaluatedSymbol > | lookupLinkerMangled (StringRef Name) |
Look up a symbol in the main JITDylib by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead). More... | |
Expected< JITEvaluatedSymbol > | lookup (JITDylib &JD, StringRef UnmangledName) |
Look up a symbol in JITDylib JD based on its IR symbol name. More... | |
Expected< JITEvaluatedSymbol > | lookup (StringRef UnmangledName) |
Look up a symbol in the main JITDylib based on its IR symbol name. More... | |
Error | runConstructors () |
Runs all not-yet-run static constructors. More... | |
Error | runDestructors () |
Runs all not-yet-run static destructors. More... | |
RTDyldObjectLinkingLayer & | getObjLinkingLayer () |
Returns a reference to the ObjLinkingLayer. More... | |
Static Public Member Functions | |
static Expected< std::unique_ptr< LLJIT > > | Create (JITTargetMachineBuilder JTMB, DataLayout DL, unsigned NumCompileThreads=0) |
Create an LLJIT instance. More... | |
Protected Member Functions | |
LLJIT (std::unique_ptr< ExecutionSession > ES, std::unique_ptr< TargetMachine > TM, DataLayout DL) | |
Create an LLJIT instance with a single compile thread. More... | |
LLJIT (std::unique_ptr< ExecutionSession > ES, JITTargetMachineBuilder JTMB, DataLayout DL, unsigned NumCompileThreads) | |
Create an LLJIT instance with multiple compile threads. More... | |
std::string | mangle (StringRef UnmangledName) |
Error | applyDataLayout (Module &M) |
void | recordCtorDtors (Module &M) |
Protected Attributes | |
std::unique_ptr< ExecutionSession > | ES |
JITDylib & | Main |
DataLayout | DL |
std::unique_ptr< ThreadPool > | CompileThreads |
RTDyldObjectLinkingLayer | ObjLinkingLayer |
IRCompileLayer | CompileLayer |
CtorDtorRunner | CtorRunner |
CtorDtorRunner | DtorRunner |
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
llvm::orc::LLJIT::~LLJIT | ( | ) |
|
protected |
Create an LLJIT instance with a single compile thread.
Definition at line 82 of file LLJIT.cpp.
References CompileLayer, CtorRunner, DtorRunner, ES, Main, ObjLinkingLayer, and llvm::SystemZISD::TM.
Referenced by getObjLinkingLayer().
|
protected |
Create an LLJIT instance with multiple compile threads.
Definition at line 92 of file LLJIT.cpp.
References assert(), CompileLayer, CompileThreads, CtorRunner, DtorRunner, ES, Main, ObjLinkingLayer, and llvm::orc::IRLayer::setCloneToNewContextOnEmit().
Error llvm::orc::LLJIT::addIRModule | ( | JITDylib & | JD, |
ThreadSafeModule | TSM | ||
) |
Convenience method for defining an.
Adds an IR module to the given JITDylib.
Definition at line 62 of file LLJIT.cpp.
References assert().
Referenced by addIRModule(), and createJITDylib().
|
inline |
Adds an IR module to the Main JITDylib.
Definition at line 66 of file LLJIT.h.
References addIRModule(), addObjectFile(), and Main.
Error llvm::orc::LLJIT::addObjectFile | ( | JITDylib & | JD, |
std::unique_ptr< MemoryBuffer > | Obj | ||
) |
Adds an object file to the given JITDylib.
Definition at line 71 of file LLJIT.cpp.
References assert().
Referenced by addIRModule(), and addObjectFile().
|
inline |
Adds an object file to the given JITDylib.
Definition at line 74 of file LLJIT.h.
References addObjectFile(), lookupLinkerMangled(), and Main.
Definition at line 129 of file LLJIT.cpp.
References DL, llvm::Module::getDataLayout(), llvm::inconvertibleErrorCode(), llvm::DataLayout::isDefault(), llvm::Module::setDataLayout(), and llvm::Error::success().
Referenced by getObjLinkingLayer().
|
static |
Create an LLJIT instance.
If NumCompileThreads is not equal to zero, creates a multi-threaded LLJIT with the given number of compile threads.
Definition at line 39 of file LLJIT.cpp.
References llvm::orc::JITTargetMachineBuilder::createTargetMachine(), and llvm::SystemZISD::TM.
|
inline |
Create a new JITDylib with the given name and return a reference to it.
Definition at line 53 of file LLJIT.h.
References addIRModule(), llvm::Address, defineAbsolute(), ES, and Name.
Error llvm::orc::LLJIT::defineAbsolute | ( | StringRef | Name, |
JITEvaluatedSymbol | Address | ||
) |
Convenience method for defining an absolute symbol.
Definition at line 56 of file LLJIT.cpp.
References llvm::orc::absoluteSymbols().
Referenced by createJITDylib().
|
inline |
Returns the ExecutionSession for this instance.
Definition at line 47 of file LLJIT.h.
References ES.
|
inline |
|
inline |
Returns a reference to the ObjLinkingLayer.
Definition at line 107 of file LLJIT.h.
References applyDataLayout(), ES, LLJIT(), mangle(), ObjLinkingLayer, recordCtorDtors(), and llvm::SystemZISD::TM.
|
inline |
|
inline |
Expected< JITEvaluatedSymbol > llvm::orc::LLJIT::lookupLinkerMangled | ( | JITDylib & | JD, |
StringRef | Name | ||
) |
Look up a symbol in JITDylib JD by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead).
Definition at line 77 of file LLJIT.cpp.
Referenced by addObjectFile(), lookup(), and lookupLinkerMangled().
|
inline |
Look up a symbol in the main JITDylib by the symbol's linker-mangled name (to look up symbols based on their IR name use the lookup function instead).
Definition at line 86 of file LLJIT.h.
References lookupLinkerMangled(), and Main.
|
protected |
Definition at line 120 of file LLJIT.cpp.
References DL, and llvm::Mangler::getNameWithPrefix().
Referenced by getObjLinkingLayer(), and lookup().
|
protected |
Definition at line 141 of file LLJIT.cpp.
References llvm::orc::CtorDtorRunner::add(), CtorRunner, DtorRunner, llvm::orc::getConstructors(), and llvm::orc::getDestructors().
Referenced by getObjLinkingLayer().
|
inline |
Runs all not-yet-run static constructors.
Definition at line 101 of file LLJIT.h.
References CtorRunner, and llvm::orc::CtorDtorRunner::run().
|
inline |
Runs all not-yet-run static destructors.
Definition at line 104 of file LLJIT.h.
References DtorRunner, and llvm::orc::CtorDtorRunner::run().
|
protected |
|
protected |
|
protected |
Definition at line 134 of file LLJIT.h.
Referenced by LLJIT(), recordCtorDtors(), and runConstructors().
|
protected |
Definition at line 128 of file LLJIT.h.
Referenced by applyDataLayout(), and mangle().
|
protected |
Definition at line 134 of file LLJIT.h.
Referenced by LLJIT(), recordCtorDtors(), and runDestructors().
|
protected |
Definition at line 125 of file LLJIT.h.
Referenced by llvm::orc::LLLazyJIT::addLazyIRModule(), llvm::orc::LLLazyJIT::Create(), createJITDylib(), getExecutionSession(), getObjLinkingLayer(), and LLJIT().
|
protected |
Definition at line 126 of file LLJIT.h.
Referenced by addIRModule(), llvm::orc::LLLazyJIT::addLazyIRModule(), addObjectFile(), getMainJITDylib(), LLJIT(), lookup(), and lookupLinkerMangled().
|
protected |
Definition at line 131 of file LLJIT.h.
Referenced by getObjLinkingLayer(), and LLJIT().