@@ -1426,20 +1426,18 @@ static void convertBBArgType(SILBuilder &argBuilder, SILType newSILType,
1426
1426
}
1427
1427
}
1428
1428
1429
- static bool containsFunctionType (SILType ty) {
1430
- if (auto tuple = ty.getAs <TupleType>()) {
1431
- for (TupleTypeElt elem : tuple->getElements ()) {
1432
- auto canElem = CanType (elem.getRawType ());
1433
- auto elemTy = SILType::getPrimitiveObjectType (canElem);
1434
- if (containsFunctionType (elemTy))
1429
+ static bool containsFunctionType (CanType ty) {
1430
+ if (auto tuple = dyn_cast<TupleType>(ty)) {
1431
+ for (auto elt : tuple.getElementTypes ()) {
1432
+ if (containsFunctionType (elt))
1435
1433
return true ;
1436
1434
}
1437
1435
return false ;
1438
1436
}
1439
1437
if (auto optionalType = ty.getOptionalObjectType ()) {
1440
1438
return containsFunctionType (optionalType);
1441
1439
}
1442
- return ty. is <SILFunctionType>();
1440
+ return isa <SILFunctionType>(ty );
1443
1441
}
1444
1442
1445
1443
void LoadableStorageAllocation::convertApplyResults () {
@@ -1466,7 +1464,7 @@ void LoadableStorageAllocation::convertApplyResults() {
1466
1464
auto numFuncTy = llvm::count_if (origSILFunctionType->getResults (),
1467
1465
[](const SILResultInfo &origResult) {
1468
1466
auto resultStorageTy = origResult.getSILStorageType ();
1469
- return containsFunctionType (resultStorageTy);
1467
+ return containsFunctionType (resultStorageTy. getASTType () );
1470
1468
});
1471
1469
assert (numFuncTy != 0 &&
1472
1470
" Expected a SILFunctionType inside the result Type" );
0 commit comments