Skip to content

Commit 5a69e87

Browse files
bnbarhamAnthonyLatsis
authored andcommitted
Revert "[Parse] Always end translation unit"
This reverts commit 76cfe6c. Only running `ActOnEndOfTranslationUnit` when `enableIncrementalProcessing` was false was the only NFC part of splitting `-fincremental-extensions` and `enableIncrementalProcessing` again (68090ee). LLDB started failing after that change with: ``` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/cstdlib:127:9: error: declaration of 'calloc' must be imported from module 'Darwin.malloc._malloc' before it is required ``` Reverting that part of the change fixed LLDB and didn't cause any other test failures, so happy days. Unfortunately most of what `Sema::ActOnEndOfTranslationUnit` does is additional diagnostics, which don't make a lot of sense from the Clang Importer in Swift. So this ends up being a significant regression if eg. `-warnings-as-errors` is enabled. Resolves rdar://116194950. (cherry picked from commit eed23a1)
1 parent 497563b commit 5a69e87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Parse/Parser.cpp

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

734734
// Late template parsing can begin.
735735
Actions.SetLateTemplateParser(LateTemplateParserCallback, nullptr, this);
736-
Actions.ActOnEndOfTranslationUnit();
736+
if (!PP.isIncrementalProcessingEnabled())
737+
Actions.ActOnEndOfTranslationUnit();
737738
//else don't tell Sema that we ended parsing: more input might come.
738739
return true;
739740

0 commit comments

Comments
 (0)