OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library rasta.rastask; | 5 library rasta.rastask; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:io' show | 10 import 'dart:io' show |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 bool generateLibrary = options.generateLibrary; | 107 bool generateLibrary = options.generateLibrary; |
108 if (generateLibrary == null) { | 108 if (generateLibrary == null) { |
109 generateLibrary = !kernel.hasMainMethod(options.input); | 109 generateLibrary = !kernel.hasMainMethod(options.input); |
110 } | 110 } |
111 | 111 |
112 Iterable<ir.Procedure> mainMethods = library.procedures.where( | 112 Iterable<ir.Procedure> mainMethods = library.procedures.where( |
113 (ir.Procedure function) => function.name.name == "main"); | 113 (ir.Procedure function) => function.name.name == "main"); |
114 ir.Program program = | 114 ir.Program program = |
115 new ir.Program(kernel.libraryDependencies(options.input)); | 115 new ir.Program(kernel.libraryDependencies(options.input)); |
| 116 kernel.addLineStartsTo(program); |
116 | 117 |
117 if (mainMethods.isNotEmpty) { | 118 if (mainMethods.isNotEmpty) { |
118 program.mainMethod = mainMethods.single; | 119 program.mainMethod = mainMethods.single; |
119 } | 120 } |
120 compiler.printVerboseTimings(setupDuration); | 121 compiler.printVerboseTimings(setupDuration); |
121 if (!options.noOutput) { | 122 if (!options.noOutput) { |
122 if (options.output != null) { | 123 if (options.output != null) { |
123 await openWrite(options.output, (IOSink sink) { | 124 await openWrite(options.output, (IOSink sink) { |
124 BinaryPrinter printer = new BinaryPrinter(sink); | 125 BinaryPrinter printer = new BinaryPrinter(sink); |
125 printer.writeProgramFile(program); | 126 printer.writeProgramFile(program); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 Rastask task; | 187 Rastask task; |
187 if (options.isBatch) { | 188 if (options.isBatch) { |
188 task = new RunBatch(compiler, wallClock, options); | 189 task = new RunBatch(compiler, wallClock, options); |
189 } else { | 190 } else { |
190 task = new RunSingle(compiler, wallClock, options); | 191 task = new RunSingle(compiler, wallClock, options); |
191 } | 192 } |
192 compiler.tasks.add(task); | 193 compiler.tasks.add(task); |
193 return task; | 194 return task; |
194 } | 195 } |
195 } | 196 } |
OLD | NEW |