LLVM: lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

11#include

12

13namespace llvm {

14namespace orc {

15

19 std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,

21

23 for (auto &KV : Pairs)

24 Symbols.add(KV.first, LookupFlags);

25

28 [Pairs = std::move(Pairs),

31 return OnRec(Result.takeError());

32 for (auto &KV : Pairs) {

33 auto I = Result->find(KV.first);

34 *KV.second =

36 }

38 },

40}

41

44 std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,

46

47 std::promise ResultP;

48 auto ResultF = ResultP.get_future();

50 ES, K, SearchOrder, std::move(Pairs), LookupFlags);

51 return ResultF.get();

52}

53

56 std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,

58

60 for (auto &KV : Pairs)

61 Symbols.add(KV.first, LookupFlags);

62

66 return Result.takeError();

67

68 if (Result->size() != 1)

71 if (Result->front().size() != Pairs.size())

74

75 for (unsigned I = 0; I != Pairs.size(); ++I) {

77 *Pairs[I].second = Result->front()[I]->getAddress();

78 }

80}

81

82}

83}

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.

Expected< std::vector< tpctypes::LookupResult > > lookupSymbols(ArrayRef< LookupRequest > Request)

Search for symbols in the target process.

An ExecutionSession represents a running JIT program.

LLVM_ABI void lookup(LookupKind K, const JITDylibSearchOrder &SearchOrder, SymbolLookupSet Symbols, SymbolState RequiredState, SymbolsResolvedCallback NotifyComplete, RegisterDependenciesFunction RegisterDependencies)

Search the given JITDylibs for the given symbols.

Represents an address in the executor process.

ExecutorProcessControl supports interaction with a JIT target process.

DylibManager & getDylibMgr() const

Return the DylibManager for the target process.

A set of symbols to look up, each associated with a SymbolLookupFlags value.

unique_function is a type-erasing functor similar to std::function.

ExecutorAddr DylibHandle

A handle used to represent a loaded dylib in the target process.

std::vector< std::pair< JITDylib *, JITDylibLookupFlags > > JITDylibSearchOrder

A list of (JITDylib*, JITDylibLookupFlags) pairs to be used as a search order during symbol lookup.

SymbolLookupFlags

Lookup flags that apply to each symbol in a lookup.

LLVM_ABI void lookupAndRecordAddrs(unique_function< void(Error)> OnRecorded, ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder, std::vector< std::pair< SymbolStringPtr, ExecutorAddr * > > Pairs, SymbolLookupFlags LookupFlags=SymbolLookupFlags::RequiredSymbol)

Record addresses of the given symbols in the given ExecutorAddrs.

Definition LookupAndRecordAddrs.cpp:16

LookupKind

Describes the kind of lookup being performed.

LLVM_ABI RegisterDependenciesFunction NoDependenciesToRegister

This can be used as the value for a RegisterDependenciesFunction if there are no dependants to regist...

@ Ready

Emitted to memory, but waiting on transitive dependencies.

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.

A pair of a dylib and a set of symbols to be looked up.