| Index: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
|
| index b7ec22eb16116749c8b57b6734065754180da33f..162c8e7e1681f633b4b6d2258d25ceb8a968c0de 100644
|
| --- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
|
| +++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
|
| @@ -267,7 +267,9 @@ class KernelTarget extends TargetImplementation {
|
| ///
|
| /// When [trimDependencies] is true, this also runs a tree-shaker that deletes
|
| /// anything from the [DillTarget] that is not needed for the source program,
|
| - /// this includes function bodies and types that are not reachable.
|
| + /// this includes function bodies and types that are not reachable. This
|
| + /// option is currently in flux and the internal implementation might change.
|
| + /// See [trimDependenciesInProgram] for more details.
|
| ///
|
| /// If [verify], run the default kernel verification on the resulting program.
|
| @override
|
| @@ -375,8 +377,7 @@ class KernelTarget extends TargetImplementation {
|
| Map<String, Source> uriToSource =
|
| new Map<String, Source>.from(this.uriToSource);
|
|
|
| - List<Library> extraLibraries = dillTarget.loader.libraries;
|
| - libraries.addAll(extraLibraries);
|
| + libraries.addAll(dillTarget.loader.libraries);
|
| // TODO(scheglov) Should we also somehow update `uriToSource`?
|
| // uriToSource.addAll(binary.uriToSource);
|
|
|
| @@ -684,6 +685,12 @@ class KernelTarget extends TargetImplementation {
|
| /// Tree-shakes most code from the [dillTarget] by visiting all other
|
| /// libraries in [_program] and marking the APIs from the [dillTarget]
|
| /// libraries that are in use.
|
| + ///
|
| + /// Note: while it's likely we'll do some trimming of programs for modular
|
| + /// compilation, it is unclear at this time when and how that trimming should
|
| + /// happen. We are likely going to remove the extra visitor my either marking
|
| + /// things while code is built, or by handling tree-shaking after the fact
|
| + /// (e.g. during serialization).
|
| trimDependenciesInProgram() {
|
| var toShake =
|
| dillTarget.loader.libraries.map((lib) => lib.importUri).toSet();
|
|
|