[llvm] [AsmPrinter][DebugNames] Implement DW_IDX_parent entries (PR #77457)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 13:22:59 PST 2024


================
@@ -255,6 +255,20 @@ class AppleAccelTableData : public AccelTableData {
   static uint32_t hash(StringRef Buffer) { return djbHash(Buffer); }
 };
 
+/// Helper class to identify an entry in DWARF5AccelTable based on their DIE
+/// offset and UnitID.
+struct OffsetAndUnitID : std::pair<uint64_t, uint32_t> {
+  using Base = std::pair<uint64_t, uint32_t>;
+  OffsetAndUnitID(Base B) : Base(B) {}
+
+  OffsetAndUnitID(uint64_t Offset, uint32_t UnitID) : Base(Offset, UnitID) {}
+  uint64_t offset() const { return first; };
+  uint32_t unitID() const { return second; };
+};
----------------
dwblaikie wrote:

If we want a named structure ,perhaps we could avoid using a pair and accessors and have a plain struct with a public offset and unitID member?

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


More information about the llvm-commits mailing list