From: Mircea Trofin Date: Wed, 12 Jun 2019 22:02:07 +0000 (+0000) Subject: [llvm] Expose DWARFDebugLine::LineTable::getFileNameEntry X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1422127962502e8ad3860dd7b76f65a9d447ff22;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363210 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h index 28f24ab6b7e..9a3ad2b08c9 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h @@ -268,6 +268,11 @@ public: std::function 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; using RowIter = RowVector::const_iterator; using SequenceVector = std::vector; @@ -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