[ELF] Update due to API change in .debug_line parsing

See r332845.

Reviewed by: grimar

Differential Revision: https://reviews.llvm.org/D46832

llvm-svn: 332846
This commit is contained in:
James Henderson 2018-05-21 15:31:23 +00:00
parent 004b729ed1
commit 1a7aaf3cd5
1 changed files with 6 additions and 3 deletions

View File

@ -131,14 +131,17 @@ template <class ELFT> void ObjFile<ELFT>::initializeDwarf() {
Config->Wordsize);
for (std::unique_ptr<DWARFCompileUnit> &CU : Dwarf->compile_units()) {
auto Report = [](Error Err) {
handleAllErrors(std::move(Err),
[](ErrorInfoBase &Info) { warn(Info.message()); });
};
Expected<const DWARFDebugLine::LineTable *> 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);