Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: pkg/front_end/lib/src/incremental/kernel_driver.dart

Issue 2980093002: Disable printing in kernel-driver (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
///
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698