[Lldb-commits] [lldb] [lldb][DWARF] Do not complete type from declaration die. (PR #91799)

via lldb-commits lldb-commits at lists.llvm.org
Fri May 10 13:01:57 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Zequan Wu (ZequanWu)

<details>
<summary>Changes</summary>

Fix the problem: https://github.com/llvm/llvm-project/pull/90663#issuecomment-2105164917 by enhancing a double-check for #<!-- -->90663

---
Full diff: https://github.com/llvm/llvm-project/pull/91799.diff


1 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (+4-1) 


``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index e0b1b430b266f..315ba4cc0ccdf 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2343,7 +2343,10 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
   // clang::ExternalASTSource queries for this type.
   m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), false);
 
-  if (!die)
+  ParsedDWARFTypeAttributes attrs(die);
+  bool is_forward_declaration = IsForwardDeclaration(
+      die, attrs, SymbolFileDWARF::GetLanguage(*die.GetCU()));
+  if (!die || is_forward_declaration)
     return false;
 
   const dw_tag_t tag = die.Tag();

``````````

</details>


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


More information about the lldb-commits mailing list