| 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 library fasta.compile_platform; | 5 library fasta.compile_platform; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'kernel/verifier.dart' show verifyProgram; | |
| 10 | |
| 11 import 'ticker.dart' show Ticker; | 9 import 'ticker.dart' show Ticker; |
| 12 | 10 |
| 13 import 'dart:io' show exitCode; | 11 import 'dart:io' show exitCode; |
| 14 | 12 |
| 15 import 'compiler_command_line.dart' show CompilerCommandLine; | 13 import 'compiler_command_line.dart' show CompilerCommandLine; |
| 16 | 14 |
| 17 import 'compiler_context.dart' show CompilerContext; | 15 import 'compiler_context.dart' show CompilerContext; |
| 18 | 16 |
| 19 import 'errors.dart' show InputError; | 17 import 'errors.dart' show InputError; |
| 20 | 18 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 57 |
| 60 DillTarget dillTarget = new DillTarget(ticker, uriTranslator); | 58 DillTarget dillTarget = new DillTarget(ticker, uriTranslator); |
| 61 KernelTarget kernelTarget = | 59 KernelTarget kernelTarget = |
| 62 new KernelTarget(dillTarget, uriTranslator, c.uriToSource); | 60 new KernelTarget(dillTarget, uriTranslator, c.uriToSource); |
| 63 | 61 |
| 64 kernelTarget.read(Uri.parse("dart:core")); | 62 kernelTarget.read(Uri.parse("dart:core")); |
| 65 await dillTarget.writeOutline(null); | 63 await dillTarget.writeOutline(null); |
| 66 await kernelTarget.writeOutline(output); | 64 await kernelTarget.writeOutline(output); |
| 67 | 65 |
| 68 if (exitCode != 0) return null; | 66 if (exitCode != 0) return null; |
| 69 if (c.options.dumpIr) { | 67 await kernelTarget.writeProgram(output, |
| 70 kernelTarget.dumpIr(); | 68 dumpIr: c.options.dumpIr, verify: c.options.verify); |
| 71 } | |
| 72 if (c.options.verify) { | |
| 73 try { | |
| 74 verifyProgram(kernelTarget.program); | |
| 75 ticker.logMs("Verified program"); | |
| 76 } catch (e, s) { | |
| 77 exitCode = 1; | |
| 78 print("Verification of program failed: $e"); | |
| 79 if (s != null && c.options.verbose) { | |
| 80 print(s); | |
| 81 } | |
| 82 } | |
| 83 } | |
| 84 if (exitCode != 0) return null; | |
| 85 await kernelTarget.writeProgram(output); | |
| 86 await kernelTarget.writeDepsFile(output, deps); | 69 await kernelTarget.writeDepsFile(output, deps); |
| 87 } | 70 } |
| OLD | NEW |