llvm-project/lldb
Raphael Isemann bd2a910a63 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

llvm-svn: 372690
2019-09-24 06:58:39 +00:00
..
cmake [lldb][CMake] Build LLDB.framework with -Wdocumentation in Xcode 2019-09-18 10:41:13 +00:00
docs [lldb][CMake] Infer `Clang_DIR` if not passed explicitly 2019-09-18 10:20:28 +00:00
examples Revert [heap.py] Add missing declaration for malloc_get_all_zones 2019-08-22 21:01:45 +00:00
include/lldb File::SetDescriptor() should require options 2019-09-23 20:36:46 +00:00
lit Fix command-script-import.test on linux 2019-09-18 12:58:52 +00:00
packages/Python/lldbsuite Adapt test to upstream clang compiler changes. 2019-09-24 00:27:13 +00:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts prepare_binding_Python: print readable errors if SWIG fails 2019-09-20 23:41:32 +00:00
source Ignore generated @import statements in the expression evaluator 2019-09-24 06:58:39 +00:00
test [test] Fix various module cache bugs and inconsistencies 2019-08-29 18:37:05 +00:00
third_party/Python/module dotest.py: bugfix: test filters with -f do not work on Python3 2019-09-20 23:41:29 +00:00
tools [LLDB] Rework a MinGW build fix from D65691 2019-09-23 20:43:11 +00:00
unittests File::SetDescriptor() should require options 2019-09-23 20:36:46 +00:00
utils [test] Fix various module cache bugs and inconsistencies 2019-08-29 18:37:05 +00:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [test] Fix various module cache bugs and inconsistencies 2019-08-29 18:37:05 +00:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py