diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 1a615bda42746..28bfb75b0de9b 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -722,7 +722,8 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result, // Late template parsing can begin. Actions.SetLateTemplateParser(LateTemplateParserCallback, nullptr, this); - Actions.ActOnEndOfTranslationUnit(); + if (!PP.isIncrementalProcessingEnabled()) + Actions.ActOnEndOfTranslationUnit(); //else don't tell Sema that we ended parsing: more input might come. return true; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp index c99ed9dd0a68d..fe6e212cbda72 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -662,7 +662,6 @@ ClangModulesDeclVendor::Create(Target &target) { arch.GetTriple().str(), "-fmodules-validate-system-headers", "-Werror=non-modular-include-in-framework-module", - "-Xclang=-fincremental-extensions", "-Rmodule-build"}; target.GetPlatform()->AddClangModuleCompilationOptions( @@ -756,6 +755,8 @@ ClangModulesDeclVendor::Create(Target &target) { instance->getFrontendOpts().Inputs[0])) return nullptr; + instance->getPreprocessor().enableIncrementalProcessing(); + instance->createASTReader(); instance->createSema(action->getTranslationUnitKind(), nullptr); diff --git a/lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py b/lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py index 36e302be2525b..db6d74bfdb540 100644 --- a/lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py +++ b/lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py @@ -21,7 +21,7 @@ def test(self): "expr @import LLDBTestModule", error=True, substrs=[ - "module.h:4:1: error: use of undeclared identifier 'syntax_error_for_lldb_to_find'", + "module.h:4:1: error: unknown type name 'syntax_error_for_lldb_to_find'", "syntax_error_for_lldb_to_find // comment that tests source printing", "could not build module 'LLDBTestModule'", ],