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

Side by Side Diff: pkg/compiler/lib/src/kernel/task.dart

Issue 2932883002: Add FrontendStrategy.commonElements and remove Backend.commonElements (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../common/names.dart'; 5 import '../common/names.dart';
6 import '../common/tasks.dart' show CompilerTask; 6 import '../common/tasks.dart' show CompilerTask;
7 import '../compiler.dart'; 7 import '../compiler.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import 'kernel.dart'; 9 import 'kernel.dart';
10 import 'package:kernel/ast.dart' as ir; 10 import 'package:kernel/ast.dart' as ir;
(...skipping 21 matching lines...) Expand all
32 program = buildProgram(_compiler.mainApp); 32 program = buildProgram(_compiler.mainApp);
33 }); 33 });
34 34
35 /// Builds the kernel IR program for the main function exported from 35 /// Builds the kernel IR program for the main function exported from
36 /// [library]. 36 /// [library].
37 /// 37 ///
38 /// May enqueue more elements to the resolution queue. 38 /// May enqueue more elements to the resolution queue.
39 ir.Program buildProgram(LibraryElement library) { 39 ir.Program buildProgram(LibraryElement library) {
40 var main = library.findExported(Identifiers.main); 40 var main = library.findExported(Identifiers.main);
41 if (main == null) { 41 if (main == null) {
42 main = _compiler.backend.helperForMissingMain(); 42 main = _compiler.frontendStrategy.commonElements.missingMain;
43 } 43 }
44 return new ir.Program( 44 return new ir.Program(
45 libraries: kernel.libraryDependencies(library.canonicalUri)) 45 libraries: kernel.libraryDependencies(library.canonicalUri))
46 ..mainMethod = kernel.functionToIr(main); 46 ..mainMethod = kernel.functionToIr(main);
47 } 47 }
48 } 48 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_strategy.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698