Skip to content

Commit aae1252

Browse files
committed
SIL: Simplify some code in SIL verifier now that optional payloads are lowered
1 parent 0834925 commit aae1252

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,6 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
234234
// TODO: We should compare generic signatures. Class and witness methods
235235
// allow variance in "self"-fulfilled parameters; other functions must
236236
// match exactly.
237-
auto signature1 = type1->getGenericSignature();
238-
auto signature2 = type2->getGenericSignature();
239-
240-
auto getAnyOptionalObjectTypeInContext = [&](CanGenericSignature sig,
241-
SILType type) {
242-
Lowering::GenericContextScope context(F.getModule().Types, sig);
243-
return type.getAnyOptionalObjectType();
244-
};
245237

246238
// TODO: More sophisticated param and return ABI compatibility rules could
247239
// diverge.
@@ -295,8 +287,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
295287
continue;
296288

297289
// Optional and IUO are interchangeable if their elements are.
298-
auto aObject = getAnyOptionalObjectTypeInContext(signature1, aa);
299-
auto bObject = getAnyOptionalObjectTypeInContext(signature2, bb);
290+
auto aObject = aa.getAnyOptionalObjectType();
291+
auto bObject = bb.getAnyOptionalObjectType();
300292
if (aObject && bObject
301293
&& areABICompatibleParamsOrReturns(aObject, bObject))
302294
continue;

0 commit comments

Comments
 (0)