[AST] Remove hasSyntaxRoot

Use `shouldBuildSyntaxTree` instead.
This commit is contained in:
Hamish Knight
2020-06-07 20:21:28 -07:00
parent 9398153c9d
commit db9a27e24a
2 changed files with 1 additions and 6 deletions

View File

@@ -1088,12 +1088,8 @@ void SourceFile::getInterfaceHash(llvm::SmallString<32> &str) const {
llvm::MD5::stringifyResult(result, str);
}
bool SourceFile::hasSyntaxRoot() const {
return ParsingOpts.contains(ParsingFlags::BuildSyntaxTree);
}
syntax::SourceFileSyntax SourceFile::getSyntaxRoot() const {
assert(hasSyntaxRoot() && "has no syntax root");
assert(shouldBuildSyntaxTree() && "Syntax tree disabled");
auto &eval = getASTContext().evaluator;
auto *mutableThis = const_cast<SourceFile *>(this);
return *evaluateOrDefault(eval, ParseSourceFileRequest{mutableThis}, {})