diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index a8a6f02fdb1..518157dc1c1 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -1057,10 +1057,8 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from, static_cast(&from->getASTContext())); } - if (clang::NamespaceDecl *to_namespace = - dyn_cast(to)) { - clang::NamespaceDecl *from_namespace = - dyn_cast(from); + if (auto *to_namespace = dyn_cast(to)) { + auto *from_namespace = cast(from); NamespaceMetaMap &namespace_maps = from_context_md->m_namespace_maps; @@ -1081,11 +1079,10 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from, static_cast(&to->getASTContext())); } - if (TagDecl *from_tag_decl = dyn_cast(from)) { - TagDecl *to_tag_decl = dyn_cast(to); - + if (auto *to_tag_decl = dyn_cast(to)) { to_tag_decl->setHasExternalLexicalStorage(); to_tag_decl->getPrimaryContext()->setMustBuildLookupTable(); + auto from_tag_decl = cast(from); LLDB_LOGF( log, @@ -1096,22 +1093,15 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from, (to_tag_decl->isCompleteDefinition() ? "complete" : "incomplete")); } - if (isa(from)) { - NamespaceDecl *to_namespace_decl = dyn_cast(to); - + if (auto *to_namespace_decl = dyn_cast(to)) { m_master.BuildNamespaceMap(to_namespace_decl); - to_namespace_decl->setHasExternalVisibleStorage(); } - if (isa(from)) { - ObjCContainerDecl *to_container_decl = dyn_cast(to); - + if (auto *to_container_decl = dyn_cast(to)) { to_container_decl->setHasExternalLexicalStorage(); to_container_decl->setHasExternalVisibleStorage(); - /*to_interface_decl->setExternallyCompleted();*/ - if (log) { if (ObjCInterfaceDecl *to_interface_decl = llvm::dyn_cast(to_container_decl)) {