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

Side by Side Diff: tests/compiler/dart2js/related_types.dart

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Cleanup. Created 4 years, 3 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) 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 related_types; 5 library related_types;
6 6
7 import 'package:compiler/src/commandline_options.dart'; 7 import 'package:compiler/src/commandline_options.dart';
8 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
9 import 'package:compiler/src/core_types.dart'; 9 import 'package:compiler/src/core_types.dart';
10 import 'package:compiler/src/dart_types.dart'; 10 import 'package:compiler/src/dart_types.dart';
(...skipping 17 matching lines...) Expand all
28 if (result.isSuccess) { 28 if (result.isSuccess) {
29 checkRelatedTypes(result.compiler); 29 checkRelatedTypes(result.compiler);
30 } 30 }
31 } else { 31 } else {
32 print('Usage dart related_types.dart <entry-point>'); 32 print('Usage dart related_types.dart <entry-point>');
33 } 33 }
34 } 34 }
35 35
36 /// Check all loaded libraries in [compiler] for unrelated types. 36 /// Check all loaded libraries in [compiler] for unrelated types.
37 void checkRelatedTypes(Compiler compiler) { 37 void checkRelatedTypes(Compiler compiler) {
38 compiler.openWorld.closeWorld();
38 for (LibraryElement library in compiler.libraryLoader.libraries) { 39 for (LibraryElement library in compiler.libraryLoader.libraries) {
39 checkLibraryElement(compiler, library); 40 checkLibraryElement(compiler, library);
40 } 41 }
41 } 42 }
42 43
43 /// Check [library] for unrelated types. 44 /// Check [library] for unrelated types.
44 void checkLibraryElement(Compiler compiler, LibraryElement library) { 45 void checkLibraryElement(Compiler compiler, LibraryElement library) {
45 library.forEachLocalMember((Element element) { 46 library.forEachLocalMember((Element element) {
46 if (element.isClass) { 47 if (element.isClass) {
47 ClassElement cls = element; 48 ClassElement cls = element;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 ClassElement findClass(DartType type) => type.accept(this, null); 430 ClassElement findClass(DartType type) => type.accept(this, null);
430 431
431 @override 432 @override
432 ClassElement visitType(DartType type, _) => null; 433 ClassElement visitType(DartType type, _) => null;
433 434
434 @override 435 @override
435 ClassElement visitInterfaceType(InterfaceType type, _) { 436 ClassElement visitInterfaceType(InterfaceType type, _) {
436 return type.element; 437 return type.element;
437 } 438 }
438 } 439 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698