mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user