[Lldb-commits] [PATCH] D51253: Let the CompilerInstance create our clang ASTContext

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 27 08:21:55 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL340748: Let the CompilerInstance create our clang ASTContext (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D51253?vs=162538&id=162684#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51253

Files:
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp


Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -517,28 +517,23 @@
   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());
   ClangExpressionDeclMap *decl_map = type_system_helper->DeclMap();
 
   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");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51253.162684.patch
Type: text/x-patch
Size: 1762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180827/4ed3d97b/attachment.bin>


More information about the lldb-commits mailing list