SILCloner: Redo local archetype remapping

This commit is contained in:
Slava Pestov
2024-08-21 13:25:45 -04:00
parent e9b6f0b82d
commit 63028be348
3 changed files with 64 additions and 59 deletions

View File

@@ -908,7 +908,8 @@ bool CSE::processOpenExistentialRef(OpenExistentialRefInst *Inst,
// opened archetypes trivial.
InstructionCloner Cloner(Inst->getFunction());
Cloner.registerLocalArchetypeRemapping(
OldOpenedArchetype->castTo<ArchetypeType>(), NewOpenedArchetype);
OldOpenedArchetype->getGenericEnvironment(),
NewOpenedArchetype->getGenericEnvironment());
auto &Builder = Cloner.getBuilder();
// Now clone each candidate and replace the opened archetype