/// VSOs will be searched in order and no VSO pointer may be null.
/// All symbols must be found within the given VSOs or an error
/// will be returned.
-///
-/// If this lookup is being performed on behalf of a
-/// MaterializationResponsibility then it must be passed in as R
-/// (in order to record the symbol dependencies).
-/// If this lookup is not being performed on behalf of a
-/// MaterializationResponsibility then R should be left null.
-Expected<SymbolMap> lookup(const std::vector<VSO *> &VSOs, SymbolNameSet Names,
- MaterializationResponsibility *R);
+Expected<SymbolMap> lookup(const std::vector<VSO *> &VSOs, SymbolNameSet Names);
/// Look up a symbol by searching a list of VSOs.
Expected<JITEvaluatedSymbol> lookup(const std::vector<VSO *> VSOs,
- SymbolStringPtr Name,
- MaterializationResponsibility *R);
+ SymbolStringPtr Name);
} // End namespace orc
} // End namespace llvm
});
}
-Expected<SymbolMap> lookup(const std::vector<VSO *> &VSOs, SymbolNameSet Names,
- MaterializationResponsibility *R) {
+Expected<SymbolMap> lookup(const std::vector<VSO *> &VSOs, SymbolNameSet Names) {
#if LLVM_ENABLE_THREADS
// In the threaded case we use promises to return the results.
std::promise<SymbolMap> PromisedResult;
Error ReadyError = Error::success();
auto OnResolve =
[&](Expected<AsynchronousSymbolQuery::ResolutionResult> Result) {
- if (Result) {
- if (R)
- R->addDependencies(Result->Dependencies);
+ if (Result)
PromisedResult.set_value(std::move(Result->Symbols));
- } else {
+ else {
{
ErrorAsOutParameter _(&ResolutionError);
std::lock_guard<std::mutex> Lock(ErrMutex);
Error ResolutionError = Error::success();
Error ReadyError = Error::success();
- auto OnResolve = [&](Expected<AsynchronousSymbolQuery::ResolutionResult> RR) {
+ auto OnResolve = [&](Expected<AsynchronousSymbolQuery::ResolutionResult> R) {
ErrorAsOutParameter _(&ResolutionError);
- if (RR) {
- if (R)
- R->addDependencies(RR->Dependencies);
- Result = std::move(RR->Symbols);
- } else
- ResolutionError = RR.takeError();
+ if (R)
+ Result = std::move(R->Symbols);
+ else
+ ResolutionError = R.takeError();
};
auto OnReady = [&](Error Err) {
ErrorAsOutParameter _(&ReadyError);
/// Look up a symbol by searching a list of VSOs.
Expected<JITEvaluatedSymbol> lookup(const std::vector<VSO *> VSOs,
- SymbolStringPtr Name,
- MaterializationResponsibility *R) {
+ SymbolStringPtr Name) {
SymbolNameSet Names({Name});
- if (auto ResultMap = lookup(VSOs, std::move(Names), R)) {
+ if (auto ResultMap = lookup(VSOs, std::move(Names))) {
assert(ResultMap->size() == 1 && "Unexpected number of results");
assert(ResultMap->count(Name) && "Missing result for symbol");
return std::move(ResultMap->begin()->second);
cantFail(V.define(MU));
- auto FooLookupResult = cantFail(lookup({&V}, Foo, nullptr));
+ auto FooLookupResult = cantFail(lookup({&V}, Foo));
EXPECT_EQ(FooLookupResult.getAddress(), FooSym.getAddress())
<< "lookup returned an incorrect address";
auto &V = ES.createVSO("V");
cantFail(V.define(absoluteSymbols({{Foo, FooSym}})));
- auto FooLookupResult = cantFail(lookup({&V}, Foo, nullptr));
+ auto FooLookupResult = cantFail(lookup({&V}, Foo));
EXPECT_EQ(FooLookupResult.getAddress(), FooSym.getAddress())
<< "lookup returned an incorrect address";