[llvm] [BOLT][DWARF] Cleanup buffer initialization for DWO range writer (PR #97843)

Sayhaan Siddiqui via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 17:12:37 PDT 2024


================
@@ -652,6 +652,7 @@ void DWARFRewriter::updateDebugInfo() {
         auto LegacyRangesSectionWriterByCU =
             std::make_unique<DebugRangesSectionWriter>();
         LegacyRangesSectionWriterByCU->initSection(CU);
+        LegacyRangesSectionWriterByCU->clearBuffer();
----------------
sayhaan wrote:

Since we have each ranges writer its own instance, they all act the same and we still want the empty buffer at the beginning of debug_ranges which is in the main ranges writer. We could avoid creating empty ranges by passing some sort of flag into the constructor or some similar solution.

https://github.com/llvm/llvm-project/pull/97843


More information about the llvm-commits mailing list