| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 final List<CanonicalName> referencedNames = <CanonicalName>[]; | 58 final List<CanonicalName> referencedNames = <CanonicalName>[]; |
| 59 | 59 |
| 60 defaultMemberReference(Member node) { | 60 defaultMemberReference(Member node) { |
| 61 _handleReferencedName(node.canonicalName); | 61 _handleReferencedName(node.canonicalName); |
| 62 } | 62 } |
| 63 | 63 |
| 64 visitClassReference(Class node) { | 64 visitClassReference(Class node) { |
| 65 _handleReferencedName(node.canonicalName); | 65 _handleReferencedName(node.canonicalName); |
| 66 } | 66 } |
| 67 | 67 |
| 68 visitInterfaceTargetReference(Reference reference) { |
| 69 _handleReferencedName(reference?.canonicalName); |
| 70 } |
| 71 |
| 68 void _handleReferencedName(CanonicalName name) { | 72 void _handleReferencedName(CanonicalName name) { |
| 69 if (name == null || name.parent == null) return; | 73 if (name == null || name.parent == null) return; |
| 70 _handleReferencedName(name.parent); | 74 _handleReferencedName(name.parent); |
| 71 referencedNames.add(name); | 75 referencedNames.add(name); |
| 72 name.index = -1; | 76 name.index = -1; |
| 73 put(name.name); | 77 put(name.name); |
| 74 } | 78 } |
| 75 } | 79 } |
| OLD | NEW |