15#ifndef LLVM_EXECUTIONENGINE_ORC_COFFAUTOIMPORTGENERATOR_H
16#define LLVM_EXECUTIONENGINE_ORC_COFFAUTOIMPORTGENERATOR_H
62 const char *LibraryPath);
84 : ES(ES), L(L), DylibMgr(DylibMgr), LibHandle(LibHandle),
85 CreatePointer(
std::
move(CreatePointer)),
86 CreateStub(
std::
move(CreateStub)) {}
89 createStubsGraph(
const SymbolMap &Resolved);
91 static constexpr StringLiteral getImpPrefix() {
return "__imp_"; }
93 return "$__AUTOIMPORT_STUBS";
97 ObjectLinkingLayer &
L;
98 DylibManager &DylibMgr;
99 tpctypes::DylibHandle LibHandle;
103 jitlink::AnonymousPointerCreator CreatePointer;
104 jitlink::PointerJumpStubCreator CreateStub;
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
A utility class that synthesizes COFF dllimport __imp_ symbols and PLT stubs for the symbols exported...
static Expected< std::unique_ptr< COFFAutoImportGenerator > > Load(ExecutionSession &ES, ObjectLinkingLayer &L, DylibManager &DylibMgr, const char *LibraryPath)
Loads the dynamic library at the given path in the executor (via the given DylibManager) and,...
Error tryToGenerate(LookupState &LS, LookupKind K, JITDylib &JD, JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &Symbols) override
DefinitionGenerators should override this method to insert new definitions into the parent JITDylib.
ResourceTrackerSP getImportStubsResourceTracker() const
Returns the ResourceTracker that owns the stubs synthesized by this generator, or null if none have b...
Definition generators can be attached to JITDylibs to generate new definitions for otherwise unresolv...
friend class ExecutionSession
An ExecutionSession represents a running JIT program.
Represents a JIT'd dynamic library.
Wraps state for a lookup-in-progress.
An ObjectLayer implementation built on JITLink.
A set of symbols to look up, each associated with a SymbolLookupFlags value.
unique_function< Symbol &( LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)> PointerJumpStubCreator
Create a jump stub that jumps via the pointer at the given symbol and an anonymous symbol pointing to...
unique_function< Symbol &(LinkGraph &G, Section &PointerSection, Symbol *InitialTarget, uint64_t InitialAddend)> AnonymousPointerCreator
Creates a new pointer block in the given section and returns an Anonymous symbol pointing to it.
ExecutorAddr DylibHandle
A handle used to represent a loaded dylib in the target process.
IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
LookupKind
Describes the kind of lookup being performed.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.