OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 analyze_unused_dart2js; | 5 library analyze_unused_dart2js; |
6 | 6 |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 | 8 |
9 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
10 import 'package:compiler/src/diagnostics/messages.dart'; | 10 import 'package:compiler/src/diagnostics/messages.dart'; |
11 import 'package:compiler/src/filenames.dart'; | 11 import 'package:compiler/src/filenames.dart'; |
12 | 12 |
13 import 'analyze_helper.dart'; | 13 import 'analyze_helper.dart'; |
14 | 14 |
15 // Do not remove WHITE_LIST even if it's empty. The error message for | 15 // Do not remove WHITE_LIST even if it's empty. The error message for |
16 // unused members refers to WHITE_LIST by name. | 16 // unused members refers to WHITE_LIST by name. |
17 const Map<String, List<String>> WHITE_LIST = const { | 17 const Map<String, List<String>> WHITE_LIST = const { |
18 // Helper methods for debugging should never be called from production code: | 18 // Helper methods for debugging should never be called from production code: |
19 "lib/src/helpers/": const [" is never "], | 19 "lib/src/helpers/": const [" is never "], |
20 | 20 |
21 // Node.asAssert, Node.asLiteralBool is never used. | 21 // Node.asAssert, Node.asLiteralBool is never used. |
22 "lib/src/tree/nodes.dart": const [ | 22 "lib/src/tree/nodes.dart": const [ |
23 "The method 'asAssert' is never called.", | 23 "The method 'asAssert' is never called.", |
24 "The method 'asLiteralBool' is never called."], | 24 "The method 'asLiteralBool' is never called."], |
25 | 25 |
26 // Some things in dart_printer are not yet used | |
27 "lib/src/dart_backend/backend_ast_nodes.dart": const [" is never "], | |
28 | |
29 // Uncalled methods in SemanticSendVisitor and subclasses. | 26 // Uncalled methods in SemanticSendVisitor and subclasses. |
30 "lib/src/resolution/semantic_visitor.dart": const [ | 27 "lib/src/resolution/semantic_visitor.dart": const [ |
31 "The method 'error"], | 28 "The method 'error"], |
32 "lib/src/resolution/semantic_visitor_mixins.dart": const [ | 29 "lib/src/resolution/semantic_visitor_mixins.dart": const [ |
33 "The class 'SuperBulkMixin'", | 30 "The class 'SuperBulkMixin'", |
34 "The class 'Base", | 31 "The class 'Base", |
35 "The method 'error", | 32 "The method 'error", |
36 "The method 'visit"], | 33 "The method 'visit"], |
37 | 34 |
38 // Uncalled type predicate. Keep while related predicates are used. | 35 // Uncalled type predicate. Keep while related predicates are used. |
(...skipping 10 matching lines...) Expand all Loading... |
49 ], | 46 ], |
50 | 47 |
51 "lib/src/universe/universe.dart": const [ | 48 "lib/src/universe/universe.dart": const [ |
52 "The method 'getterInvocationsByName' is never called.", | 49 "The method 'getterInvocationsByName' is never called.", |
53 "The method 'setterInvocationsByName' is never called."], | 50 "The method 'setterInvocationsByName' is never called."], |
54 | 51 |
55 "lib/src/cps_ir/": const [ | 52 "lib/src/cps_ir/": const [ |
56 "accept", "CreateFunction", | 53 "accept", "CreateFunction", |
57 ], | 54 ], |
58 | 55 |
59 "lib/src/dart_backend/backend_ast_to_frontend_ast.dart": const [ | |
60 " is never " | |
61 ], | |
62 | |
63 // Useful utility functions that are not currently used. | 56 // Useful utility functions that are not currently used. |
64 "lib/src/cps_ir/cps_fragment.dart": const [ | 57 "lib/src/cps_ir/cps_fragment.dart": const [ |
65 "The method 'beginLoop' is never called.", | 58 "The method 'beginLoop' is never called.", |
66 "The method 'continueLoop' is never called.", | 59 "The method 'continueLoop' is never called.", |
67 "The method 'invokeMethod' is never called.", | 60 "The method 'invokeMethod' is never called.", |
68 ], | 61 ], |
69 }; | 62 }; |
70 | 63 |
71 void main() { | 64 void main() { |
72 var uri = currentDirectory.resolve( | 65 var uri = currentDirectory.resolve( |
(...skipping 29 matching lines...) Expand all Loading... |
102 if (member.isResolved) { | 95 if (member.isResolved) { |
103 compiler.reporter.reportHintMessage( | 96 compiler.reporter.reportHintMessage( |
104 member, MessageKind.GENERIC, | 97 member, MessageKind.GENERIC, |
105 {'text': "Helper typedef in production code '$member'."}); | 98 {'text': "Helper typedef in production code '$member'."}); |
106 } | 99 } |
107 } | 100 } |
108 } | 101 } |
109 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); | 102 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); |
110 return handler.checkResults(); | 103 return handler.checkResults(); |
111 } | 104 } |
OLD | NEW |