diff options
| author | Sayhaan Siddiqui <49014204+sayhaan@users.noreply.github.com> | 2024-07-10 11:35:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-10 11:35:40 -0700 |
| commit | 7e10ad99adb7d586f3ba3c8a9459d0e4fcaa0e33 (patch) | |
| tree | 65ff5851d66b3e33a5529e332bed3b91b60b6a71 /bolt/lib/Core/DebugData.cpp | |
| parent | dc8ea046a516c3bdd0ece306f406c9ea833d4dac (diff) | |
[BOLT][DWARF] Cleanup buffer initialization for DWO range writer (#97843)
Cleanup buffer initialization for DWO range writer instances to remove
empty buffer at the beginning.
Diffstat (limited to 'bolt/lib/Core/DebugData.cpp')
| -rw-r--r-- | bolt/lib/Core/DebugData.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bolt/lib/Core/DebugData.cpp b/bolt/lib/Core/DebugData.cpp index 579af3bce4eb..76c3545c6308 100644 --- a/bolt/lib/Core/DebugData.cpp +++ b/bolt/lib/Core/DebugData.cpp @@ -137,11 +137,14 @@ DebugRangesSectionWriter::DebugRangesSectionWriter() { RangesBuffer = std::make_unique<DebugBufferVector>(); RangesStream = std::make_unique<raw_svector_ostream>(*RangesBuffer); - // Add an empty range as the first entry; - writeAddressRanges(*RangesStream.get(), DebugAddressRangesVector{}); Kind = RangesWriterKind::DebugRangesWriter; } +void DebugRangesSectionWriter::initSection() { + // Adds an empty range to the buffer. + writeAddressRanges(*RangesStream.get(), DebugAddressRangesVector{}); +} + uint64_t DebugRangesSectionWriter::addRanges( DebugAddressRangesVector &&Ranges, std::map<DebugAddressRangesVector, uint64_t> &CachedRanges) { |
