[llvm] [BOLT][DWARF][NFC] Remove unnecessary SectionOffset (PR #97841)
Sayhaan Siddiqui via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 5 11:02:27 PDT 2024
================
@@ -166,15 +165,20 @@ uint64_t DebugRangesSectionWriter::addRanges(DebugAddressRangesVector &Ranges) {
// Reading the SectionOffset and updating it should be atomic to guarantee
// unique and correct offsets in patches.
std::lock_guard<std::mutex> Lock(WriterMutex);
- const uint32_t EntryOffset = SectionOffset;
- SectionOffset += writeAddressRanges(*RangesStream.get(), Ranges);
+ const uint32_t EntryOffset = RangesBuffer->size();
+ writeAddressRanges(*RangesStream.get(), Ranges);
return EntryOffset;
}
uint64_t DebugRangesSectionWriter::getSectionOffset() {
std::lock_guard<std::mutex> Lock(WriterMutex);
- return SectionOffset;
+ return RangesBuffer->size();
+}
+
+void DebugRangesSectionWriter::appendToRangeBuffer(
+ const DebugBufferVector &CUBuffer) {
+ *RangesStream << CUBuffer;
----------------
sayhaan wrote:
Fixed, was an error when rebasing and the old definition was included.
https://github.com/llvm/llvm-project/pull/97841
More information about the llvm-commits
mailing list