[PATCH] D71762: [DebugInfo][NFC] Use function_ref consistently in debug line parsing

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 10:08:25 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbd402fc3f3e8: [DebugInfo][NFC] Use function_ref consistently in debug line parsing (authored by jhenderson).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71762/new/

https://reviews.llvm.org/D71762

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp


Index: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -514,7 +514,7 @@
 
 Expected<const DWARFDebugLine::LineTable *> DWARFDebugLine::getOrParseLineTable(
     DWARFDataExtractor &DebugLineData, uint64_t Offset, const DWARFContext &Ctx,
-    const DWARFUnit *U, std::function<void(Error)> RecoverableErrorCallback) {
+    const DWARFUnit *U, function_ref<void(Error)> RecoverableErrorCallback) {
   if (!DebugLineData.isValidOffset(Offset))
     return createStringError(errc::invalid_argument, "offset 0x%8.8" PRIx64
                        " is not a valid debug line section offset",
@@ -535,7 +535,7 @@
 Error DWARFDebugLine::LineTable::parse(
     DWARFDataExtractor &DebugLineData, uint64_t *OffsetPtr,
     const DWARFContext &Ctx, const DWARFUnit *U,
-    std::function<void(Error)> RecoverableErrorCallback, raw_ostream *OS) {
+    function_ref<void(Error)> RecoverableErrorCallback, raw_ostream *OS) {
   const uint64_t DebugLineOffset = *OffsetPtr;
 
   clear();
Index: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -874,7 +874,7 @@
 }
 
 Expected<const DWARFDebugLine::LineTable *> DWARFContext::getLineTableForUnit(
-    DWARFUnit *U, std::function<void(Error)> RecoverableErrorCallback) {
+    DWARFUnit *U, function_ref<void(Error)> RecoverableErrorCallback) {
   if (!Line)
     Line.reset(new DWARFDebugLine);
 
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -280,11 +280,10 @@
     void clear();
 
     /// Parse prologue and all rows.
-    Error parse(
-        DWARFDataExtractor &DebugLineData, uint64_t *OffsetPtr,
-        const DWARFContext &Ctx, const DWARFUnit *U,
-        std::function<void(Error)> RecoverableErrorCallback,
-        raw_ostream *OS = nullptr);
+    Error parse(DWARFDataExtractor &DebugLineData, uint64_t *OffsetPtr,
+                const DWARFContext &Ctx, const DWARFUnit *U,
+                function_ref<void(Error)> RecoverableErrorCallback,
+                raw_ostream *OS = nullptr);
 
     using RowVector = std::vector<Row>;
     using RowIter = RowVector::const_iterator;
@@ -309,10 +308,10 @@
   };
 
   const LineTable *getLineTable(uint64_t Offset) const;
-  Expected<const LineTable *> getOrParseLineTable(
-      DWARFDataExtractor &DebugLineData, uint64_t Offset,
-      const DWARFContext &Ctx, const DWARFUnit *U,
-      std::function<void(Error)> RecoverableErrorCallback);
+  Expected<const LineTable *>
+  getOrParseLineTable(DWARFDataExtractor &DebugLineData, uint64_t Offset,
+                      const DWARFContext &Ctx, const DWARFUnit *U,
+                      function_ref<void(Error)> RecoverableErrorCallback);
 
   /// Helper to allow for parsing of an entire .debug_line section in sequence.
   class SectionParser {
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -298,7 +298,7 @@
   /// Report any recoverable parsing problems using the callback.
   Expected<const DWARFDebugLine::LineTable *>
   getLineTableForUnit(DWARFUnit *U,
-                      std::function<void(Error)> RecoverableErrorCallback);
+                      function_ref<void(Error)> RecoverableErrorCallback);
 
   DataExtractor getStringExtractor() const {
     return DataExtractor(DObj->getStrSection(), false, 0);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71762.235902.patch
Type: text/x-patch
Size: 3876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200102/9e2ccab0/attachment.bin>


More information about the llvm-commits mailing list