[AST] Strengthen signature of SubstututionMap::addSubstitution().

It requires a CanSubstitutableType internally, so use that in the
signature and fix up all of the callers.
This commit is contained in:
Doug Gregor
2017-01-05 16:04:19 -08:00
parent 5d22b926d8
commit 16585992f6
12 changed files with 46 additions and 30 deletions

View File

@@ -645,7 +645,8 @@ bool CSE::processOpenExistentialRef(SILInstruction *Inst, ValueBase *V,
auto OldOpenedArchetype = getOpenedArchetypeOf(Inst);
auto NewOpenedArchetype = getOpenedArchetypeOf(dyn_cast<SILInstruction>(V));
SubstitutionMap TypeSubstMap;
TypeSubstMap.addSubstitution(CanType(OldOpenedArchetype), NewOpenedArchetype);
TypeSubstMap.addSubstitution(CanArchetypeType(OldOpenedArchetype),
NewOpenedArchetype);
// Collect all candidates that may contain opened archetypes
// that need to be replaced.
for (auto Use : Inst->getUses()) {