Skip to content

Commit 9779896

Browse files
committed
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 aacc2c4 commit 9779896

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
@@ -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

0 commit comments

Comments
 (0)