| 1 | //===------- EPCGenericDylibManager.cpp -- Dylib management via EPC -------===// |
| 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 | #include "llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h" |
| 10 | |
| 11 | #include "llvm/ExecutionEngine/Orc/Core.h" |
| 12 | |
| 13 | namespace llvm { |
| 14 | namespace orc { |
| 15 | |
| 16 | Expected<tpctypes::DylibHandle> EPCGenericDylibManager::open(StringRef Path, |
| 17 | uint64_t Mode) { |
| 18 | return B.Open(ES, B.Instance, Path, Mode); |
| 19 | } |
| 20 | |
| 21 | void EPCGenericDylibManager::lookupAsync(tpctypes::DylibHandle H, |
| 22 | const SymbolLookupSet &Lookup, |
| 23 | SymbolLookupCompleteFn Complete) { |
| 24 | B.Resolve(std::move(Complete), ES, B.Instance, H, Lookup); |
| 25 | } |
| 26 | |
| 27 | Expected<tpctypes::DylibHandle> |
| 28 | EPCGenericDylibManager::loadDylib(const char *DylibPath) { |
| 29 | return open(Path: DylibPath, Mode: 0); |
| 30 | } |
| 31 | |
| 32 | void EPCGenericDylibManager::lookupSymbolsAsync( |
| 33 | tpctypes::DylibHandle H, const SymbolLookupSet &Symbols, |
| 34 | DylibManager::SymbolLookupCompleteFn Complete) { |
| 35 | lookupAsync(H, Lookup: Symbols, Complete: std::move(Complete)); |
| 36 | } |
| 37 | |
| 38 | } // end namespace orc |
| 39 | } // end namespace llvm |
| 40 | |