[Lldb-commits] [lldb] r340585 - Reuse the SelectorTable from Clang's Preprocessor

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 23 15:40:54 PDT 2018


Author: teemperor
Date: Thu Aug 23 15:40:54 2018
New Revision: 340585

URL: http://llvm.org/viewvc/llvm-project?rev=340585&view=rev
Log:
Reuse the SelectorTable from Clang's Preprocessor

Summary:
At the moment we create our own SelectorTable even though the Preprocessor always
creates one for us that we can (and should) reuse.

Reviewers: vsk

Reviewed By: vsk

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D51185

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=340585&r1=340584&r2=340585&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp Thu Aug 23 15:40:54 2018
@@ -507,8 +507,6 @@ ClangExpressionParser::ClangExpressionPa
 
   // 8. Most of this we get from the CompilerInstance, but we also want to give
   // the context an ExternalASTSource.
-  m_selector_table.reset(new SelectorTable());
-
   // We enable all builtin functions beside the builtins from libc/libm (e.g.
   // 'fopen'). Those libc functions are already correctly handled by LLDB, and
   // additionally enabling them as expandable builtins is breaking Clang.
@@ -522,7 +520,7 @@ ClangExpressionParser::ClangExpressionPa
   std::unique_ptr<clang::ASTContext> ast_context(
       new ASTContext(m_compiler->getLangOpts(), m_compiler->getSourceManager(),
                      m_compiler->getPreprocessor().getIdentifierTable(),
-                     *m_selector_table.get(), builtin_context));
+                     PP.getSelectorTable(), builtin_context));
 
   ast_context->InitBuiltinTypes(m_compiler->getTarget());
 

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h?rev=340585&r1=340584&r2=340585&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h Thu Aug 23 15:40:54 2018
@@ -149,8 +149,6 @@ private:
       m_file_manager; ///< The Clang file manager object used by the compiler
   std::unique_ptr<clang::CompilerInstance>
       m_compiler; ///< The Clang compiler used to parse expressions into IR
-  std::unique_ptr<clang::SelectorTable>
-      m_selector_table; ///< Selector table for Objective-C methods
   std::unique_ptr<clang::CodeGenerator>
       m_code_generator; ///< The Clang object that generates IR
 




More information about the lldb-commits mailing list