| 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'; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 "The method 'visit"], | 33 "The method 'visit"], |
| 34 | 34 |
| 35 // Uncalled type predicate. Keep while related predicates are used. | 35 // Uncalled type predicate. Keep while related predicates are used. |
| 36 "lib/src/ssa/nodes.dart": const [ | 36 "lib/src/ssa/nodes.dart": const [ |
| 37 "The method 'isArray' is never called"], | 37 "The method 'isArray' is never called"], |
| 38 | 38 |
| 39 // Serialization code is only used in test. | 39 // Serialization code is only used in test. |
| 40 "lib/src/serialization/": const [ | 40 "lib/src/serialization/": const [ |
| 41 "is never"], | 41 "is never"], |
| 42 | 42 |
| 43 // Nested functions are currently kept alive in the IR. | |
| 44 "lib/src/tree_ir/": const [ | |
| 45 "accept", "FunctionExpression", "CreateFunction" | |
| 46 ], | |
| 47 | |
| 48 "lib/src/universe/universe.dart": const [ | 43 "lib/src/universe/universe.dart": const [ |
| 49 "The method 'getterInvocationsByName' is never called.", | 44 "The method 'getterInvocationsByName' is never called.", |
| 50 "The method 'setterInvocationsByName' is never called."], | 45 "The method 'setterInvocationsByName' is never called."], |
| 51 | |
| 52 "lib/src/cps_ir/": const [ | |
| 53 "accept", "CreateFunction", | |
| 54 ], | |
| 55 | |
| 56 // Useful utility functions that are not currently used. | |
| 57 "lib/src/cps_ir/cps_fragment.dart": const [ | |
| 58 "The method 'beginLoop' is never called.", | |
| 59 "The method 'continueLoop' is never called.", | |
| 60 "The method 'invokeMethod' is never called.", | |
| 61 ], | |
| 62 }; | 46 }; |
| 63 | 47 |
| 64 void main() { | 48 void main() { |
| 65 var uri = currentDirectory.resolve( | 49 var uri = currentDirectory.resolve( |
| 66 'pkg/compiler/lib/src/use_unused_api.dart'); | 50 'pkg/compiler/lib/src/use_unused_api.dart'); |
| 67 asyncTest(() => analyze( | 51 asyncTest(() => analyze( |
| 68 [uri], | 52 [uri], |
| 69 // TODO(johnniwinther): Use [WHITE_LIST] again when | 53 // TODO(johnniwinther): Use [WHITE_LIST] again when |
| 70 // [Compiler.reportUnusedCode] is reenabled. | 54 // [Compiler.reportUnusedCode] is reenabled. |
| 71 const {}, // WHITE_LIST | 55 const {}, // WHITE_LIST |
| (...skipping 23 matching lines...) Expand all Loading... |
| 95 if (member.isResolved) { | 79 if (member.isResolved) { |
| 96 compiler.reporter.reportHintMessage( | 80 compiler.reporter.reportHintMessage( |
| 97 member, MessageKind.GENERIC, | 81 member, MessageKind.GENERIC, |
| 98 {'text': "Helper typedef in production code '$member'."}); | 82 {'text': "Helper typedef in production code '$member'."}); |
| 99 } | 83 } |
| 100 } | 84 } |
| 101 } | 85 } |
| 102 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); | 86 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); |
| 103 return handler.checkResults(); | 87 return handler.checkResults(); |
| 104 } | 88 } |
| OLD | NEW |