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

Unified Diff: pkg/front_end/lib/src/fasta/run.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/run.dart
diff --git a/pkg/front_end/lib/src/fasta/run.dart b/pkg/front_end/lib/src/fasta/run.dart
index 575e12c6a9a969e9da3a7f49a7db9a0a63d9c902..9f12bc0fb3a5d6c291050d6a90f5cbbce8500c3c 100644
--- a/pkg/front_end/lib/src/fasta/run.dart
+++ b/pkg/front_end/lib/src/fasta/run.dart
@@ -30,8 +30,10 @@ const int iterations = const int.fromEnvironment("iterations", defaultValue: 1);
mainEntryPoint(List<String> arguments) async {
Uri uri;
for (int i = 0; i < iterations; i++) {
- await CompilerCommandLine.withGlobalOptions("run", arguments,
- (CompilerContext c) async {
+ await CompilerCommandLine.withGlobalOptions("run", arguments, false,
+ (CompilerContext c, List<String> restArguments) async {
+ var input = Uri.base.resolve(restArguments[0]);
+ c.options.inputs.add(input);
if (i > 0) {
print("\n");
}
@@ -46,17 +48,17 @@ mainEntryPoint(List<String> arguments) async {
}
if (exitCode != 0) exit(exitCode);
if (i + 1 == iterations) {
- exit(await run(uri, c));
+ exit(await run(uri, c, restArguments));
}
});
}
}
-Future<int> run(Uri uri, CompilerContext c) async {
+Future<int> run(Uri uri, CompilerContext c, List<String> allArguments) async {
Uri sdk = await computePatchedSdk();
Uri dartVm = computeDartVm(sdk);
List<String> arguments = <String>["${uri.toFilePath()}"]
- ..addAll(c.options.arguments.skip(1));
+ ..addAll(allArguments.skip(1));
if (c.options.verbose) {
print("Running ${dartVm.toFilePath()} ${arguments.join(' ')}");
}

Powered by Google App Engine
This is Rietveld 408576698