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

Unified Diff: pkg/compiler/lib/src/dump_info.dart

Issue 1287533002: dart2js: add parent references to some info objects (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | pkg/compiler/lib/src/info/info.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 0f9c123637a1f752233871ad7b8a4eb43d64e7e5..49180d92bf6901bbf8efc45d407814aeeea9348f 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -73,12 +73,16 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
Info child = this.process(member);
if (child is ClassInfo) {
info.classes.add(child);
+ child.parent = info;
} else if (child is FunctionInfo) {
info.topLevelFunctions.add(child);
+ child.parent = info;
} else if (child is FieldInfo) {
info.topLevelVariables.add(child);
+ child.parent = info;
} else if (child is TypedefInfo) {
info.typedefs.add(child);
+ child.parent = info;
} else if (child != null) {
print('unexpected child of $info: $child ==> ${child.runtimeType}');
assert(false);
@@ -154,9 +158,11 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
if (info == null) return;
if (info is FieldInfo) {
classInfo.fields.add(info);
+ info.parent = classInfo;
} else {
assert(info is FunctionInfo);
classInfo.functions.add(info);
+ info.parent = classInfo;
}
// Closures are placed in the library namespace, but we want to attribute
@@ -278,6 +284,7 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
child.name = "${parent.name}.${child.name}";
}
nestedClosures.add(child);
+ child.parent = parent;
size += child.size;
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/info/info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698