Handle llvm::Errors correctly.
This fixes several tests on osx.
This commit is contained in:
parent
5cf51d53dd
commit
8069aa7a73
@ -1141,9 +1141,13 @@ namespace cling {
|
||||
|
||||
auto ObjF = llvm::object::ObjectFile::createObjectFile(FileName);
|
||||
if (!ObjF) {
|
||||
std::string Message;
|
||||
handleAllErrors(ObjF.takeError(), [&](llvm::ErrorInfoBase &EIB) {
|
||||
Message += EIB.message() + "; ";
|
||||
});
|
||||
if (DEBUG > 1)
|
||||
cling::errs() << "[DyLD] Failed to read object file "
|
||||
<< FileName << "\n";
|
||||
<< FileName << ". Message: '" << Message << "\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -425,8 +425,10 @@ public:
|
||||
const SymbolLookupSet& LookupSet) override {
|
||||
SymbolMap Symbols;
|
||||
for (auto& KV : LookupSet) {
|
||||
if (auto Addr = lookup(*KV.first))
|
||||
Symbols[KV.first] = Addr.get();
|
||||
auto Addr = lookup(*KV.first);
|
||||
if (auto Err = Addr.takeError())
|
||||
return Err;
|
||||
Symbols[KV.first] = Addr.get();
|
||||
}
|
||||
if (Symbols.empty())
|
||||
return Error::success();
|
||||
|
Loading…
Reference in New Issue
Block a user