[PATCH] D104672: [Orc] At CBindings for LazyRexports

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 02:31:24 PDT 2021


lhames added a comment.

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.



================
Comment at: llvm/include/llvm-c/Orc.h:845
+ */
+LLVMOrcIndirectStubsManagerRef LLVMOrcCreateLocalIndirectStubsManager(
+    const char *TargetTriple);
----------------
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`.


================
Comment at: llvm/include/llvm-c/Orc.h:853
+
+LLVMOrcLazyCallThroughManagerRef LLVMOrcCreateLocalLazyCallThroughManager(
+    const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
----------------
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;
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104672/new/

https://reviews.llvm.org/D104672



More information about the llvm-commits mailing list