Skip to content

Commit d56cb4a

Browse files
committed
[sil] Change SILType::getOptionalType() to use CanType::wrapInOptionalType() instead of rolling its own.
1 parent ebeb870 commit d56cb4a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/SIL/IR/SILType.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ SILType SILType::getBuiltinWordType(const ASTContext &C) {
8888
}
8989

9090
SILType SILType::getOptionalType(SILType type) {
91-
auto &ctx = type.getASTContext();
92-
auto optType = BoundGenericEnumType::get(ctx.getOptionalDecl(), Type(),
93-
{ type.getASTType() });
94-
return getPrimitiveType(CanType(optType), type.getCategory())
91+
return getPrimitiveType(type.getASTType().wrapInOptionalType(),
92+
type.getCategory())
9593
.copyingMoveOnlyWrapper(type);
9694
}
9795

0 commit comments

Comments
 (0)