[lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overload

This overload is only used in one place and having static overloads for
all methods that only do an additional clang::ASTContext -> ClangASTContext
conversion is just not sustainable.
This commit is contained in:
Raphael Isemann 2019-11-20 11:36:15 +01:00
parent 52c5014da0
commit 6640f2e7d4
3 changed files with 6 additions and 19 deletions

View File

@ -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 *

View File

@ -1101,13 +1101,15 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
: CompilerDeclContext();
if (frame_decl_context) {
ClangASTContext *ast = llvm::dyn_cast_or_null<ClangASTContext>(
ClangASTContext *frame_ast = llvm::dyn_cast_or_null<ClangASTContext>(
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 =

View File

@ -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) {