At C bindings and an example for LLJIT with lazy reexports
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The new C API functions should include comments noting that they're relatively unstable, and likely to change in coming releases. As you've seen: these APIs are due for a clean-up.
llvm/include/llvm-c/Orc.h | ||
---|---|---|
869 | This is actually returning a stubs-manager-builder -- a factory that produces stub-manager objects. This is a hangover from OrcV1 and should be replaced with a simpler stub manager object, we just haven't gotten around to it yet. Sadly, for the sake of consistency, we probably need to rename the type and API to LLVMOrcIndirectStubsManagerBuilderRef and LLVMOrcCreateLocalIndirectStubsManagerBuilder. | |
877 | This should return an LLVMErrorRef and return the LCTM value (on success) via a result argument: LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager( LLVMOrcLazyCallThroughManagerRef *Result, const char *TargetTriple, LLVMOrcExecutionSessionRef ES, LLVMOrcJITTargetAddress ErrorHandlerAddr) { auto LCTM = createLocalLazyCallThroughManager( Triple(TargetTriple), *unwrap(ES), ErrorHandlerAddr); if (!LCTM) return wrap(LCTM.takeError()); *Result = wrap(LCTM->release()); return LLVMErrorSuccess; } |
The patch will also need to be clang-formatted.
llvm/include/llvm-c/Orc.h | ||
---|---|---|
869 | Oh, I missed that the implementation was actually running the builder and returning an instance, not returning the builder. Scratch this comment -- these APIs are named correctly. |
This is actually returning a stubs-manager-builder -- a factory that produces stub-manager objects. This is a hangover from OrcV1 and should be replaced with a simpler stub manager object, we just haven't gotten around to it yet.
Sadly, for the sake of consistency, we probably need to rename the type and API to LLVMOrcIndirectStubsManagerBuilderRef and LLVMOrcCreateLocalIndirectStubsManagerBuilder.