Skip to content

Commit c034db5

Browse files
authored
Merge pull request #9212 from bnbarham/revert-end-tu-again
[stable/20240723] Revert always ending translation unit
2 parents f944424 + 9779896 commit c034db5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

clang/lib/Parse/Parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result,
730730

731731
// Late template parsing can begin.
732732
Actions.SetLateTemplateParser(LateTemplateParserCallback, nullptr, this);
733-
Actions.ActOnEndOfTranslationUnit();
733+
if (!PP.isIncrementalProcessingEnabled())
734+
Actions.ActOnEndOfTranslationUnit();
734735
//else don't tell Sema that we ended parsing: more input might come.
735736
return true;
736737

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ ClangModulesDeclVendor::Create(Target &target) {
659659
arch.GetTriple().str(),
660660
"-fmodules-validate-system-headers",
661661
"-Werror=non-modular-include-in-framework-module",
662-
"-Xclang=-fincremental-extensions",
663662
"-Rmodule-build"};
664663

665664
target.GetPlatform()->AddClangModuleCompilationOptions(
@@ -754,6 +753,8 @@ ClangModulesDeclVendor::Create(Target &target) {
754753
instance->getFrontendOpts().Inputs[0]))
755754
return nullptr;
756755

756+
instance->getPreprocessor().enableIncrementalProcessing();
757+
757758
instance->createASTReader();
758759

759760
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
@@ -21,7 +21,7 @@ def test(self):
2121
"expr @import LLDBTestModule",
2222
error=True,
2323
substrs=[
24-
"module.h:4:1: use of undeclared identifier 'syntax_error_for_lldb_to_find'",
24+
"module.h:4:1: unknown type name 'syntax_error_for_lldb_to_find'",
2525
"syntax_error_for_lldb_to_find // comment that tests source printing",
2626
"could not build module 'LLDBTestModule'",
2727
],

0 commit comments

Comments
 (0)