diff options
5 files changed, 26 insertions, 5 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index cbd31a549e9..1c1369a6341 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -772,6 +772,10 @@ DWARFASTParserClang::ParseTypeFromDWARF (const SymbolContext& sc, // will automatically call the SymbolFile virtual function // "SymbolFileDWARF::CompleteType(Type *)" // When the definition needs to be defined. + assert(!dwarf->GetForwardDeclClangTypeToDie().count(ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()) && + "Type already in the forward declaration map!"); + assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) && + "Adding incorrect type to forward declaration map"); dwarf->GetForwardDeclDieToClangType()[die.GetDIE()] = clang_type.GetOpaqueQualType(); dwarf->GetForwardDeclClangTypeToDie()[ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] = die.GetDIERef(); m_ast.SetHasExternalStorage (clang_type.GetOpaqueQualType(), true); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 5b2de703635..e9cbd8cde72 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1555,6 +1555,8 @@ SymbolFileDWARF::CompleteType (CompilerType &compiler_type) DWARFDebugInfo* debug_info = DebugInfo(); DWARFDIE dwarf_die = debug_info->GetDIE(die_it->getSecond()); + assert(UserIDMatches(die_it->getSecond().GetUID()) && "CompleteType called on the wrong SymbolFile"); + // Once we start resolving this type, remove it from the forward declaration // map in case anyone child members or other types require this type to get resolved. // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp index ba6b5803ea2..60c281caa9d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp @@ -125,3 +125,9 @@ SymbolFileDWARFDwo::GetLocationListFormat() const { return DWARFExpression::SplitDwarfLocationList; } + +TypeSystem* +SymbolFileDWARFDwo::GetTypeSystemForLanguage(LanguageType language) +{ + return GetBaseSymbolFile()->GetTypeSystemForLanguage(language); +} diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h index 3a65509a6a7..8214496b089 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h @@ -41,6 +41,9 @@ public: lldb_private::DWARFExpression::LocationListFormat GetLocationListFormat() const override; + lldb_private::TypeSystem* + GetTypeSystemForLanguage(lldb::LanguageType language) override; + protected: DIEToTypePtr& GetDIEToType() override; diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 6d61c861f82..2ffb6d62bae 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -2593,14 +2593,16 @@ ClangASTContext::IsArrayType (lldb::opaque_compiler_type_t type, { default: break; - + case clang::Type::ConstantArray: if (element_type_ptr) element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::ConstantArrayType>(qual_type)->getElementType()); if (size) *size = llvm::cast<clang::ConstantArrayType>(qual_type)->getSize().getLimitedValue(ULLONG_MAX); + if (is_incomplete) + *is_incomplete = false; return true; - + case clang::Type::IncompleteArray: if (element_type_ptr) element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::IncompleteArrayType>(qual_type)->getElementType()); @@ -2609,21 +2611,25 @@ ClangASTContext::IsArrayType (lldb::opaque_compiler_type_t type, if (is_incomplete) *is_incomplete = true; return true; - + case clang::Type::VariableArray: if (element_type_ptr) element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::VariableArrayType>(qual_type)->getElementType()); if (size) *size = 0; + if (is_incomplete) + *is_incomplete = false; return true; - + case clang::Type::DependentSizedArray: if (element_type_ptr) element_type_ptr->SetCompilerType (getASTContext(), llvm::cast<clang::DependentSizedArrayType>(qual_type)->getElementType()); if (size) *size = 0; + if (is_incomplete) + *is_incomplete = false; return true; - + case clang::Type::Typedef: return IsArrayType(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), element_type_ptr, |