diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2018-08-27 15:18:33 +0000 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2018-08-27 15:18:33 +0000 |
| commit | 596709d8a89a2892b4d3ff3da1d6fe97a8a7d8ac (patch) | |
| tree | c70c308c2eb45216a9c2500a68755c81634bc047 /lldb/source/Plugins/ExpressionParser | |
| parent | eca9ce14d66c0977b576f1157c3ddde883380b39 (diff) | |
| download | llvm-596709d8a89a2892b4d3ff3da1d6fe97a8a7d8ac.tar.gz llvm-596709d8a89a2892b4d3ff3da1d6fe97a8a7d8ac.tar.bz2 llvm-596709d8a89a2892b4d3ff3da1d6fe97a8a7d8ac.zip | |
Let the CompilerInstance create our clang ASTContext
Summary:
Now that we moved the BuiltinContext and SelectorTable to the
CompilerInstance, we can also get rid of manually creating our
own ASTContext, but just use the one from the CompilerInstance
(which will be created with the same settings).
Reviewers: vsk, aprantl, davide
Reviewed By: davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D51253
llvm-svn: 340748
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index 676363062e54..61e49bdd47de 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -517,12 +517,8 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope, builtin_context.initializeBuiltins(PP.getIdentifierTable(), m_compiler->getLangOpts()); - std::unique_ptr<clang::ASTContext> ast_context( - new ASTContext(m_compiler->getLangOpts(), m_compiler->getSourceManager(), - m_compiler->getPreprocessor().getIdentifierTable(), - PP.getSelectorTable(), builtin_context)); - - ast_context->InitBuiltinTypes(m_compiler->getTarget()); + m_compiler->createASTContext(); + clang::ASTContext &ast_context = m_compiler->getASTContext(); ClangExpressionHelper *type_system_helper = dyn_cast<ClangExpressionHelper>(m_expr.GetTypeSystemHelper()); @@ -531,14 +527,13 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope, if (decl_map) { llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> ast_source( decl_map->CreateProxy()); - decl_map->InstallASTContext(*ast_context, m_compiler->getFileManager()); - ast_context->setExternalSource(ast_source); + decl_map->InstallASTContext(ast_context, m_compiler->getFileManager()); + ast_context.setExternalSource(ast_source); } m_ast_context.reset( new ClangASTContext(m_compiler->getTargetOpts().Triple.c_str())); - m_ast_context->setASTContext(ast_context.get()); - m_compiler->setASTContext(ast_context.release()); + m_ast_context->setASTContext(&ast_context); std::string module_name("$__lldb_module"); |
