[llvm] [BOLT][DWARF][NFC] Refactor address writers (PR #98094)
Alexander Yermolovich via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 10 13:51:35 PDT 2024
================
@@ -344,14 +344,40 @@ class DebugAddrWriter {
uint32_t getIndexFromAddress(uint64_t Address, DWARFUnit &CU);
/// Write out entries in to .debug_addr section for CUs.
- virtual void update(DIEBuilder &DIEBlder, DWARFUnit &CUs);
+ virtual std::optional<uint64_t> finalize(const size_t BufferSize);
/// Return buffer with all the entries in .debug_addr already writen out using
/// update(...).
- virtual AddressSectionBuffer &finalize() { return *Buffer; }
+ virtual std::unique_ptr<AddressSectionBuffer> releaseBuffer() {
+ return std::move(Buffer);
+ }
+
+ /// Returns buffer size.
+ virtual size_t getBufferSize() { return Buffer->size(); }
/// Returns False if .debug_addr section was created..
- bool isInitialized() const { return !AddressMaps.empty(); }
+ bool isInitialized() { return Buffer->size() > 0; }
+
+ /// Updates address base with the given Offset.
+ virtual void updateAddrBase(DIEBuilder &DIEBlder, DWARFUnit &CU,
+ const uint64_t Offset);
+
+ /// Appends an AddressSectionBuffer to the address writer buffer for the given
+ /// CU.
----------------
ayermolo wrote:
Update a comment. Not sure CU part applies anymore.
https://github.com/llvm/llvm-project/pull/98094
More information about the llvm-commits
mailing list