diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-20 18:44:39 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-20 18:45:14 +0100 |
| commit | 6be76f491fcbb2a8476e58cb8d3310155c71e74a (patch) | |
| tree | 755321a01e23f20b4934bc443f7a889c81e5e3a3 /lldb/source | |
| parent | 2f209ccfbe5e6b33088763b1e022ba876fb0f35c (diff) | |
| download | bcm5719-llvm-6be76f491fcbb2a8476e58cb8d3310155c71e74a.tar.gz bcm5719-llvm-6be76f491fcbb2a8476e58cb8d3310155c71e74a.zip | |
[lldb][NFC] Remove redundant ASTContext args to CopyDecl/DeportDecl
We already pass a Decl here and the additional ASTContext needs to
match the Decl. We might as well just pass the Decl and then extract
the ASTContext from that.
Diffstat (limited to 'lldb/source')
3 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp index 24dc7268976..6d6830c740d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp @@ -453,8 +453,7 @@ void ASTResultSynthesizer::CommitPersistentDecls() { ConstString name_cs(name.str().c_str()); Decl *D_scratch = m_target.GetClangASTImporter()->DeportDecl( - ClangASTContext::GetScratch(m_target)->getASTContext(), m_ast_context, - decl); + ClangASTContext::GetScratch(m_target)->getASTContext(), decl); if (!D_scratch) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index f37fe21b554..e326d239cb5 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -1823,9 +1823,8 @@ NamespaceDecl *ClangASTSource::AddNamespace( } clang::Decl *ClangASTSource::CopyDecl(Decl *src_decl) { - clang::ASTContext &from_context = src_decl->getASTContext(); if (m_ast_importer_sp) { - return m_ast_importer_sp->CopyDecl(m_ast_context, &from_context, src_decl); + return m_ast_importer_sp->CopyDecl(m_ast_context, src_decl); } else { lldbassert(0 && "No mechanism for copying a decl!"); return nullptr; diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index d856443b268..7bdbe2bcc1d 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -65,10 +65,10 @@ CompilerType ClangASTImporter::CopyType(ClangASTContext &dst_ast, } clang::Decl *ClangASTImporter::CopyDecl(clang::ASTContext *dst_ast, - clang::ASTContext *src_ast, clang::Decl *decl) { ImporterDelegateSP delegate_sp; + clang::ASTContext *src_ast = &decl->getASTContext(); delegate_sp = GetDelegate(dst_ast, src_ast); ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast); @@ -320,10 +320,10 @@ CompilerType ClangASTImporter::DeportType(ClangASTContext &dst, } clang::Decl *ClangASTImporter::DeportDecl(clang::ASTContext *dst_ctx, - clang::ASTContext *src_ctx, clang::Decl *decl) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); + clang::ASTContext *src_ctx = &decl->getASTContext(); LLDB_LOGF(log, " [ClangASTImporter] DeportDecl called on (%sDecl*)%p from " "(ASTContext*)%p to (ASTContext*)%p", @@ -337,7 +337,7 @@ clang::Decl *ClangASTImporter::DeportDecl(clang::ASTContext *dst_ctx, clang::Decl *result; { CompleteTagDeclsScope complete_scope(*this, dst_ctx, src_ctx); - result = CopyDecl(dst_ctx, src_ctx, decl); + result = CopyDecl(dst_ctx, decl); } if (!result) |

