[Parse] Optimize syntax parsing: Disable name lookups during parsing

This eliminates the overhead of doing name lookups during parsing (which is unncessary during syntactic parsing) by enabling the `EnableASTScopeLookup` lang option.
This commit is contained in:
Argyrios Kyrtzidis
2019-01-01 12:31:32 -08:00
parent 57c1f72cc3
commit 5bef4c704c
2 changed files with 5 additions and 0 deletions

View File

@@ -187,6 +187,8 @@ swiftparse_client_node_t SynParser::parse(const char *source) {
LangOptions langOpts;
langOpts.BuildSyntaxTree = true;
langOpts.CollectParsedToken = false;
// Disable name lookups during parsing.
langOpts.EnableASTScopeLookup = true;
auto parseActions =
std::make_shared<CLibParseActions>(*this, SM, bufID);