HomePhabricator

Ignore generated @import statements in the expression evaluator

Description

Ignore generated @import statements in the expression evaluator

Summary:
The ClangModulesDeclVendor is currently interpreting all injected @import statements in our expression
wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject
@import statements with our std module prototype, the ClangModulesDeclVendor will start compiling
and loading unrelated C++ modules because it thinks the user has requested that it should load them. As
the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths),
it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes
these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).

This patch fixes this by preventing the ClangModulesDeclVendor from interpreting @import statements
in the wrapper source code. This is done by check if the import happens in the fake source file containing
our wrapper code (which implies it was generated by LLDB).

This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)

Reviewers: aprantl, shafik, jingham

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

Details

Committed
teemperorSep 23 2019, 11:58 PM
Differential Revision
D61565: Ignore generated @import statements in the expression evaluator
Branches
Unknown
Tags
Unknown