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

Unified Diff: pkg/front_end/lib/kernel_generator.dart

Issue 2919003003: Reapply "Use backend targets to run Kernel transformations in Fasta" (Closed)
Patch Set: Follow dartanalyzer suggestions Created 3 years, 7 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/kernel_generator.dart
diff --git a/pkg/front_end/lib/kernel_generator.dart b/pkg/front_end/lib/kernel_generator.dart
index eec59026300a31c26820e2466f6114eaa1247ada..248d13d447de9e5ec40a29f6af52f7b16fd4db33 100644
--- a/pkg/front_end/lib/kernel_generator.dart
+++ b/pkg/front_end/lib/kernel_generator.dart
@@ -13,6 +13,7 @@ import 'src/fasta/dill/dill_target.dart' show DillTarget;
import 'src/fasta/errors.dart' show InputError;
import 'src/fasta/kernel/kernel_target.dart' show KernelTarget;
import 'package:kernel/kernel.dart' show Program;
+import 'package:kernel/target/targets.dart' show TargetFlags;
import 'src/fasta/ticker.dart' show Ticker;
import 'src/fasta/translate_uri.dart' show TranslateUri;
import 'src/simple_error.dart';
@@ -52,15 +53,16 @@ Future<Program> kernelForProgram(Uri source, CompilerOptions options) async {
try {
TranslateUri uriTranslator = await pOptions.getUriTranslator();
- var dillTarget =
- new DillTarget(new Ticker(isVerbose: false), uriTranslator, "vm");
+ var dillTarget = new DillTarget(
+ new Ticker(isVerbose: false), uriTranslator, "vm_fasta",
+ flags: new TargetFlags(strongMode: options.strongMode));
var summary = await pOptions.sdkSummaryProgram;
if (summary != null) {
dillTarget.loader.appendLibraries(summary);
}
- var kernelTarget = new KernelTarget(
- options.fileSystem, dillTarget, uriTranslator, options.strongMode);
+ var kernelTarget =
+ new KernelTarget(options.fileSystem, dillTarget, uriTranslator);
kernelTarget.read(source);
await dillTarget.buildOutlines();
@@ -148,8 +150,9 @@ Future<Program> kernelForBuildUnit(
try {
TranslateUri uriTranslator = await pOptions.getUriTranslator();
- var dillTarget =
- new DillTarget(new Ticker(isVerbose: false), uriTranslator, "vm");
+ var dillTarget = new DillTarget(
+ new Ticker(isVerbose: false), uriTranslator, "vm_fasta",
+ flags: new TargetFlags(strongMode: options.strongMode));
var summary = await pOptions.sdkSummaryProgram;
if (summary != null) {
dillTarget.loader.appendLibraries(summary);
@@ -164,8 +167,8 @@ Future<Program> kernelForBuildUnit(
await dillTarget.buildOutlines();
- var kernelTarget = new KernelTarget(
- options.fileSystem, dillTarget, uriTranslator, options.strongMode);
+ var kernelTarget =
+ new KernelTarget(options.fileSystem, dillTarget, uriTranslator);
sources.forEach(kernelTarget.read);
await kernelTarget.buildOutlines();

Powered by Google App Engine
This is Rietveld 408576698