Skip to content

Commit 9c094c5

Browse files
committed
SIL: Simplify SILCloner::remapRootOpenedType()
1 parent a091425 commit 9c094c5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

include/swift/SIL/SILCloner.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,10 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
254254
assert(archetypeTy->isRoot());
255255

256256
auto sig = Builder.getFunction().getGenericSignature();
257-
auto existentialTy = archetypeTy->getExistentialType()->getCanonicalType();
258-
auto env = GenericEnvironment::forOpenedExistential(
259-
getOpASTType(existentialTy), sig, UUID::fromTime());
260-
auto interfaceTy = OpenedArchetypeType::getSelfInterfaceTypeFromContext(sig, existentialTy->getASTContext());
261-
auto replacementTy =
262-
env->mapTypeIntoContext(interfaceTy)
263-
->template castTo<OpenedArchetypeType>();
257+
auto origExistentialTy = archetypeTy->getExistentialType()
258+
->getCanonicalType();
259+
auto substExistentialTy = getOpASTType(origExistentialTy);
260+
auto replacementTy = OpenedArchetypeType::get(substExistentialTy, sig);
264261
registerOpenedExistentialRemapping(archetypeTy, replacementTy);
265262
}
266263

0 commit comments

Comments
 (0)