Index: pkg/compiler/lib/src/universe/class_set.dart |
diff --git a/pkg/compiler/lib/src/universe/class_set.dart b/pkg/compiler/lib/src/universe/class_set.dart |
index d19b2c1ceff8cd1cc655b6d0d016c9761c89a1ac..6cafa09f423bcf9ebed44c358b1217ebdafffc3e 100644 |
--- a/pkg/compiler/lib/src/universe/class_set.dart |
+++ b/pkg/compiler/lib/src/universe/class_set.dart |
@@ -101,27 +101,50 @@ class ClassHierarchyNode { |
includeUninstantiated: includeUninstantiated); |
} |
- void dump(StringBuffer sb, String indentation) { |
- sb.write('$indentation$cls:['); |
+ void printOn(StringBuffer sb, String indentation, |
+ {bool instantiatedOnly: false}) { |
+ sb.write('$indentation$cls'); |
+ if (isDirectlyInstantiated) { |
+ sb.write(' directly'); |
+ } |
+ if (isIndirectlyInstantiated) { |
+ sb.write(' indirectly'); |
+ } |
+ sb.write(' ['); |
if (_directSubclasses.isEmpty) { |
sb.write(']'); |
} else { |
- sb.write('\n'); |
bool needsComma = false; |
for (Link<ClassHierarchyNode> link = _directSubclasses; |
!link.isEmpty; |
link = link.tail) { |
+ if (instantiatedOnly && !link.head.isInstantiated) { |
+ continue; |
+ } |
if (needsComma) { |
sb.write(',\n'); |
+ } else { |
+ sb.write('\n'); |
} |
- link.head.dump(sb, '$indentation '); |
+ link.head.printOn( |
+ sb, '$indentation ', instantiatedOnly: instantiatedOnly); |
needsComma = true; |
} |
- sb.write('\n'); |
- sb.write('$indentation]'); |
+ if (needsComma) { |
+ sb.write('\n'); |
+ sb.write('$indentation]'); |
+ } else { |
+ sb.write(']'); |
+ } |
} |
} |
+ String dump({String indentation: '', bool instantiatedOnly: false}) { |
+ StringBuffer sb = new StringBuffer(); |
+ printOn(sb, indentation, instantiatedOnly: instantiatedOnly); |
+ return sb.toString(); |
+ } |
+ |
String toString() => cls.toString(); |
} |
@@ -274,11 +297,11 @@ class ClassSet { |
String toString() { |
StringBuffer sb = new StringBuffer(); |
sb.write('[\n'); |
- node.dump(sb, ' '); |
+ node.printOn(sb, ' '); |
sb.write('\n'); |
if (_directSubtypes != null) { |
for (ClassHierarchyNode node in _directSubtypes) { |
- node.dump(sb, ' '); |
+ node.printOn(sb, ' '); |
sb.write('\n'); |
} |
} |