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

Unified Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10832242: Traverse newly discovered elements to pick more referenced types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | lib/compiler/implementation/dart_backend/placeholder_collector.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index aa5cb2c705efbc567f457035a33ae811387803c1..e4adcc3786cc0a9a2228cfa841561f44a1ff41bc 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -69,6 +69,10 @@ class DartBackend extends Backend {
compiler, element, treeElements, typedefs, classes)
.collect();
});
+ final emptyTreeElements = new TreeElementMapping();
+ collectElement(element) { collector.collect(element, emptyTreeElements); }
+ typedefs.forEach(collectElement);
+ classes.forEach(collectElement);
ConflictingRenamer renamer =
new ConflictingRenamer(compiler, collector.placeholders);
@@ -142,7 +146,12 @@ class ReferencedElementCollector extends AbstractVisitor {
visitTypeAnnotation(TypeAnnotation typeAnnotation) {
final type = compiler.resolveTypeAnnotation(element, typeAnnotation);
Element typeElement = type.element;
- if (typeElement.isTypedef()) typedefs.add(typeElement);
+ if (typeElement.isTypedef() && !typedefs.contains(typeElement)) {
+ typedefs.add(typeElement);
+ new ReferencedElementCollector(
+ compiler, typeElement, new TreeElementMapping(), typedefs, classes)
+ .collect();
+ }
if (typeElement.isClass()) classes.add(typeElement);
typeAnnotation.visitChildren(this);
}
« no previous file with comments | « no previous file | lib/compiler/implementation/dart_backend/placeholder_collector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698