Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2955163002: Store subtyped names in Analysis Driver unlinked units. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 6a8e884346e2fde879ed5372dfa9dd3dc7194fed..42139e1c02ac3bed856a486f27cedb74d3388d65 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -116,6 +116,7 @@ class FileState {
Set<String> _definedTopLevelNames;
Set<String> _definedClassMemberNames;
Set<String> _referencedNames;
+ Set<String> _subtypedNames;
UnlinkedUnit _unlinked;
List<int> _apiSignature;
@@ -277,6 +278,12 @@ class FileState {
Set<String> get referencedNames => _referencedNames;
/**
+ * The names which are used in `extends`, `with` or `implements` clauses in
+ * the file. Import prefixes and type arguments are not included.
+ */
+ Set<String> get subtypedNames => _subtypedNames;
+
+ /**
* Return public top-level declarations declared in the file. The keys to the
* map are names of declarations.
*/
@@ -435,14 +442,16 @@ class FileState {
CompilationUnit unit = parse(AnalysisErrorListener.NULL_LISTENER);
_fsState._logger.run('Create unlinked for $path', () {
UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit);
- List<String> referencedNames = computeReferencedNames(unit).toList();
DefinedNames definedNames = computeDefinedNames(unit);
+ List<String> referencedNames = computeReferencedNames(unit).toList();
+ List<String> subtypedNames = computeSubtypedNames(unit).toList();
bytes = new AnalysisDriverUnlinkedUnitBuilder(
unit: unlinkedUnit,
definedTopLevelNames: definedNames.topLevelNames.toList(),
definedClassMemberNames:
definedNames.classMemberNames.toList(),
- referencedNames: referencedNames)
+ referencedNames: referencedNames,
+ subtypedNames: subtypedNames)
.toBuffer();
_fsState._byteStore.put(unlinkedKey, bytes);
});
@@ -455,6 +464,7 @@ class FileState {
_definedClassMemberNames =
driverUnlinkedUnit.definedClassMemberNames.toSet();
_referencedNames = driverUnlinkedUnit.referencedNames.toSet();
+ _subtypedNames = driverUnlinkedUnit.subtypedNames.toSet();
_unlinked = driverUnlinkedUnit.unit;
_lineInfo = new LineInfo(_unlinked.lineStarts);
_topLevelDeclarations = null;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698