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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 08:31:24 PDT 2018


Author: jhenderson
Date: Mon May 21 08:31:23 2018
New Revision: 332846

URL: http://llvm.org/viewvc/llvm-project?rev=332846&view=rev
Log:
[ELF] Update due to API change in .debug_line parsing

See r332845.

Reviewed by: grimar

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


Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=332846&r1=332845&r2=332846&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon May 21 08:31:23 2018
@@ -131,14 +131,17 @@ template <class ELFT> void ObjFile<ELFT>
                               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);




More information about the llvm-commits mailing list