LLVM
17.0.0git
|
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT. More...
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
Classes | |
class | PlatformSupport |
Initializer support for LLJIT. More... | |
Public Member Functions | |
virtual | ~LLJIT () |
Destruct this instance. More... | |
ExecutionSession & | getExecutionSession () |
Returns the ExecutionSession for this instance. More... | |
const Triple & | getTargetTriple () const |
Returns a reference to the triple 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... | |
Expected< JITDylib & > | createJITDylib (std::string Name) |
Create a new JITDylib with the given name and return a reference to it. More... | |
Error | addIRModule (ResourceTrackerSP RT, ThreadSafeModule TSM) |
Adds an IR module with the given ResourceTracker. 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 (ResourceTrackerSP RT, std::unique_ptr< MemoryBuffer > Obj) |
Adds an object file to the given 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< ExecutorAddr > | lookupLinkerMangled (JITDylib &JD, SymbolStringPtr 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< ExecutorAddr > | 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< ExecutorAddr > | 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< ExecutorAddr > | lookup (JITDylib &JD, StringRef UnmangledName) |
Look up a symbol in JITDylib JD based on its IR symbol name. More... | |
Expected< ExecutorAddr > | lookup (StringRef UnmangledName) |
Look up a symbol in the main JITDylib based on its IR symbol name. More... | |
void | setPlatformSupport (std::unique_ptr< PlatformSupport > PS) |
Set the PlatformSupport instance. More... | |
PlatformSupport * | getPlatformSupport () |
Get the PlatformSupport instance. More... | |
Error | initialize (JITDylib &JD) |
Run the initializers for the given JITDylib. More... | |
Error | deinitialize (JITDylib &JD) |
Run the deinitializers for the given JITDylib. More... | |
ObjectLayer & | getObjLinkingLayer () |
Returns a reference to the ObjLinkingLayer. More... | |
ObjectTransformLayer & | getObjTransformLayer () |
Returns a reference to the object transform layer. More... | |
IRTransformLayer & | getIRTransformLayer () |
Returns a reference to the IR transform layer. More... | |
IRCompileLayer & | getIRCompileLayer () |
Returns a reference to the IR compile layer. More... | |
std::string | mangle (StringRef UnmangledName) const |
Returns a linker-mangled version of UnmangledName. More... | |
SymbolStringPtr | mangleAndIntern (StringRef UnmangledName) const |
Returns an interned, linker-mangled version of UnmangledName. More... | |
Protected Member Functions | |
LLJIT (LLJITBuilderState &S, Error &Err) | |
Create an LLJIT instance with a single compile thread. More... | |
Error | applyDataLayout (Module &M) |
void | recordCtorDtors (Module &M) |
Static Protected Member Functions | |
static Expected< 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 |
std::unique_ptr< PlatformSupport > | PS |
JITDylib * | Main = nullptr |
DataLayout | DL |
Triple | TT |
std::unique_ptr< ThreadPool > | CompileThreads |
std::unique_ptr< ObjectLayer > | ObjLinkingLayer |
std::unique_ptr< ObjectTransformLayer > | ObjTransformLayer |
std::unique_ptr< IRCompileLayer > | CompileLayer |
std::unique_ptr< IRTransformLayer > | TransformLayer |
std::unique_ptr< IRTransformLayer > | InitHelperTransformLayer |
Friends | |
template<typename , typename , typename > | |
class | LLJITBuilderSetters |
void | setUpGenericLLVMIRPlatform (LLJIT &J) |
Configure the LLJIT instance to scrape modules for llvm.global_ctors and llvm.global_dtors variables and (if present) build initialization and deinitialization functions. More... | |
A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
Create instances using LLJITBuilder.
|
virtual |
Destruct this instance.
If a multi-threaded instance, waits for all compile threads to complete.
Definition at line 743 of file LLJIT.cpp.
References CompileThreads.
|
protected |
Error llvm::orc::LLJIT::addIRModule | ( | JITDylib & | JD, |
ThreadSafeModule | TSM | ||
) |
Adds an IR module to the given JITDylib.
Definition at line 760 of file LLJIT.cpp.
References addIRModule(), llvm::orc::JITDylib::getDefaultResourceTracker(), and move.
Error llvm::orc::LLJIT::addIRModule | ( | ResourceTrackerSP | RT, |
ThreadSafeModule | TSM | ||
) |
Adds an IR module with the given ResourceTracker.
Definition at line 750 of file LLJIT.cpp.
References assert().
Referenced by addIRModule().
|
inline |
Error llvm::orc::LLJIT::addObjectFile | ( | JITDylib & | JD, |
std::unique_ptr< MemoryBuffer > | Obj | ||
) |
Adds an object file to the given JITDylib.
Definition at line 771 of file LLJIT.cpp.
References addObjectFile(), llvm::orc::JITDylib::getDefaultResourceTracker(), and move.
Error llvm::orc::LLJIT::addObjectFile | ( | ResourceTrackerSP | RT, |
std::unique_ptr< MemoryBuffer > | Obj | ||
) |
Adds an object file to the given JITDylib.
Definition at line 764 of file LLJIT.cpp.
References assert(), move, and ObjTransformLayer.
Referenced by addObjectFile().
|
inline |
Definition at line 923 of file LLJIT.cpp.
References DL, llvm::DataLayout::getStringRepresentation(), llvm::inconvertibleErrorCode(), M, and llvm::Error::success().
|
staticprotected |
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.
|
staticprotected |
Run the deinitializers for the given JITDylib.
Definition at line 159 of file LLJIT.h.
References assert(), llvm::dbgs(), DEBUG_WITH_TYPE, llvm::jitlink::JITLinkDylib::getName(), and PS.
|
inline |
Returns a reference to the DataLayout for this instance.
Definition at line 68 of file LLJIT.h.
References DL.
|
inline |
Returns the ExecutionSession for this instance.
Definition at line 62 of file LLJIT.h.
References ES.
|
inline |
Returns a reference to the IR compile layer.
Definition at line 178 of file LLJIT.h.
References CompileLayer.
|
inline |
Returns a reference to the IR transform layer.
Definition at line 175 of file LLJIT.h.
References TransformLayer.
|
inline |
|
inline |
Returns a reference to the ObjLinkingLayer.
Definition at line 169 of file LLJIT.h.
References ObjLinkingLayer.
|
inline |
Returns a reference to the object transform layer.
Definition at line 172 of file LLJIT.h.
References ObjTransformLayer.
|
inline |
Run the initializers for the given JITDylib.
Definition at line 149 of file LLJIT.h.
References assert(), llvm::dbgs(), DEBUG_WITH_TYPE, llvm::jitlink::JITLinkDylib::getName(), and PS.
|
inline |
|
inline |
|
inline |
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 118 of file LLJIT.h.
References ES, and lookupLinkerMangled().
Expected< ExecutorAddr > llvm::orc::LLJIT::lookupLinkerMangled | ( | JITDylib & | JD, |
SymbolStringPtr | 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 775 of file LLJIT.cpp.
References ES, llvm::orc::makeJITDylibSearchOrder(), and llvm::orc::MatchAllSymbols.
Referenced by 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 126 of file LLJIT.h.
References lookupLinkerMangled(), and Main.
std::string llvm::orc::LLJIT::mangle | ( | StringRef | UnmangledName | ) | const |
Returns a linker-mangled version of UnmangledName.
Definition at line 914 of file LLJIT.cpp.
References DL, and llvm::Mangler::getNameWithPrefix().
Referenced by lookup(), and mangleAndIntern().
|
inline |
|
protected |
|
inline |
Set the PlatformSupport instance.
Definition at line 141 of file LLJIT.h.
Referenced by llvm::orc::setUpGenericLLVMIRPlatform(), llvm::orc::setUpInactivePlatform(), and llvm::orc::setUpOrcPlatform().
|
friend |
|
friend |
|
protected |
Definition at line 213 of file LLJIT.h.
Referenced by getIRCompileLayer().
|
protected |
|
protected |
Definition at line 207 of file LLJIT.h.
Referenced by applyDataLayout(), getDataLayout(), mangle(), and llvm::orc::LLJITBuilderState::prepareForConstruction().
|
protected |
Definition at line 202 of file LLJIT.h.
Referenced by createJITDylib(), createObjectLinkingLayer(), getExecutionSession(), getJITDylibByName(), lookupLinkerMangled(), mangleAndIntern(), and llvm::orc::LLJITBuilderState::prepareForConstruction().
|
protected |
Definition at line 215 of file LLJIT.h.
Referenced by llvm::orc::LLJIT::PlatformSupport::setInitTransform().
|
protected |
Definition at line 205 of file LLJIT.h.
Referenced by addIRModule(), llvm::orc::LLLazyJIT::addLazyIRModule(), addObjectFile(), getMainJITDylib(), lookup(), and lookupLinkerMangled().
|
protected |
Definition at line 211 of file LLJIT.h.
Referenced by getObjLinkingLayer(), and llvm::orc::LLJITBuilderState::prepareForConstruction().
|
protected |
Definition at line 212 of file LLJIT.h.
Referenced by addObjectFile(), and getObjTransformLayer().
|
protected |
Definition at line 203 of file LLJIT.h.
Referenced by deinitialize(), getPlatformSupport(), initialize(), and setPlatformSupport().
|
protected |
Definition at line 214 of file LLJIT.h.
Referenced by getIRTransformLayer().
|
protected |
Definition at line 208 of file LLJIT.h.
Referenced by getTargetTriple(), and llvm::orc::LLJITBuilderState::prepareForConstruction().