| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'package:kernel/ast.dart'; | 5 import 'package:kernel/ast.dart'; |
| 6 import 'package:kernel/binary/ast_to_binary.dart'; | 6 import 'package:kernel/binary/ast_to_binary.dart'; |
| 7 | 7 |
| 8 /// Writes libraries that satisfy the [predicate]. | 8 /// Writes libraries that satisfy the [predicate]. |
| 9 /// | 9 /// |
| 10 /// Only the referenced subset of canonical names is indexed and written, | 10 /// Only the referenced subset of canonical names is indexed and written, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 defaultMemberReference(Member node) { | 102 defaultMemberReference(Member node) { |
| 103 _handleReferencedName(node.canonicalName); | 103 _handleReferencedName(node.canonicalName); |
| 104 } | 104 } |
| 105 | 105 |
| 106 @override | 106 @override |
| 107 visitClassReference(Class node) { | 107 visitClassReference(Class node) { |
| 108 _handleReferencedName(node.canonicalName); | 108 _handleReferencedName(node.canonicalName); |
| 109 } | 109 } |
| 110 | 110 |
| 111 @override | 111 @override |
| 112 visitLibrary(Library node) { | |
| 113 for (var reference in node.additionalExports) { | |
| 114 _handleReferencedName(reference.canonicalName); | |
| 115 } | |
| 116 super.visitLibrary(node); | |
| 117 } | |
| 118 | |
| 119 @override | |
| 120 visitLibraryDependency(LibraryDependency node) { | 112 visitLibraryDependency(LibraryDependency node) { |
| 121 _handleReferencedName(node.importedLibraryReference.canonicalName); | 113 _handleReferencedName(node.importedLibraryReference.canonicalName); |
| 122 super.visitLibraryDependency(node); | 114 super.visitLibraryDependency(node); |
| 123 } | 115 } |
| 124 | 116 |
| 125 @override | 117 @override |
| 126 visitMethodInvocation(MethodInvocation node) { | 118 visitMethodInvocation(MethodInvocation node) { |
| 127 _handleReferencedName(node.interfaceTargetReference?.canonicalName); | 119 _handleReferencedName(node.interfaceTargetReference?.canonicalName); |
| 128 return super.visitMethodInvocation(node); | 120 return super.visitMethodInvocation(node); |
| 129 } | 121 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 159 } | 151 } |
| 160 | 152 |
| 161 void _handleReferencedName(CanonicalName name) { | 153 void _handleReferencedName(CanonicalName name) { |
| 162 if (name == null || name.parent == null) return; | 154 if (name == null || name.parent == null) return; |
| 163 _handleReferencedName(name.parent); | 155 _handleReferencedName(name.parent); |
| 164 referencedNames.add(name); | 156 referencedNames.add(name); |
| 165 name.index = -1; | 157 name.index = -1; |
| 166 put(name.name); | 158 put(name.name); |
| 167 } | 159 } |
| 168 } | 160 } |
| OLD | NEW |