| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Defines the front-end API for converting source code to Dart Kernel objects. | 5 /// Defines the front-end API for converting source code to Dart Kernel objects. |
| 6 library front_end.kernel_generator; | 6 library front_end.kernel_generator; |
| 7 | 7 |
| 8 import 'compiler_options.dart'; | 8 import 'compiler_options.dart'; |
| 9 import 'dart:async' show Future; | 9 import 'dart:async' show Future; |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 var dillTarget = | 56 var dillTarget = |
| 57 new DillTarget(new Ticker(isVerbose: false), uriTranslator); | 57 new DillTarget(new Ticker(isVerbose: false), uriTranslator); |
| 58 var summary = options.sdkSummary; | 58 var summary = options.sdkSummary; |
| 59 if (summary != null) dillTarget.read(summary); | 59 if (summary != null) dillTarget.read(summary); |
| 60 | 60 |
| 61 var kernelTarget = new KernelTarget( | 61 var kernelTarget = new KernelTarget( |
| 62 options.fileSystem, dillTarget, uriTranslator, options.strongMode); | 62 options.fileSystem, dillTarget, uriTranslator, options.strongMode); |
| 63 kernelTarget.read(source); | 63 kernelTarget.read(source); |
| 64 | 64 |
| 65 await dillTarget.computeOutline(); | 65 await dillTarget.buildOutlines(); |
| 66 await kernelTarget.computeOutline(); | 66 await kernelTarget.buildOutlines(); |
| 67 Program program = await kernelTarget.writeProgram(null); | 67 Program program = await kernelTarget.buildProgram(); |
| 68 | 68 |
| 69 if (kernelTarget.errors.isNotEmpty) { | 69 if (kernelTarget.errors.isNotEmpty) { |
| 70 kernelTarget.errors.forEach((e) => report('$e')); | 70 kernelTarget.errors.forEach((e) => report('$e')); |
| 71 return null; | 71 return null; |
| 72 } | 72 } |
| 73 | 73 |
| 74 if (program.mainMethod == null) { | 74 if (program.mainMethod == null) { |
| 75 return report("No 'main' method found."); | 75 return report("No 'main' method found."); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 /// TODO(paulberry): would it be better to define a data type in kernel to | 116 /// TODO(paulberry): would it be better to define a data type in kernel to |
| 117 /// represent a bundle of all the libraries in a given build unit? | 117 /// represent a bundle of all the libraries in a given build unit? |
| 118 /// | 118 /// |
| 119 /// TODO(paulberry): does additional information need to be output to allow the | 119 /// TODO(paulberry): does additional information need to be output to allow the |
| 120 /// caller to match up referenced elements to the summary files they were | 120 /// caller to match up referenced elements to the summary files they were |
| 121 /// obtained from? | 121 /// obtained from? |
| 122 Future<Program> kernelForBuildUnit( | 122 Future<Program> kernelForBuildUnit( |
| 123 List<Uri> sources, CompilerOptions options) async { | 123 List<Uri> sources, CompilerOptions options) async { |
| 124 throw new UnimplementedError("kernel for build-unit is not implemented"); | 124 throw new UnimplementedError("kernel for build-unit is not implemented"); |
| 125 } | 125 } |
| OLD | NEW |