Chromium Code Reviews| 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 1c415a1229dba2d5ac6d45065fdf05d965a0bb7b..90a720d40e2d3c89c8b69fc414da620966988673 100644 |
| --- a/pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| +++ b/pkg/front_end/lib/src/fasta/compiler_command_line.dart |
| @@ -10,6 +10,9 @@ import 'command_line.dart' show CommandLine, argumentError; |
| import 'compiler_context.dart' show CompilerContext; |
| +import 'package:kernel/target/targets.dart' as backend_targets |
| + show Target, getTarget, TargetFlags; |
| + |
| const Map<String, dynamic> optionSpecification = const <String, dynamic>{ |
| "--compile-sdk": Uri, |
| "--fatal": ",", |
| @@ -23,6 +26,7 @@ const Map<String, dynamic> optionSpecification = const <String, dynamic>{ |
| class CompilerCommandLine extends CommandLine { |
| final String programName; |
| + backend_targets.Target cachedTarget; |
| CompilerCommandLine(String programName, List<String> arguments) |
| : programName = programName, |
| @@ -94,6 +98,14 @@ class CompilerCommandLine extends CommandLine { |
| return options["-t"] ?? options["--target"] ?? "vm_fasta"; |
| } |
| + backend_targets.Target getTarget() { |
|
ahe
2017/06/08 14:49:37
Change this to:
backend_targets.Target get target
Dmitry Stefantsov
2017/06/09 08:24:40
Done.
|
| + if (cachedTarget != null) { |
| + return cachedTarget; |
| + } |
| + return cachedTarget = backend_targets.getTarget( |
|
ahe
2017/06/08 14:49:37
Use ??=
Dmitry Stefantsov
2017/06/09 08:24:40
Thanks for the suggestion! It looks way better tha
|
| + target, new backend_targets.TargetFlags(strongMode: strongMode)); |
| + } |
| + |
| static dynamic withGlobalOptions(String programName, List<String> arguments, |
| dynamic f(CompilerContext context)) { |
| return CompilerContext.withGlobalOptions( |