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

Unified Diff: pkg/kernel/test/treeshaker_dump.dart

Issue 2918593003: Pass ClassHierarchy instead of creating it. (Closed)
Patch Set: Created 3 years, 7 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
Index: pkg/kernel/test/treeshaker_dump.dart
diff --git a/pkg/kernel/test/treeshaker_dump.dart b/pkg/kernel/test/treeshaker_dump.dart
index 0f8f22b983201901aeb145cfdc66d84355f17df5..16c1c109733496a180abbfdbd16a672a306b728b 100644
--- a/pkg/kernel/test/treeshaker_dump.dart
+++ b/pkg/kernel/test/treeshaker_dump.dart
@@ -4,6 +4,7 @@
library kernel.treeshaker_dump;
import 'dart:io';
+import 'package:kernel/class_hierarchy.dart';
import 'package:kernel/core_types.dart';
import 'package:kernel/kernel.dart';
import 'package:kernel/transformations/treeshaker.dart';
@@ -66,7 +67,9 @@ main(List<String> args) {
Program program = loadProgramFromBinary(filename);
CoreTypes coreTypes = new CoreTypes(program);
- TreeShaker shaker = new TreeShaker(coreTypes, program, strongMode: strong);
+ ClassHierarchy hierarchy = new ClosedWorldClassHierarchy(program);
+ TreeShaker shaker =
+ new TreeShaker(coreTypes, hierarchy, program, strongMode: strong);
int totalClasses = 0;
int totalInstantiationCandidates = 0;
int totalMembers = 0;
@@ -129,7 +132,8 @@ main(List<String> args) {
StringBuffer before = new StringBuffer();
new Printer(before, syntheticNames: names).writeProgramFile(program);
new File(beforeFile).writeAsStringSync('$before');
- new TreeShaker(coreTypes, program, strongMode: strong).transform(program);
+ new TreeShaker(coreTypes, hierarchy, program, strongMode: strong)
+ .transform(program);
StringBuffer after = new StringBuffer();
new Printer(after, syntheticNames: names).writeProgramFile(program);
new File(afterFile).writeAsStringSync('$after');

Powered by Google App Engine
This is Rietveld 408576698