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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1468583002: Add a unit index to prelinked type references in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove an unnecessary TODO. Created 5 years, 1 month 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 | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 79a73a3858a6f71fdfdfb38ad93952793423db86..1ad8dd72981f01953a11e99952583722761e397c 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -555,6 +555,10 @@ class _LibrarySerializer {
} else {
b.reference = referenceMap.putIfAbsent(element, () {
assert(unlinkedReferences.length == prelinkedReferences.length);
+ CompilationUnitElement unitElement =
+ element.getAncestor((Element e) => e is CompilationUnitElement);
+ int unit = dependentLibrary.units.indexOf(unitElement);
+ assert(unit != -1);
int index = unlinkedReferences.length;
// TODO(paulberry): set UnlinkedReference.prefix.
unlinkedReferences
@@ -563,7 +567,8 @@ class _LibrarySerializer {
dependency: serializeDependency(dependentLibrary),
kind: element is FunctionTypeAliasElement
? PrelinkedReferenceKind.typedef
- : PrelinkedReferenceKind.classOrEnum));
+ : PrelinkedReferenceKind.classOrEnum,
+ unit: unit));
return index;
});
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698