| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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_impl; | 6 library front_end.kernel_generator_impl; |
| 7 | 7 |
| 8 import 'dart:async' show Future; | 8 import 'dart:async' show Future; |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Linked dependencies are meant to be part of the program so they are not | 95 // Linked dependencies are meant to be part of the program so they are not |
| 96 // marked external. | 96 // marked external. |
| 97 for (var dependency in await options.loadLinkDependencies(nameRoot)) { | 97 for (var dependency in await options.loadLinkDependencies(nameRoot)) { |
| 98 var excluded = externalLibs(dependency); | 98 var excluded = externalLibs(dependency); |
| 99 dillTarget.loader | 99 dillTarget.loader |
| 100 .appendLibraries(dependency, (uri) => !excluded.contains(uri)); | 100 .appendLibraries(dependency, (uri) => !excluded.contains(uri)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 await dillTarget.buildOutlines(); | 103 await dillTarget.buildOutlines(); |
| 104 | 104 |
| 105 var kernelTarget = new KernelTarget(fs, dillTarget, uriTranslator); | 105 var kernelTarget = new KernelTarget(fs, false, dillTarget, uriTranslator); |
| 106 options.inputs.forEach(kernelTarget.read); | 106 options.inputs.forEach(kernelTarget.read); |
| 107 Program summaryProgram = | 107 Program summaryProgram = |
| 108 await kernelTarget.buildOutlines(nameRoot: nameRoot); | 108 await kernelTarget.buildOutlines(nameRoot: nameRoot); |
| 109 List<int> summary = null; | 109 List<int> summary = null; |
| 110 if (buildSummary) { | 110 if (buildSummary) { |
| 111 if (trimDependencies) { | 111 if (trimDependencies) { |
| 112 // TODO(sigmund): see if it is worth supporting this. Note: trimming the | 112 // TODO(sigmund): see if it is worth supporting this. Note: trimming the |
| 113 // program is destructive, so if we are emitting summaries and the | 113 // program is destructive, so if we are emitting summaries and the |
| 114 // program in a single API call, we would need to clone the program here | 114 // program in a single API call, we would need to clone the program here |
| 115 // to avoid deleting pieces that are needed by kernelTarget.buildProgram | 115 // to avoid deleting pieces that are needed by kernelTarget.buildProgram |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 final Program program; | 173 final Program program; |
| 174 | 174 |
| 175 /// Dependencies traversed by the compiler. Used only for generating | 175 /// Dependencies traversed by the compiler. Used only for generating |
| 176 /// dependency .GN files in the dart-sdk build system. | 176 /// dependency .GN files in the dart-sdk build system. |
| 177 /// Note this might be removed when we switch to compute depencencies without | 177 /// Note this might be removed when we switch to compute depencencies without |
| 178 /// using the compiler itself. | 178 /// using the compiler itself. |
| 179 final List<Uri> deps; | 179 final List<Uri> deps; |
| 180 | 180 |
| 181 CompilerResult({this.summary, this.program, this.deps}); | 181 CompilerResult({this.summary, this.program, this.deps}); |
| 182 } | 182 } |
| OLD | NEW |