Skip to content

Commit c95a0c9

Browse files
committed
[lldb] Fix the way we set up the lldb modules infrastructure.
D127284 introduced a new language option which is not benign from modules perspective. Before this patch lldb would set up the compiler invocation and later enable incremental processing. Post-D127284 this does not work because the option causes a module hash mismatch for implicit modules. In addition, D127284 enables parsing statements on the global scope if incremental processing is on and thus `syntax_error_for_lldb_to_find` was rightfully not recognized as a declaration and is considered a statement which produces a slightly different diagnostic. Thanks to Michael Buch for the help in understanding this issue. This patch should appease the lldb bots. More discussion available at: https://reviews.llvm.org/D127284
1 parent 92c96f2 commit c95a0c9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ ClangModulesDeclVendor::Create(Target &target) {
609609
"-target",
610610
arch.GetTriple().str(),
611611
"-fmodules-validate-system-headers",
612-
"-Werror=non-modular-include-in-framework-module"};
612+
"-Werror=non-modular-include-in-framework-module",
613+
"-Xclang=-fincremental-extensions"};
613614

614615
target.GetPlatform()->AddClangModuleCompilationOptions(
615616
&target, compiler_invocation_arguments);
@@ -701,8 +702,6 @@ ClangModulesDeclVendor::Create(Target &target) {
701702
instance->getFrontendOpts().Inputs[0]))
702703
return nullptr;
703704

704-
instance->getPreprocessor().enableIncrementalProcessing();
705-
706705
instance->createASTReader();
707706

708707
instance->createSema(action->getTranslationUnitKind(), nullptr);

lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ def test(self):
1616
# Check that the error message shows file/line/column, prints the relevant
1717
# line from the source code and mentions the module that failed to build.
1818
self.expect("expr @import LLDBTestModule", error=True,
19-
substrs=["module.h:4:1: error: unknown type name 'syntax_error_for_lldb_to_find'",
19+
substrs=["module.h:4:1: error: undeclared identifier 'syntax_error_for_lldb_to_find'",
2020
"syntax_error_for_lldb_to_find // comment that tests source printing",
2121
"could not build module 'LLDBTestModule'"])

0 commit comments

Comments
 (0)