diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 9538deccbe04..53580c08bdde 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -344,11 +344,6 @@ public: GetUniqueNamespaceDeclaration(const char *name, clang::DeclContext *decl_ctx, bool is_inline = false); - static clang::NamespaceDecl * - GetUniqueNamespaceDeclaration(clang::ASTContext *ast, const char *name, - clang::DeclContext *decl_ctx, - bool is_inline = false); - // Function Types clang::FunctionDecl * diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index 35a50c8fed16..bbc03126ea24 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -1101,13 +1101,15 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls( : CompilerDeclContext(); if (frame_decl_context) { - ClangASTContext *ast = llvm::dyn_cast_or_null( + ClangASTContext *frame_ast = llvm::dyn_cast_or_null( frame_decl_context.GetTypeSystem()); - if (ast) { + ClangASTContext *map_ast = + ClangASTContext::GetASTContext(m_ast_context); + if (frame_ast && map_ast) { clang::NamespaceDecl *namespace_decl = - ClangASTContext::GetUniqueNamespaceDeclaration( - m_ast_context, name.GetCString(), nullptr); + map_ast->GetUniqueNamespaceDeclaration(name.GetCString(), + nullptr); if (namespace_decl) { context.AddNamedDecl(namespace_decl); clang::DeclContext *clang_decl_ctx = diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 290ad93b9532..cf1dfeae359e 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1861,16 +1861,6 @@ NamespaceDecl *ClangASTContext::GetUniqueNamespaceDeclaration( return namespace_decl; } -NamespaceDecl *ClangASTContext::GetUniqueNamespaceDeclaration( - clang::ASTContext *ast, const char *name, clang::DeclContext *decl_ctx, - bool is_inline) { - ClangASTContext *ast_ctx = ClangASTContext::GetASTContext(ast); - if (ast_ctx == nullptr) - return nullptr; - - return ast_ctx->GetUniqueNamespaceDeclaration(name, decl_ctx, is_inline); -} - clang::BlockDecl * ClangASTContext::CreateBlockDeclaration(clang::DeclContext *ctx) { if (ctx != nullptr) {