18Expected<std::unique_ptr<COFFAutoImportGenerator>>
21 Triple TT = ES.getTargetTriple();
26 "COFFAutoImportGenerator: no pointer creator for " + TT.str(),
32 "COFFAutoImportGenerator: no stub creator for " + TT.str(),
35 auto LibHandle = DylibMgr.loadDylib(LibraryPath);
37 return LibHandle.takeError();
39 return std::unique_ptr<COFFAutoImportGenerator>(
new COFFAutoImportGenerator(
40 ES, L, DylibMgr, *LibHandle, std::move(CreatePointer),
41 std::move(CreateStub)));
55 for (
auto &KV : Symbols) {
57 if (
Base.starts_with(getImpPrefix()))
60 if (Seen.
insert(BaseName).second)
64 DylibMgr.lookupSymbolsAsync(
65 LibHandle, LookupSymbols,
66 [
this, &JD, LS = std::move(LS), LookupSymbols](
auto Result)
mutable {
68 return LS.continueLookup(
Result.takeError());
82 return LS.continueLookup(
G.takeError());
85 if (!ImportStubsRT || ImportStubsRT->isDefunct())
87 LS.continueLookup(L.add(ImportStubsRT, std::move(*
G)));
101 auto G = std::make_unique<jitlink::LinkGraph>(
111 *KV.first, KV.second.getAddress(),
G->getPointerSize(),
116 Ptr.
setName(
G->intern((
Twine(getImpPrefix()) + *KV.first).str()));
Implements a dense probed hash-table based set.
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.
Represent a constant reference to a string, i.e.
Manages the enabling and disabling of subtarget specific features.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::pair< iterator, bool > insert(const ValueT &V)
Represents an object file section.
void setScope(Scope S)
Set the visibility for this Symbol.
void setLinkage(Linkage L)
Set the linkage for this Symbol.
void setName(orc::SymbolStringPtr Name)
Rename this symbol.
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.
friend class ExecutionSession
const Triple & getTargetTriple() const
Return the triple for the executor.
std::shared_ptr< SymbolStringPool > getSymbolStringPool()
Get the SymbolStringPool for this instance.
Represents a JIT'd dynamic library.
LLVM_ABI ResourceTrackerSP createResourceTracker()
Create a resource tracker for this JITDylib.
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.
SymbolLookupSet & add(SymbolStringPtr Name, SymbolLookupFlags Flags=SymbolLookupFlags::RequiredSymbol)
Add an element to the set.
Pointer to a pooled string representing a symbol name.
static constexpr const StringLiteral & getSectionName(DebugSectionKind SectionKind)
Return the name of the section.
LLVM_ABI const char * getGenericEdgeKindName(Edge::Kind K)
Returns the string name of the given generic edge kind, or "unknown" otherwise.
LLVM_ABI PointerJumpStubCreator getPointerJumpStubCreator(const Triple &TT)
Get target-specific PointerJumpStubCreator.
LLVM_ABI AnonymousPointerCreator getAnonymousPointerCreator(const Triple &TT)
Get target-specific AnonymousPointerCreator.
JITDylibLookupFlags
Lookup flags that apply to each dylib in the search order for a lookup.
DenseMap< SymbolStringPtr, ExecutorSymbolDef > SymbolMap
A map from symbol names (as SymbolStringPtrs) to JITSymbols (address/flags pairs).
LookupKind
Describes the kind of lookup being performed.
@ Resolved
Queried, materialization begun.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
detail::zippy< detail::zip_first, T, U, Args... > zip_equal(T &&t, U &&u, Args &&...args)
zip iterator that assumes that all iteratees have the same length.
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.