diff options
| author | Sean Callanan <scallanan@apple.com> | 2017-09-28 20:20:25 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2017-09-28 20:20:25 +0000 |
| commit | 68e4423917b6570b159aa0b694655943d01f0fa9 (patch) | |
| tree | 214716a253490883a5ad1e63b45b9fa6f12c9fb2 /lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp | |
| parent | ed19350293f14bce74f53d9ffbe72ba4fc5d7bd2 (diff) | |
| download | bcm5719-llvm-68e4423917b6570b159aa0b694655943d01f0fa9.tar.gz bcm5719-llvm-68e4423917b6570b159aa0b694655943d01f0fa9.zip | |
[Expression parser] Setting to enable use of ExternalASTMerger
This setting can be enabled like this at the target level:
(lldb) settings set target.experimental.use-modern-type-lookup true
This causes several new behaviors in the Clang expression parser:
- It completely disables use of ClangASTImporter. None are created
at all, and all users of it are now conditionalized on its
presence.
- It instead constructs a per-expression ExternalASTMerger, which
exists inside Clang and contains much of the type completion
logic that hitherto lived in ExternalASTSource,
ClangExpressionDeclMap, and ClangASTImporter.
- The expression parser uses this Merger as a backend for copying
and completing types.
- It also constructs a persistent ExternalASTMerger which is
connected to the Target's persistent AST context.
This is a major chunk of LLDB functionality moved into Clang. It
can be tested in two ways:
1. For an individual debug session, enable the setting before
running a target.
2. For the testsuite, change the option to be default-true. This
is done in Target.cpp's g_experimental_properties. The
testsuite is not yet clean with this, so I have not committed
that switch.
I have filed a Bugzilla for extending the testsuite to allow
custom settings for all tests:
https://bugs.llvm.org/show_bug.cgi?id=34771
I have also filed a Bugzilla for fixing the remaining testsuite
failures with this setting enabled:
https://bugs.llvm.org/show_bug.cgi?id=34772
llvm-svn: 314458
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp index bce0eaf6d57..b42ceb9afee 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -85,6 +85,7 @@ public: void ForEachMacro(const ModuleVector &modules, std::function<bool(const std::string &)> handler) override; + clang::ExternalASTMerger::ImporterSource GetImporterSource() override; private: void ReportModuleExportsHelper(std::set<ClangModulesDeclVendor::ModuleID> &exports, @@ -109,6 +110,7 @@ private: typedef std::set<ModuleID> ImportedModuleSet; ImportedModuleMap m_imported_modules; ImportedModuleSet m_user_imported_modules; + const clang::ExternalASTMerger::OriginMap m_origin_map; }; } // anonymous namespace @@ -548,6 +550,12 @@ ClangModulesDeclVendorImpl::DoGetModule(clang::ModuleIdPath path, is_inclusion_directive); } +clang::ExternalASTMerger::ImporterSource +ClangModulesDeclVendorImpl::GetImporterSource() { + return {m_compiler_instance->getASTContext(), + m_compiler_instance->getFileManager(), m_origin_map}; +} + static const char *ModuleImportBufferName = "LLDBModulesMemoryBuffer"; lldb_private::ClangModulesDeclVendor * |

