|
LLVM
10.0.0
|
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... | |
| const DataLayout & | getDataLayout () const |
| Returns a reference to the DataLayout for this instance. More... | |
| JITDylib & | getMainJITDylib () |
| Returns a reference to the JITDylib representing the JIT'd main program. More... | |
| JITDylib * | getJITDylibByName (StringRef Name) |
| Returns the JITDylib with the given name, or nullptr if no JITDylib with that name exists. 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) |
| Adds an IR module to the given JITDylib. 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... | |
| ObjectLayer & | getObjLinkingLayer () |
| Returns a reference to the ObjLinkingLayer. More... | |
| ObjectTransformLayer & | getObjTransformLayer () |
| Returns a reference to the object transform layer. More... | |
Static Public Member Functions | |
| static Expected< std::unique_ptr< LLJIT > > | Create (LLJITBuilderState &S) |
Protected Member Functions | |
| LLJIT (LLJITBuilderState &S, Error &Err) | |
| Create an LLJIT instance with a single compile thread. More... | |
| std::string | mangle (StringRef UnmangledName) |
| Error | applyDataLayout (Module &M) |
| void | recordCtorDtors (Module &M) |
Static Protected Member Functions | |
| static std::unique_ptr< ObjectLayer > | createObjectLinkingLayer (LLJITBuilderState &S, ExecutionSession &ES) |
| static Expected< std::unique_ptr< IRCompileLayer::IRCompiler > > | createCompileFunction (LLJITBuilderState &S, JITTargetMachineBuilder JTMB) |
Protected Attributes | |
| std::unique_ptr< ExecutionSession > | ES |
| JITDylib & | Main |
| DataLayout | DL |
| std::unique_ptr< ThreadPool > | CompileThreads |
| std::unique_ptr< ObjectLayer > | ObjLinkingLayer |
| ObjectTransformLayer | ObjTransformLayer |
| std::unique_ptr< IRCompileLayer > | CompileLayer |
| CtorDtorRunner | CtorRunner |
| CtorDtorRunner | DtorRunner |
Friends | |
| template<typename , typename , typename > | |
| class | LLJITBuilderSetters |
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
Create instances using LLJITBuilder.
| llvm::orc::LLJIT::~LLJIT | ( | ) |
|
protected |
Create an LLJIT instance with a single compile thread.
Definition at line 130 of file LLJIT.cpp.
Referenced by getObjTransformLayer().
| Error llvm::orc::LLJIT::addIRModule | ( | JITDylib & | JD, |
| ThreadSafeModule | TSM | ||
| ) |
Adds an IR module to the given JITDylib.
Definition at line 63 of file LLJIT.cpp.
References assert().
Referenced by addIRModule(), and createJITDylib().
|
inline |
Adds an IR module to the Main JITDylib.
Definition at line 77 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 73 of file LLJIT.cpp.
References assert(), and llvm::orc::LLJITBuilderState::ES.
Referenced by addIRModule(), and addObjectFile().
|
inline |
Adds an object file to the given JITDylib.
Definition at line 85 of file LLJIT.h.
References addObjectFile(), lookupLinkerMangled(), and Main.
Definition at line 178 of file LLJIT.cpp.
References DL, llvm::Module::getDataLayout(), llvm::inconvertibleErrorCode(), llvm::DataLayout::isDefault(), llvm::Module::setDataLayout(), and llvm::Error::success().
|
static |
|
staticprotected |
If there is a custom compile function creator set then use it.
Definition at line 111 of file LLJIT.cpp.
References llvm::orc::LLJITBuilderState::CreateCompileFunction, llvm::orc::JITTargetMachineBuilder::createTargetMachine(), llvm::orc::LLJITBuilderState::NumCompileThreads, and llvm::SystemZISD::TM.
Referenced by getObjTransformLayer().
|
inline |
Create a new JITDylib with the given name and return a reference to it.
JITDylib names must be unique. If the given name is derived from user input or elsewhere in the environment then the client should check (e.g. by calling getJITDylibByName) that the given name is not already in use.
Definition at line 66 of file LLJIT.h.
References addIRModule(), llvm::Address, defineAbsolute(), ES, and Name.
|
staticprotected |
Definition at line 87 of file LLJIT.cpp.
References llvm::orc::LLJITBuilderState::CreateObjectLinkingLayer, llvm::orc::LLJITBuilderState::ES, and llvm::orc::LLJITBuilderState::JTMB.
Referenced by getObjTransformLayer().
| Error llvm::orc::LLJIT::defineAbsolute | ( | StringRef | Name, |
| JITEvaluatedSymbol | Address | ||
| ) |
Convenience method for defining an absolute symbol.
Definition at line 57 of file LLJIT.cpp.
References llvm::orc::absoluteSymbols(), and llvm::orc::LLJITBuilderState::ES.
Referenced by createJITDylib().
|
inline |
Returns a reference to the DataLayout for this instance.
Definition at line 49 of file LLJIT.h.
References DL.
|
inline |
Returns the ExecutionSession for this instance.
Definition at line 46 of file LLJIT.h.
References ES.
|
inline |
|
inline |
Returns a reference to the ObjLinkingLayer.
Definition at line 118 of file LLJIT.h.
References ObjLinkingLayer.
|
inline |
Returns a reference to the object transform layer.
Definition at line 121 of file LLJIT.h.
References createCompileFunction(), createObjectLinkingLayer(), ES, LLJIT(), and ObjTransformLayer.
|
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 79 of file LLJIT.cpp.
References llvm::orc::LLJITBuilderState::ES, llvm::orc::makeJITDylibSearchOrder(), and llvm::orc::MatchAllSymbols.
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 97 of file LLJIT.h.
References lookupLinkerMangled(), and Main.
|
protected |
Definition at line 169 of file LLJIT.cpp.
References DL, and llvm::Mangler::getNameWithPrefix().
Referenced by lookup().
|
protected |
Definition at line 190 of file LLJIT.cpp.
References llvm::orc::CtorDtorRunner::add(), CtorRunner, DtorRunner, llvm::orc::getConstructors(), and llvm::orc::getDestructors().
|
inline |
Runs all not-yet-run static constructors.
Definition at line 112 of file LLJIT.h.
References CtorRunner, and llvm::orc::CtorDtorRunner::run().
|
inline |
Runs all not-yet-run static destructors.
Definition at line 115 of file LLJIT.h.
References DtorRunner, and llvm::orc::CtorDtorRunner::run().
|
friend |
|
protected |
|
protected |
|
protected |
Definition at line 149 of file LLJIT.h.
Referenced by recordCtorDtors(), and runConstructors().
|
protected |
Definition at line 142 of file LLJIT.h.
Referenced by applyDataLayout(), getDataLayout(), and mangle().
|
protected |
Definition at line 149 of file LLJIT.h.
Referenced by recordCtorDtors(), and runDestructors().
|
protected |
Definition at line 139 of file LLJIT.h.
Referenced by createJITDylib(), getExecutionSession(), getJITDylibByName(), and getObjTransformLayer().
|
protected |
Definition at line 140 of file LLJIT.h.
Referenced by addIRModule(), llvm::orc::LLLazyJIT::addLazyIRModule(), addObjectFile(), getMainJITDylib(), lookup(), and lookupLinkerMangled().
|
protected |
Definition at line 145 of file LLJIT.h.
Referenced by getObjLinkingLayer().
|
protected |
Definition at line 146 of file LLJIT.h.
Referenced by getObjTransformLayer().
1.8.13