[PATCH] D63228: [llvm] Expose DWARFDebugLine::LineTable::getFileNameEntry

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 14:30:05 PDT 2019


mtrofin created this revision.
Herald added subscribers: llvm-commits, aprantl.
Herald added a project: LLVM.
mtrofin added reviewers: tamur, dblaikie.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63228

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h


Index: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -268,6 +268,11 @@
         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 @@
     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>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63228.204357.patch
Type: text/x-patch
Size: 1009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190612/9f1ba6f0/attachment.bin>


More information about the llvm-commits mailing list