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

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri May 10 13:35:26 PDT 2024


================
@@ -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)
----------------
clayborg wrote:

Maybe this should first check if `die` is valid, then do this?:
```
  if (!die)
    return false;
  ParsedDWARFTypeAttributes attrs(die);
  if (IsForwardDeclaration(die, attrs, SymbolFileDWARF::GetLanguage(*die.GetCU())))
    return false;
```

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


More information about the lldb-commits mailing list