Chromium Code Reviews| Index: pkg/compiler/lib/src/deferred_load.dart |
| diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart |
| index 00eaf84cfec2ddc8f0635e4c5f21f92f4970a60f..b56f3860f896b79d9ea618d07c3f41a021979935 100644 |
| --- a/pkg/compiler/lib/src/deferred_load.dart |
| +++ b/pkg/compiler/lib/src/deferred_load.dart |
| @@ -38,6 +38,8 @@ import 'elements/elements.dart' show |
| TypedefElement, |
| VoidElement; |
| +import 'dart_types.dart'; |
| + |
| import 'util/util.dart' show |
| Link, makeUnique; |
| import 'util/uri_extras.dart' as uri_extras; |
| @@ -301,6 +303,30 @@ class DeferredLoadTask extends CompilerTask { |
| addConstants(constant.value); |
| } |
| } |
| + |
| + collectTypeDependencies(DartType type) { |
| + if (type is FunctionType) { |
| + for (DartType argumentType in type.parameterTypes) { |
| + collectTypeDependencies(argumentType); |
| + } |
| + for (DartType argumentType in type.optionalParameterTypes) { |
| + collectTypeDependencies(argumentType); |
| + } |
| + for (DartType argumentType in type.namedParameterTypes) { |
| + collectTypeDependencies(argumentType); |
| + } |
| + collectTypeDependencies(type.returnType); |
| + } else if (type is TypedefType) { |
| + type.element.alias; |
|
karlklose
2015/04/13 08:10:57
Add the type's element to elements?
Shouldn't thi
sigurdm
2015/04/13 13:37:08
Done
|
| + } else if (type is InterfaceType) { |
| + elements.add(type.element); |
| + } |
| + } |
| + |
| + if (element is FunctionElement) { |
| + collectTypeDependencies(element.type); |
| + } |
| + |
| if (element.isClass) { |
| // If we see a class, add everything its live instance members refer |
| // to. Static members are not relevant, unless we are processing |