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

Unified Diff: pkg/front_end/lib/src/fasta/testing/kernel_chain.dart

Issue 2982093003: Unifying compiler context (Closed)
Patch Set: revert change to kernel-service.dart 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
Index: pkg/front_end/lib/src/fasta/testing/kernel_chain.dart
diff --git a/pkg/front_end/lib/src/fasta/testing/kernel_chain.dart b/pkg/front_end/lib/src/fasta/testing/kernel_chain.dart
index 7eff138851329b0bc3b76503d9344378a4f06402..b518f37adcfedb450b822e2a782c1504db45d9c6 100644
--- a/pkg/front_end/lib/src/fasta/testing/kernel_chain.dart
+++ b/pkg/front_end/lib/src/fasta/testing/kernel_chain.dart
@@ -25,7 +25,7 @@ import 'package:kernel/ast.dart' show Library, Program;
import '../kernel/verifier.dart' show verifyProgram;
-import '../compiler_command_line.dart';
+import '../compiler_context.dart';
import 'package:kernel/binary/ast_to_binary.dart' show BinaryPrinter;
@@ -38,6 +38,9 @@ import 'package:kernel/ast.dart' show Program;
import 'package:front_end/front_end.dart';
+import 'package:front_end/src/base/processed_options.dart'
+ show ProcessedOptions;
+
import 'patched_sdk_location.dart' show computePatchedSdk;
class Print extends Step<Program, Program, ChainContext> {
@@ -67,7 +70,9 @@ class Verify extends Step<Program, Program, ChainContext> {
String get name => "verify";
Future<Result<Program>> run(Program program, ChainContext context) async {
- return await CompilerCommandLine.withGlobalOptions("", [""], (_) async {
+ var options =
+ new ProcessedOptions(new CompilerOptions()..throwOnErrors = false);
+ return await CompilerContext.runWithOptions(options, (_) async {
var errors = verifyProgram(program, isOutline: !fullCompile);
if (errors.isEmpty) {
return pass(program);
@@ -191,7 +196,7 @@ class Compile extends Step<TestDescription, Program, CompileContext> {
Future<Result<Program>> run(
TestDescription description, CompileContext context) async {
Result<Program> result;
- reportError(CompilationError error) {
+ reportError(CompilationMessage error) {
result ??= fail(null, error.message);
}

Powered by Google App Engine
This is Rietveld 408576698