Skip to content

Commit eed23a1

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.
1 parent 2e97520 commit eed23a1

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
@@ -719,7 +719,8 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result,
719719

720720
// Late template parsing can begin.
721721
Actions.SetLateTemplateParser(LateTemplateParserCallback, nullptr, this);
722-
Actions.ActOnEndOfTranslationUnit();
722+
if (!PP.isIncrementalProcessingEnabled())
723+
Actions.ActOnEndOfTranslationUnit();
723724
//else don't tell Sema that we ended parsing: more input might come.
724725
return true;
725726

0 commit comments

Comments
 (0)