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

Side by Side Diff: lib/src/codegen/code_generator.dart

Issue 1401273002: Move DDC to analyzer-based checker (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: rebase Created 5 years, 2 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 | « lib/src/checker/rules.dart ('k') | lib/src/codegen/js_codegen.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 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.code_generator; 5 library dev_compiler.src.codegen.code_generator;
6 6
7 import 'package:analyzer/src/generated/element.dart' 7 import 'package:analyzer/src/generated/element.dart'
8 show CompilationUnitElement, LibraryElement; 8 show CompilationUnitElement, LibraryElement;
9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
11 11
12 import '../compiler.dart' show AbstractCompiler; 12 import '../compiler.dart' show AbstractCompiler;
13 import '../info.dart'; 13 import '../info.dart';
14 import '../utils.dart' show canonicalLibraryName; 14 import '../utils.dart' show canonicalLibraryName;
15 import '../checker/rules.dart'; 15 import '../checker/rules.dart';
16 import '../options.dart' show CodegenOptions; 16 import '../options.dart' show CodegenOptions;
17 17
18 abstract class CodeGenerator { 18 abstract class CodeGenerator {
19 final AbstractCompiler compiler; 19 final AbstractCompiler compiler;
20 final TypeRules rules; 20 final TypeRules rules;
21 final AnalysisContext context; 21 final AnalysisContext context;
22 final CodegenOptions options; 22 final CodegenOptions options;
23 23
24 CodeGenerator(AbstractCompiler compiler) 24 CodeGenerator(AbstractCompiler compiler)
25 : compiler = compiler, 25 : compiler = compiler,
26 rules = compiler.rules, 26 rules = new TypeRules(compiler.context.typeProvider),
27 context = compiler.context, 27 context = compiler.context,
28 options = compiler.options.codegenOptions; 28 options = compiler.options.codegenOptions;
29 29
30 /// Return a hash, if any, that can be used for caching purposes. When two 30 /// Return a hash, if any, that can be used for caching purposes. When two
31 /// invocations to this function return the same hash, the underlying 31 /// invocations to this function return the same hash, the underlying
32 /// code-generator generated the same code. 32 /// code-generator generated the same code.
33 String generateLibrary(LibraryUnit unit); 33 String generateLibrary(LibraryUnit unit);
34 34
35 static List<String> _searchPaths = () { 35 static List<String> _searchPaths = () {
36 // TODO(vsm): Can we remove redundancy with multi_package_resolver logic? 36 // TODO(vsm): Can we remove redundancy with multi_package_resolver logic?
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Not a package. 120 // Not a package.
121 // TODO(leafp) These may need to be adjusted 121 // TODO(leafp) These may need to be adjusted
122 // relative to the import location 122 // relative to the import location
123 return new Uri(path: suffix); 123 return new Uri(path: suffix);
124 } 124 }
125 assert(index == 0); 125 assert(index == 0);
126 return new Uri( 126 return new Uri(
127 scheme: 'package', path: path.joinAll(parts.sublist(index + 1))); 127 scheme: 'package', path: path.joinAll(parts.sublist(index + 1)));
128 } 128 }
129 } 129 }
OLDNEW
« no previous file with comments | « lib/src/checker/rules.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698