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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart

Issue 11828043: Extend compiler API to support multiple outputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library leg_apiimpl; 5 library leg_apiimpl;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import '../compiler.dart' as api; 10 import '../compiler.dart' as api;
11 import 'dart2jslib.dart' as leg; 11 import 'dart2jslib.dart' as leg;
12 import 'tree/tree.dart' as tree; 12 import 'tree/tree.dart' as tree;
13 import 'elements/elements.dart' as elements; 13 import 'elements/elements.dart' as elements;
14 import 'ssa/tracer.dart' as ssa; 14 import 'ssa/tracer.dart' as ssa;
15 import '../../libraries.dart'; 15 import '../../libraries.dart';
16 import 'source_file.dart'; 16 import 'source_file.dart';
17 17
18 class Compiler extends leg.Compiler { 18 class Compiler extends leg.Compiler {
19 api.ReadStringFromUri provider; 19 api.ReadStringFromUri provider;
20 api.DiagnosticHandler handler; 20 api.DiagnosticHandler handler;
21 final Uri libraryRoot; 21 final Uri libraryRoot;
22 final Uri packageRoot; 22 final Uri packageRoot;
23 List<String> options; 23 List<String> options;
24 bool mockableLibraryUsed = false; 24 bool mockableLibraryUsed = false;
25 25
26 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, 26 Compiler(this.provider,
27 api.CompilerOutputProvider outputProvider,
28 this.handler,
29 this.libraryRoot,
30 this.packageRoot,
27 List<String> options) 31 List<String> options)
28 : this.options = options, 32 : this.options = options,
29 super( 33 super(
30 tracer: new ssa.HTracer(), 34 tracer: new ssa.HTracer(),
35 outputProvider: outputProvider,
31 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), 36 enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
32 enableUserAssertions: hasOption(options, '--enable-checked-mode'), 37 enableUserAssertions: hasOption(options, '--enable-checked-mode'),
33 enableMinification: hasOption(options, '--minify'), 38 enableMinification: hasOption(options, '--minify'),
34 enableNativeLiveTypeAnalysis: 39 enableNativeLiveTypeAnalysis:
35 !hasOption(options, '--disable-native-live-type-analysis'), 40 !hasOption(options, '--disable-native-live-type-analysis'),
36 emitJavaScript: !hasOption(options, '--output-type=dart'), 41 emitJavaScript: !hasOption(options, '--output-type=dart'),
37 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'), 42 disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'),
38 analyzeAll: hasOption(options, '--analyze-all'), 43 analyzeAll: hasOption(options, '--analyze-all'),
39 rejectDeprecatedFeatures: 44 rejectDeprecatedFeatures:
40 hasOption(options, '--reject-deprecated-language-features'), 45 hasOption(options, '--reject-deprecated-language-features'),
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 handler(translateUri(span.uri, null), span.begin, span.end, 190 handler(translateUri(span.uri, null), span.begin, span.end,
186 message, kind); 191 message, kind);
187 } 192 }
188 } 193 }
189 194
190 bool get isMockCompilation { 195 bool get isMockCompilation {
191 return mockableLibraryUsed 196 return mockableLibraryUsed
192 && (options.indexOf('--allow-mock-compilation') != -1); 197 && (options.indexOf('--allow-mock-compilation') != -1);
193 } 198 }
194 } 199 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698