713b03a5fd
This class is used during summary linking to do some basic resolution of ASTs reconstituted from summaries. To prepare for some resolution work I have in the pipeline, I need to ensure that resolution always has access to a properly initialized FlowAnalysis object; this rework makes that possible. Previously, the lifetime of the AstResolver class was inconsistent; some callers created one for each AST node to be resolved, and others shared a single instance for resolving many loosely related nodes. Now we consistently allocate a fresh AstResolver each time resolution is needed; this allows AstResolver to use late fields to lazily create the visitors it needs for resolution. Also, previously the API for AstResolver was a single resolve() method with a complex set of behaviors to allow it to handle all the use cases. Now there are three simpler methods to handle the three use cases (resolveAnnotation, resolveConstructorNode, and resolveExpression). Change-Id: I891ae621d4a188d906332cb05b6b7f9a50d59dcd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198860 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>