@@ -79,32 +79,25 @@ Error EPCDynamicLibrarySearchGenerator::tryToGenerate(
79
79
assert (Result->front ().size () == LookupSymbols.size () &&
80
80
" Result has incorrect number of elements" );
81
81
82
- const std::vector<ExecutorSymbolDef> &Syms = Result->front ();
83
- size_t SymIdx = 0 ;
84
- SymbolNameSet MissingSymbols;
85
- SymbolMap NewSyms;
86
- for (auto &[Name, Flags] : LookupSymbols) {
87
- auto Sym = Syms[SymIdx++];
88
- if (Sym.getAddress ())
89
- NewSyms[Name] = Sym;
90
- else if (LLVM_UNLIKELY (Flags == SymbolLookupFlags::RequiredSymbol))
91
- MissingSymbols.insert (Name);
82
+ SymbolMap NewSymbols;
83
+ auto ResultI = Result->front ().begin ();
84
+ for (auto &KV : LookupSymbols) {
85
+ if (ResultI->getAddress ())
86
+ NewSymbols[KV.first ] = *ResultI;
87
+ ++ResultI;
92
88
}
93
89
94
90
LLVM_DEBUG ({
95
- dbgs () << " EPCDynamicLibrarySearchGenerator lookup returned " << NewSyms
96
- << " \n " ;
91
+ dbgs () << " EPCDynamicLibrarySearchGenerator lookup returned "
92
+ << NewSymbols << " \n " ;
97
93
});
98
94
99
- if (NewSyms.empty ())
95
+ // If there were no resolved symbols bail out.
96
+ if (NewSymbols.empty ())
100
97
return LS.continueLookup (Error::success ());
101
98
102
- if (LLVM_UNLIKELY (!MissingSymbols.empty ()))
103
- return LS.continueLookup (make_error<SymbolsNotFound>(
104
- this ->EPC .getSymbolStringPool (), std::move (MissingSymbols)));
105
-
106
99
// Define resolved symbols.
107
- Error Err = addAbsolutes (JD, std::move (NewSyms ));
100
+ Error Err = addAbsolutes (JD, std::move (NewSymbols ));
108
101
109
102
LS.continueLookup (std::move (Err));
110
103
});
0 commit comments