From d2b0862f7f6084c73aeeb21fea736cddf6405b15 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Thu, 23 Aug 2018 22:40:54 +0000 Subject: [PATCH] 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 llvm-svn: 340585 --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp | 4 +--- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index 26dad94..6763630 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -507,8 +507,6 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope, // 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::ClangExpressionParser(ExecutionContextScope *exe_scope, std::unique_ptr 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()); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h index 4210657..6b17c6d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h @@ -149,8 +149,6 @@ private: m_file_manager; ///< The Clang file manager object used by the compiler std::unique_ptr m_compiler; ///< The Clang compiler used to parse expressions into IR - std::unique_ptr - m_selector_table; ///< Selector table for Objective-C methods std::unique_ptr m_code_generator; ///< The Clang object that generates IR -- 2.7.4