[llvm] r363210 - [llvm] Expose DWARFDebugLine::LineTable::getFileNameEntry

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 15:02:08 PDT 2019


Author: mtrofin
Date: Wed Jun 12 15:02:07 2019
New Revision: 363210

URL: http://llvm.org/viewvc/llvm-project?rev=363210&view=rev
Log:
[llvm] Expose DWARFDebugLine::LineTable::getFileNameEntry

Summary:
This is useful for scenarios where Prologue was directly used and DWARF
5 awareness is required. The current alternative would be to either
duplicate the logic in getFileNameEntry, or to use getFileNameByIndex.
The latter isn't quite an in-place replacement - it performs some
processing, and it produces a string instead of a StringRef, meaning
the caller needs to handle its lifetime.

Reviewers: tamur, dblaikie, JDevlieghere

Reviewed By: tamur, JDevlieghere

Subscribers: aprantl, llvm-commits

Tags: #llvm, #debug-info

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

Modified:
    llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h

Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h?rev=363210&r1=363209&r2=363210&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h Wed Jun 12 15:02:07 2019
@@ -268,6 +268,11 @@ public:
         std::function<void(Error)> RecoverableErrorCallback,
         raw_ostream *OS = nullptr);
 
+    /// Get DWARF-version aware access to the file name entry at the provided
+    /// index.
+    const llvm::DWARFDebugLine::FileNameEntry &
+        getFileNameEntry(uint64_t Index) const;
+
     using RowVector = std::vector<Row>;
     using RowIter = RowVector::const_iterator;
     using SequenceVector = std::vector<Sequence>;
@@ -278,8 +283,6 @@ public:
     SequenceVector Sequences;
 
   private:
-    const llvm::DWARFDebugLine::FileNameEntry &
-    getFileNameEntry(uint64_t Index) const;
     uint32_t findRowInSeq(const DWARFDebugLine::Sequence &Seq,
                           object::SectionedAddress Address) const;
     Optional<StringRef>




More information about the llvm-commits mailing list