Skip to content

Commit 10daf26

Browse files
committed
[AST] Use CanType in SubstitutionMap
No functionality change---the code was already using canonical types in practice.
1 parent 9b1d8ff commit 10daf26

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/AST/SubstitutionMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SubstitutionMap {
6060

6161
// FIXME: Switch to a more efficient representation that corresponds to
6262
// the conformance requirements in the GenericSignature.
63-
llvm::DenseMap<TypeBase *, SmallVector<ProtocolConformanceRef, 1>>
63+
llvm::DenseMap<CanType, SmallVector<ProtocolConformanceRef, 1>>
6464
conformanceMap;
6565

6666
/// Retrieve the array of replacement types, which line up with the

lib/AST/SubstitutionMap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
178178
// Retrieve the starting conformance from the conformance map.
179179
auto getInitialConformance =
180180
[&](Type type, ProtocolDecl *proto) -> Optional<ProtocolConformanceRef> {
181-
auto known = conformanceMap.find(type->getCanonicalType().getPointer());
181+
auto known = conformanceMap.find(type->getCanonicalType());
182182
if (known == conformanceMap.end())
183183
return None;
184184

@@ -266,7 +266,7 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
266266
void SubstitutionMap::
267267
addConformance(CanType type, ProtocolConformanceRef conformance) {
268268
assert(!isa<ArchetypeType>(type));
269-
conformanceMap[type.getPointer()].push_back(conformance);
269+
conformanceMap[type].push_back(conformance);
270270
}
271271

272272
SubstitutionMap SubstitutionMap::subst(const SubstitutionMap &subMap) const {

0 commit comments

Comments
 (0)