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

Side by Side Diff: pkg/kernel/bin/dartk.dart

Issue 2610133002: Non-format-changing kernel offset changes (Closed)
Patch Set: Changed offset variable introduced in various methods in accessors.dart to a named parameter with d… Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/kernel/lib/analyzer/ast_from_analyzer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'batch_util.dart'; 9 import 'batch_util.dart';
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ..addFlag('tolerant', 68 ..addFlag('tolerant',
69 help: 'Generate kernel even if there are compile-time errors.', 69 help: 'Generate kernel even if there are compile-time errors.',
70 defaultsTo: false) 70 defaultsTo: false)
71 ..addOption('D', 71 ..addOption('D',
72 abbr: 'D', 72 abbr: 'D',
73 allowMultiple: true, 73 allowMultiple: true,
74 help: 'Define an environment variable.', 74 help: 'Define an environment variable.',
75 hide: true) 75 hide: true)
76 ..addFlag('show-external', 76 ..addFlag('show-external',
77 help: 'When printing a library as text, also print its dependencies\n' 77 help: 'When printing a library as text, also print its dependencies\n'
78 'on external libraries.'); 78 'on external libraries.')
79 ..addFlag('show-offsets',
80 help: 'When printing a library as text, also print node offsets');
79 81
80 String getUsage() => """ 82 String getUsage() => """
81 Usage: dartk [options] FILE 83 Usage: dartk [options] FILE
82 84
83 Convert .dart or .dill files to kernel's IR and print out its textual 85 Convert .dart or .dill files to kernel's IR and print out its textual
84 or binary form. 86 or binary form.
85 87
86 Examples: 88 Examples:
87 dartk foo.dart # print text IR for foo.dart 89 dartk foo.dart # print text IR for foo.dart
88 dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill 90 dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return CompilerOutcome.Ok; 371 return CompilerOutcome.Ok;
370 } 372 }
371 373
372 watch.reset(); 374 watch.reset();
373 375
374 Future ioFuture; 376 Future ioFuture;
375 if (canContinueCompilation) { 377 if (canContinueCompilation) {
376 switch (format) { 378 switch (format) {
377 case 'text': 379 case 'text':
378 writeProgramToText(program, 380 writeProgramToText(program,
379 path: outputFile, showExternal: options['show-external']); 381 path: outputFile,
382 showExternal: options['show-external'],
383 showOffsets: options['show-offsets']);
380 break; 384 break;
381 case 'bin': 385 case 'bin':
382 ioFuture = writeProgramToBinary(program, outputFile); 386 ioFuture = writeProgramToBinary(program, outputFile);
383 break; 387 break;
384 } 388 }
385 } 389 }
386 390
387 int time = watch.elapsedMilliseconds; 391 int time = watch.elapsedMilliseconds;
388 if (shouldReportMetrics) { 392 if (shouldReportMetrics) {
389 print('writer.time = $time ms'); 393 print('writer.time = $time ms');
390 } 394 }
391 395
392 await ioFuture; 396 await ioFuture;
393 397
394 if (shouldReportMetrics) { 398 if (shouldReportMetrics) {
395 int flushTime = watch.elapsedMilliseconds - time; 399 int flushTime = watch.elapsedMilliseconds - time;
396 print('writer.flush_time = $flushTime ms'); 400 print('writer.flush_time = $flushTime ms');
397 } 401 }
398 402
399 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok; 403 return errors.length > 0 ? CompilerOutcome.Fail : CompilerOutcome.Ok;
400 } 404 }
OLDNEW
« no previous file with comments | « no previous file | pkg/kernel/lib/analyzer/ast_from_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698