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

Unified Diff: pkg/front_end/lib/src/fasta/compiler_command_line.dart

Issue 2897683002: Move code for instantiating Invocation to Target. (Closed)
Patch Set: Rename vmTarget to targetInfo. 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/src/fasta/compiler_command_line.dart
diff --git a/pkg/front_end/lib/src/fasta/compiler_command_line.dart b/pkg/front_end/lib/src/fasta/compiler_command_line.dart
index 96e59bb3519e81d4b821c964cd1fb3cc2705a8db..16ed4dbe157698969b582fcb7cde56b026b6cf29 100644
--- a/pkg/front_end/lib/src/fasta/compiler_command_line.dart
+++ b/pkg/front_end/lib/src/fasta/compiler_command_line.dart
@@ -17,6 +17,8 @@ const Map<String, dynamic> optionSpecification = const <String, dynamic>{
"--packages": Uri,
"--platform": Uri,
"-o": Uri,
+ "--target": String,
+ "-t": String,
};
class CompilerCommandLine extends CommandLine {
@@ -50,6 +52,9 @@ class CompilerCommandLine extends CommandLine {
if (options.containsKey("-o") && options.containsKey("--output")) {
return argumentError(usage, "Can't specify both '-o' and '--output'.");
}
+ if (options.containsKey("-t") && options.containsKey("--target")) {
+ return argumentError(usage, "Can't specify both '-t' and '--target'.");
+ }
if (programName == "compile_platform" && arguments.length != 3) {
return argumentError(usage, "Expected three arguments.");
} else if (arguments.isEmpty) {
@@ -85,6 +90,10 @@ class CompilerCommandLine extends CommandLine {
bool get strongMode => options.containsKey("--strong-mode");
+ String get target {
+ return options["-t"] ?? options["--target"] ?? "vm";
+ }
+
static dynamic withGlobalOptions(String programName, List<String> arguments,
dynamic f(CompilerContext context)) {
return CompilerContext.withGlobalOptions(
@@ -165,6 +174,9 @@ Supported options:
Read the SDK platform from <file>, which should be in Dill/Kernel IR format
and contain the Dart SDK.
+ --target=none|vm|vmcc|vmreify|flutter
+ Specify the target configuration.
+
--verify
Check that the generated output is free of various problems. This is mostly
useful for developers of this compiler or Kernel transformations.
« no previous file with comments | « pkg/front_end/lib/src/fasta/compile_platform.dart ('k') | pkg/front_end/lib/src/fasta/dill/dill_target.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698