Index: lld/trunk/ELF/InputFiles.cpp =================================================================== --- lld/trunk/ELF/InputFiles.cpp +++ lld/trunk/ELF/InputFiles.cpp @@ -131,14 +131,17 @@ Config->Wordsize); for (std::unique_ptr &CU : Dwarf->compile_units()) { + auto Report = [](Error Err) { + handleAllErrors(std::move(Err), + [](ErrorInfoBase &Info) { warn(Info.message()); }); + }; Expected ExpectedLT = - Dwarf->getLineTableForUnit(CU.get(), warn); + Dwarf->getLineTableForUnit(CU.get(), Report); const DWARFDebugLine::LineTable *LT = nullptr; if (ExpectedLT) LT = *ExpectedLT; else - handleAllErrors(ExpectedLT.takeError(), - [](ErrorInfoBase &Err) { warn(Err.message()); }); + Report(ExpectedLT.takeError()); if (!LT) continue; LineTables.push_back(LT);