Skip to content

Commit b5ab29b

Browse files
committed
NFC: Inline canBeParsedInFull
Now that SIL files no longer interleave parsing with type-checking, the query doesn't make much sense. Inline it into its only client, `shouldBuildSyntaxTree`.
1 parent b857b22 commit b5ab29b

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

include/swift/AST/SourceFile.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,6 @@ class SourceFile final : public FileUnit {
583583

584584
bool shouldBuildSyntaxTree() const;
585585

586-
bool canBeParsedInFull() const;
587-
588586
/// Whether the bodies of types and functions within this file can be lazily
589587
/// parsed.
590588
bool hasDelayedBodyParsing() const;

lib/AST/Module.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,19 +2259,7 @@ bool SourceFile::shouldCollectTokens() const {
22592259
}
22602260

22612261
bool SourceFile::shouldBuildSyntaxTree() const {
2262-
return canBeParsedInFull() && SyntaxInfo->Enable;
2263-
}
2264-
2265-
bool SourceFile::canBeParsedInFull() const {
2266-
switch (Kind) {
2267-
case SourceFileKind::Library:
2268-
case SourceFileKind::Main:
2269-
case SourceFileKind::Interface:
2270-
return true;
2271-
case SourceFileKind::SIL:
2272-
return false;
2273-
}
2274-
llvm_unreachable("unhandled kind");
2262+
return Kind != SourceFileKind::SIL && SyntaxInfo->Enable;
22752263
}
22762264

22772265
bool SourceFile::hasDelayedBodyParsing() const {

0 commit comments

Comments
 (0)