================
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
   return DWARFDIE(); // Not found
 }
 
+llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) {
+  const DWARFDataExtractor &data = GetData();
+  DWARFDebugInfoEntry die;
+  if (!die.Extract(data, this, &die_offset))
+    return llvm::StringRef();
+  return die.GetName(this);
+}
----------------
felipepiovezan wrote:

Ohh you are right, my bad, I had misinterpreted your original comment.

So, to summarize, the current implementation is technically correct but not 
correct in its original intent, i.e. it will be slow in the presence of 
AT_specification/AT_abstract_origin. 

There are two improvements we need to do here:

1. Avoid going through the DWARFDIE class when 
AT_specification/AT_abstract_origin are references inside the same unit
2. Figure out if we can also be fast when ref_addr is used.

I will explore those today and come back here

https://github.com/llvm/llvm-project/pull/78486
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to