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

Unified Diff: pkg/kernel/bin/transform.dart

Issue 2668893004: VM: [Kernel] Add --embedder-entry-points-manifest to dartk/transform and pass it to the treeshaker (Closed)
Patch Set: Add missing bin/util.dart Created 3 years, 10 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 | « pkg/kernel/bin/dartk.dart ('k') | pkg/kernel/bin/util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/bin/transform.dart
diff --git a/pkg/kernel/bin/transform.dart b/pkg/kernel/bin/transform.dart
index 37f183809e023d132d1ba30064b7becdee4a37fa..5e7321454e52c8cef9c45e85b2c217a427c6e57b 100755
--- a/pkg/kernel/bin/transform.dart
+++ b/pkg/kernel/bin/transform.dart
@@ -15,6 +15,7 @@ import 'package:kernel/transformations/mixin_full_resolution.dart' as mix;
import 'package:kernel/transformations/closure_conversion.dart' as closures;
import 'package:kernel/transformations/treeshaker.dart' as treeshaker;
+import 'util.dart';
import 'batch_util.dart';
ArgParser parser = new ArgParser()
@@ -29,6 +30,10 @@ ArgParser parser = new ArgParser()
negatable: false,
help: 'Be verbose (e.g. prints transformed main library).',
defaultsTo: false)
+ ..addOption('embedder-entry-points-manifest',
+ allowMultiple: true,
+ help: 'A path to a file describing entrypoints '
+ '(lines of the form `<library>,<class>,<member>`).')
..addOption('transformation',
abbr: 't',
help: 'The transformation to apply.',
@@ -62,6 +67,11 @@ Future<CompilerOutcome> runTransformation(List<String> arguments) async {
output = '${input.substring(0, input.lastIndexOf('.'))}.transformed.dill';
}
+ List<String> embedderEntryPointManifests =
+ options['embedder-entry-points-manifest'] as List<String>;
+ List<treeshaker.ProgramRoot> programRoots =
+ parseProgramRoots(embedderEntryPointManifests);
+
var program = loadProgramFromBinary(input);
switch (options['transformation']) {
case 'continuation':
@@ -77,7 +87,8 @@ Future<CompilerOutcome> runTransformation(List<String> arguments) async {
program = closures.transformProgram(program);
break;
case 'treeshake':
- program = treeshaker.transformProgram(program);
+ program =
+ treeshaker.transformProgram(program, programRoots: programRoots);
break;
default:
throw 'Unknown transformation';
« no previous file with comments | « pkg/kernel/bin/dartk.dart ('k') | pkg/kernel/bin/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698