[llvm] [BOLT][DWARF] Refactor legacy ranges writers (PR #96006)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 17:56:16 PDT 2024


================
@@ -232,6 +238,8 @@ class DebugRangesSectionWriter {
   static constexpr uint64_t EmptyRangesOffset{0};
 
 private:
+  std::optional<DIE *> Die;
----------------
maksfb wrote:

Since we treat `nullptr` `Die` in the same was as unset `Die`, you can just have `DIE *Die{0};`.

Also add a comment describing what kind of DIE it is pointing to if any.

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


More information about the llvm-commits mailing list