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

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 10:11:34 PST 2024


================
@@ -395,36 +401,92 @@ void Dwarf5AccelTableWriter::Header::emit(Dwarf5AccelTableWriter &Ctx) {
   Asm->OutStreamer->emitBytes({AugmentationString, AugmentationStringSize});
 }
 
-static uint32_t constexpr LowerBitSize = dwarf::DW_IDX_type_hash;
+std::optional<uint64_t>
+DWARF5AccelTableData::getDefiningParentDieOffset(const DIE &Die) {
+  auto *Parent = Die.getParent();
+  if (!Parent)
+    return {};
+  if (Parent->findAttribute(dwarf::Attribute::DW_AT_declaration))
+    return {};
+  return Parent->getOffset();
----------------
felipepiovezan wrote:

The logic is flipped in the suggestion -- it should be `!Parent->find...` -- but it still looks better, so I will change it!

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


More information about the llvm-commits mailing list