LLVM 22.0.0git
ExecutorResolver.cpp
Go to the documentation of this file.
1
3
6
7namespace llvm::orc {
8
10 const RemoteSymbolLookupSet &L,
12 std::vector<std::optional<ExecutorSymbolDef>> Result;
13 auto DL = sys::DynamicLibrary(Handle.toPtr<void *>());
14
15 for (const auto &E : L) {
16 if (E.Name.empty()) {
17 if (E.Required)
18 OnResolve(
19 make_error<StringError>("Required address for empty symbol \"\"",
21 else
22 Result.emplace_back();
23 } else {
24
25 const char *DemangledSymName = E.Name.c_str();
26#ifdef __APPLE__
27 if (E.Name.front() != '_')
28 OnResolve(make_error<StringError>(Twine("MachO symbol \"") + E.Name +
29 "\" missing leading '_'",
31 ++DemangledSymName;
32#endif
33
34 void *Addr = DL.getAddressOfSymbol(DemangledSymName);
35 if (!Addr && E.Required)
36 Result.emplace_back();
37 else
38 // FIXME: determine accurate JITSymbolFlags.
41 }
42 }
43
44 OnResolve(std::move(Result));
45}
46
47} // end namespace llvm::orc
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
void resolveAsync(const RemoteSymbolLookupSet &L, ExecutorResolver::YieldResolveResultFn &&OnResolve) override
static ExecutorAddr fromPtr(T *Ptr, UnwrapFn &&Unwrap=UnwrapFn())
Create an ExecutorAddr from the given pointer.
unique_function< void(ResolveResult)> YieldResolveResultFn
Represents a defining location for a JIT symbol.
This class provides a portable interface to dynamic libraries which also might be known as shared lib...
std::vector< RemoteSymbolLookupSetElement > RemoteSymbolLookupSet
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition Error.cpp:98
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
Definition Error.h:340