21 auto IndirectStubsMgrBuilder =
27 return wrap(JITStack);
38 std::string Mangled = J.
mangle(SymbolName);
39 *MangledName =
new char[Mangled.size() + 1];
40 strcpy(*MangledName, Mangled.c_str());
53 return wrap(Addr.takeError());
74 void *SymbolResolverCtx) {
76 std::unique_ptr<Module> M(
unwrap(Mod));
82 return wrap(Handle.takeError());
89 void *SymbolResolverCtx) {
91 std::unique_ptr<Module> M(
unwrap(Mod));
97 return wrap(Handle.takeError());
104 void *SymbolResolverCtx) {
106 std::unique_ptr<MemoryBuffer>
O(
unwrap(Obj));
108 J.
addObject(std::move(O), SymbolResolver, SymbolResolverCtx)) {
109 *RetHandle = *Handle;
112 return wrap(Handle.takeError());
129 return wrap(Addr.takeError());
141 return wrap(Addr.takeError());
145 auto *J =
unwrap(JITStack);
146 auto Err = J->shutdown();
148 return wrap(std::move(Err));
158 unwrap(JITStack)->UnregisterJITEventListener(
unwrap(L));
Error createIndirectStub(StringRef StubName, JITTargetAddress Addr)
This class represents lattice values for constants.
std::function< std::unique_ptr< IndirectStubsManager >)> createLocalIndirectStubsManagerBuilder(const Triple &T)
Create a local indriect stubs manager builder.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
LLVMErrorRef LLVMOrcAddEagerlyCompiledIR(LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
Add module to be eagerly compiled.
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Error removeModule(orc::VModuleKey K)
LLVMErrorRef LLVMOrcGetSymbolAddress(LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, const char *SymbolName)
Get symbol address from JIT instance.
LLVMErrorRef LLVMOrcCreateLazyCompileCallback(LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, LLVMOrcLazyCompileCallbackFn Callback, void *CallbackCtx)
Create a lazy compile callback.
Expected< orc::VModuleKey > addIRModuleLazy(std::unique_ptr< Module > M, LLVMOrcSymbolResolverFn ExternalResolver, void *ExternalResolverCtx)
LLVMErrorRef LLVMOrcGetSymbolAddressIn(LLVMOrcJITStackRef JITStack, LLVMOrcTargetAddress *RetAddr, LLVMOrcModuleHandle H, const char *SymbolName)
Get symbol address from JIT instance, searching only the specified handle.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Error setIndirectStubPointer(StringRef Name, JITTargetAddress Addr)
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Attribute unwrap(LLVMAttributeRef Attr)
void LLVMOrcDisposeMangledSymbol(char *MangledName)
Dispose of a mangled symbol.
LLVMErrorRef LLVMOrcDisposeInstance(LLVMOrcJITStackRef JITStack)
Dispose of an ORC JIT stack.
uint64_t LLVMOrcTargetAddress
struct LLVMOpaqueError * LLVMErrorRef
Opaque reference to an error instance.
LLVMErrorRef LLVMOrcCreateIndirectStub(LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress InitAddr)
Create a named indirect call stub.
void LLVMOrcUnregisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
Unegister a JIT Event Listener.
Expected< JITTargetAddress > findSymbolAddress(const std::string &Name, bool ExportedSymbolsOnly)
LLVMErrorRef LLVMOrcAddObjectFile(LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMMemoryBufferRef Obj, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
Add an object file.
LLVMOrcJITStackRef LLVMOrcCreateInstance(LLVMTargetMachineRef TM)
Create an ORC JIT stack.
const char * LLVMOrcGetErrorMsg(LLVMOrcJITStackRef JITStack)
Get the error message for the most recent error (if any).
void LLVMOrcGetMangledSymbol(LLVMOrcJITStackRef JITStack, char **MangledName, const char *SymbolName)
Mangle the given symbol.
const Triple & getTargetTriple() const
LLVMErrorRef LLVMOrcSetIndirectStubPointer(LLVMOrcJITStackRef JITStack, const char *StubName, LLVMOrcTargetAddress NewAddr)
Set the pointer for the given indirect stub.
std::string mangle(StringRef Name)
Triple - Helper class for working with autoconf configuration names.
uint64_t LLVMOrcModuleHandle
void LLVMOrcRegisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
Register a JIT Event Listener.
uint64_t(* LLVMOrcLazyCompileCallbackFn)(LLVMOrcJITStackRef JITStack, void *CallbackCtx)
const std::string & getErrorMessage() const
uint64_t(* LLVMOrcSymbolResolverFn)(const char *Name, void *LookupCtx)
LLVMAttributeRef wrap(Attribute Attr)
Expected< orc::VModuleKey > addObject(std::unique_ptr< MemoryBuffer > ObjBuffer, LLVMOrcSymbolResolverFn ExternalResolver, void *ExternalResolverCtx)
Expected< orc::VModuleKey > addIRModuleEager(std::unique_ptr< Module > M, LLVMOrcSymbolResolverFn ExternalResolver, void *ExternalResolverCtx)
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
Expected< JITTargetAddress > createLazyCompileCallback(LLVMOrcLazyCompileCallbackFn Callback, void *CallbackCtx)
Expected< JITTargetAddress > findSymbolAddressIn(orc::VModuleKey K, const std::string &Name, bool ExportedSymbolsOnly)
LLVMErrorRef LLVMOrcRemoveModule(LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle H)
Remove a module set from the JIT.
LLVMErrorRef LLVMOrcAddLazilyCompiledIR(LLVMOrcJITStackRef JITStack, LLVMOrcModuleHandle *RetHandle, LLVMModuleRef Mod, LLVMOrcSymbolResolverFn SymbolResolver, void *SymbolResolverCtx)
Add module to be lazily compiled one function at a time.
Primary interface to the complete machine description for the target machine.
struct LLVMOrcOpaqueJITStack * LLVMOrcJITStackRef