| 1 | //===------ Dlfcn.h - Proxies for dlfcn-style calls -------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Protocol-agnostic Proxy types for the ORC runtime's dlfcn-style calls, used |
| 10 | // to initialize, re-initialize and deinitialize JITDylibs in the executor. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_EXECUTIONENGINE_ORC_DLFCN_H |
| 15 | #define LLVM_EXECUTIONENGINE_ORC_DLFCN_H |
| 16 | |
| 17 | #include "llvm/ExecutionEngine/Orc/Proxy.h" |
| 18 | |
| 19 | #include <cstdint> |
| 20 | #include <string> |
| 21 | |
| 22 | namespace llvm::orc { |
| 23 | |
| 24 | /// Open a JITDylib by name with the given dlopen-style mode flags; returns its |
| 25 | /// dso handle. |
| 26 | using DlfcnOpenProxy = Proxy<ExecutorAddr(std::string, int32_t)>; |
| 27 | |
| 28 | /// Run newly added initializers for an already-open dso handle; returns nonzero |
| 29 | /// on failure. |
| 30 | using DlfcnUpdateProxy = Proxy<int32_t(ExecutorAddr)>; |
| 31 | |
| 32 | /// Close the given dso handle, running its deinitializers; returns nonzero on |
| 33 | /// failure. |
| 34 | using DlfcnCloseProxy = Proxy<int32_t(ExecutorAddr)>; |
| 35 | |
| 36 | } // namespace llvm::orc |
| 37 | |
| 38 | #endif // LLVM_EXECUTIONENGINE_ORC_DLFCN_H |
| 39 | |