diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-21 15:26:24 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-21 15:41:18 +0100 |
| commit | 49b206f95806f35ff8f9a715185355fc2a159760 (patch) | |
| tree | 7752b53ba9b2db4b69c00f22526a5c8428fb8775 /lldb/source/Plugins/ExpressionParser | |
| parent | d269255b95151dcd232c8856206b7e79d70eda29 (diff) | |
| download | bcm5719-llvm-49b206f95806f35ff8f9a715185355fc2a159760.tar.gz bcm5719-llvm-49b206f95806f35ff8f9a715185355fc2a159760.zip | |
[lldb][NFC] Remove all ASTContext getter wrappers from ClangASTContext
Their naming is misleading as they only return the
ClangASTContext-owned variables. For ClangASTContext instances constructed
for a given clang::ASTContext they silently generated duplicated instances
(e.g., a second IdentifierTable) that were essentially unusable.
This removes all these getters as they are anyway not very useful in comparison
to just calling the clang::ASTContext getters. The initialization
code has been moved to the CreateASTContext initialization method so that all
code for making our own clang::ASTContext is in one place.
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
3 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index e326d239cb5..e044a4d33b4 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -56,12 +56,10 @@ ClangASTSource::ClangASTSource(const lldb::TargetSP &target, m_ast_importer_sp = importer; } -void ClangASTSource::InstallASTContext(ClangASTContext &clang_ast_context, - clang::FileManager &file_manager, - bool is_shared_context) { +void ClangASTSource::InstallASTContext(ClangASTContext &clang_ast_context) { m_ast_context = clang_ast_context.getASTContext(); m_clang_ast_context = &clang_ast_context; - m_file_manager = &file_manager; + m_file_manager = &m_ast_context->getSourceManager().getFileManager(); m_ast_importer_sp->InstallMapCompleter(m_ast_context, *this); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h index e0442aeca32..609b182ed61 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h @@ -60,9 +60,7 @@ public: } void MaterializeVisibleDecls(const clang::DeclContext *DC) { return; } - void InstallASTContext(ClangASTContext &ast_context, - clang::FileManager &file_manager, - bool is_shared_context = false); + void InstallASTContext(ClangASTContext &ast_context); // // APIs for ExternalASTSource diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index 15b242a8b87..ebd2d5c1644 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -997,7 +997,7 @@ ClangExpressionParser::ParseInternal(DiagnosticManager &diagnostic_manager, } else { ast_context.setExternalSource(ast_source); } - decl_map->InstallASTContext(*m_ast_context, m_compiler->getFileManager()); + decl_map->InstallASTContext(*m_ast_context); } // Check that the ASTReader is properly attached to ASTContext and Sema. |

