Chromium Code Reviews| 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 2a0f3ffa45332105a4160fb28dcc55377fbe02ec..7841e891ff17949096042281d43e4dfc2458ee12 100644 |
| --- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
| +++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart |
| @@ -40,7 +40,6 @@ import 'package:kernel/ast.dart' |
| VariableGet, |
| VoidType; |
| -import 'package:kernel/core_types.dart' show CoreTypes; |
| import 'package:kernel/transformations/erasure.dart' show Erasure; |
| import 'package:kernel/transformations/continuation.dart' as transformAsync; |
| @@ -254,6 +253,10 @@ class KernelTarget extends TargetImplementation { |
| loader.performInitializerInference(); |
| } on InputError catch (e) { |
| handleInputError(e, isFullProgram: false); |
| + // TODO(scheglov) Normally we create CoreTypes and ClassHierarchy. |
| + // But if there is an exception, they are not created, and when we later |
| + // blindly continue with buildProgram(), we crash. |
| + loader.computeHierarchy(_program); |
|
ahe
2017/05/29 14:08:46
If there's an InputError during buildOutlines, we
scheglov
2017/05/30 00:06:10
"We shouldn't call" as "It is a known existing pro
ahe
2017/05/30 09:35:14
I didn't know about it before seeing this change.
scheglov
2017/05/30 16:10:21
Well, it is a pre-existing problem.
My feeling is
ahe
2017/05/31 11:20:16
I completely understand why you get that feeling w
scheglov
2017/05/31 16:49:37
Nice.
Thank you.
I removed this workaround.
|
| } catch (e, s) { |
| return reportCrash(e, s, loader?.currentUriForCrashReporting); |
| } |
| @@ -662,7 +665,8 @@ class KernelTarget extends TargetImplementation { |
| } |
| void transformMixinApplications() { |
| - new MixinFullResolution(backendTarget).transform(_program); |
| + new MixinFullResolution(backendTarget, loader.coreTypes) |
| + .transform(_program); |
| ticker.logMs("Transformed mixin applications"); |
| } |
| @@ -672,9 +676,8 @@ class KernelTarget extends TargetImplementation { |
| _program.accept(new Erasure()); |
| ticker.logMs("Erased type variables in generic methods"); |
| } |
| - var coreTypes = new CoreTypes(_program); |
| // TODO(kmillikin): Make this run on a per-method basis. |
| - transformAsync.transformLibraries(coreTypes, loader.libraries); |
| + transformAsync.transformLibraries(loader.coreTypes, loader.libraries); |
| ticker.logMs("Transformed async methods"); |
| } |
| @@ -701,7 +704,7 @@ class KernelTarget extends TargetImplementation { |
| // TODO(sigmund): replace this step with data that is directly computed from |
| // the builders: we should know the tree-shaking roots without having to do |
| // a second visit over the tree. |
| - new RootsMarker(data).run(_program, isIncluded); |
| + new RootsMarker(loader.coreTypes, data).run(_program, isIncluded); |
| trimProgram(_program, data, isIncluded); |
| } |