Chromium Code Reviews| Index: pkg/front_end/lib/src/incremental/kernel_driver.dart |
| diff --git a/pkg/front_end/lib/src/incremental/kernel_driver.dart b/pkg/front_end/lib/src/incremental/kernel_driver.dart |
| index 6a6c236c17f39e5e28ddefe5de0326828f57c19d..0b350ac0167bf7f4a7732d94a4591871f6d0356d 100644 |
| --- a/pkg/front_end/lib/src/incremental/kernel_driver.dart |
| +++ b/pkg/front_end/lib/src/incremental/kernel_driver.dart |
| @@ -7,6 +7,8 @@ import 'dart:async'; |
| import 'package:front_end/file_system.dart'; |
| import 'package:front_end/src/base/api_signature.dart'; |
| import 'package:front_end/src/base/performace_logger.dart'; |
| +import 'package:front_end/src/fasta/compiler_command_line.dart'; |
| +import 'package:front_end/src/fasta/compiler_context.dart'; |
| import 'package:front_end/src/fasta/dill/dill_library_builder.dart'; |
| import 'package:front_end/src/fasta/dill/dill_target.dart'; |
| import 'package:front_end/src/fasta/kernel/kernel_target.dart'; |
| @@ -113,7 +115,7 @@ class KernelDriver { |
| /// |
| /// Otherwise the driver will compute new kernel files and return them. |
| Future<KernelResult> getKernel(Uri uri) async { |
| - return await _logger.runAsync('Compute delta', () async { |
| + return await runWithFrontEndContext('Compute delta', () async { |
| await _refreshInvalidatedFiles(); |
| // Ensure that the graph starting at the entry point is ready. |
| @@ -146,6 +148,16 @@ class KernelDriver { |
| }); |
| } |
| + Future<T> runWithFrontEndContext<T>(String msg, Future<T> f()) async { |
| + return await CompilerCommandLine.withGlobalOptions("", [""], |
|
scheglov
2017/07/14 15:49:17
The name CompilerCommandLine does not make sense i
Siggi Cherem (dart-lang)
2017/07/14 16:34:04
Completely agree - this is exactly what I'm workin
|
| + (CompilerContext context) { |
| + context.options.options["--target"] = _target; |
| + context.options.options["report"] = (message, severity) {}; |
| + context.options.options["reportWithoutLocation"] = (message, severity) {}; |
| + return _logger.runAsync(msg, f); |
| + }); |
| + } |
| + |
| /// The file with the given [uri] might have changed - updated, added, or |
| /// removed. Or not, we don't know. Or it might have, but then changed back. |
| /// |