Skip to content

Commit db9a27e

Browse files
committed
[AST] Remove hasSyntaxRoot
Use `shouldBuildSyntaxTree` instead.
1 parent 9398153 commit db9a27e

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

include/swift/AST/SourceFile.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ class SourceFile final : public FileUnit {
582582
bool hasDelayedBodyParsing() const;
583583

584584
syntax::SourceFileSyntax getSyntaxRoot() const;
585-
bool hasSyntaxRoot() const;
586585

587586
OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName) override;
588587

lib/AST/Module.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,12 +1088,8 @@ void SourceFile::getInterfaceHash(llvm::SmallString<32> &str) const {
10881088
llvm::MD5::stringifyResult(result, str);
10891089
}
10901090

1091-
bool SourceFile::hasSyntaxRoot() const {
1092-
return ParsingOpts.contains(ParsingFlags::BuildSyntaxTree);
1093-
}
1094-
10951091
syntax::SourceFileSyntax SourceFile::getSyntaxRoot() const {
1096-
assert(hasSyntaxRoot() && "has no syntax root");
1092+
assert(shouldBuildSyntaxTree() && "Syntax tree disabled");
10971093
auto &eval = getASTContext().evaluator;
10981094
auto *mutableThis = const_cast<SourceFile *>(this);
10991095
return *evaluateOrDefault(eval, ParseSourceFileRequest{mutableThis}, {})

0 commit comments

Comments
 (0)