LLVM: lib/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
12
14
15#include
16
17#define DEBUG_TYPE "orc"
18
19namespace llvm {
20namespace orc {
21namespace rt_bootstrap {
22
24 assert(Dylibs.empty() && "shutdown not called?");
25}
26
29 if (Mode != 0)
32
33 const char *PathCStr = Path.empty() ? nullptr : Path.c_str();
34 std::string ErrMsg;
35
37 if (.isValid())
39
40 std::lock_guardstd::mutex Lock(M);
42 Resolvers.push_back(std::make_unique(H));
43 Dylibs.insert(DL.getOSSpecificHandle());
45}
46
48
49 DylibSet DS;
50 {
51 std::lock_guardstd::mutex Lock(M);
53 }
54
55
57}
58
67
69SimpleExecutorDylibManager::openWrapper(const char *ArgData, size_t ArgSize) {
70 return shared::
71 WrapperFunctionrt::SPSSimpleExecutorDylibManagerOpenSignature::handle(
72 ArgData, ArgSize,
75 .release();
76}
77
79SimpleExecutorDylibManager::resolveWrapper(const char *ArgData,
80 size_t ArgSize) {
84 handle(ArgData, ArgSize,
86 using TmpResult =
88 std::promise P;
91 std::move(L),
92 [&](TmpResult R) { P.set_value(std::move(R)); });
93 return F.get();
94 })
96}
97
98}
99}
100}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Represents an address in the executor process.
static ExecutorAddr fromPtr(T *Ptr, UnwrapFn &&Unwrap=UnwrapFn())
Create an ExecutorAddr from the given pointer.
Expected< std::vector< std::optional< ExecutorSymbolDef > > > ResolveResult
Error shutdown() override
Definition SimpleExecutorDylibManager.cpp:47
Expected< tpctypes::DylibHandle > open(const std::string &Path, uint64_t Mode)
Definition SimpleExecutorDylibManager.cpp:28
~SimpleExecutorDylibManager() override
Definition SimpleExecutorDylibManager.cpp:23
void addBootstrapSymbols(StringMap< ExecutorAddr > &M) override
Definition SimpleExecutorDylibManager.cpp:59
static LLVM_ABI DynamicLibrary getPermanentLibrary(const char *filename, std::string *errMsg=nullptr)
This function permanently loads the dynamic library at the given path using the library load operatio...
LLVM_ABI const char * SimpleExecutorDylibManagerResolveWrapperName
LLVM_ABI const char * SimpleExecutorDylibManagerOpenWrapperName
shared::SPSExpected< shared::SPSSequence< shared::SPSOptional< shared::SPSExecutorSymbolDef > > >( shared::SPSExecutorAddr, shared::SPSRemoteSymbolLookupSet) SPSSimpleExecutorDylibManagerResolveSignature
LLVM_ABI const char * SimpleExecutorDylibManagerInstanceName
std::vector< RemoteSymbolLookupSetElement > RemoteSymbolLookupSet
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.