Skip to content

Commit 96c6c2e

Browse files
committed
SIL: Remove unused parameters from getUncachedSILFunctionTypeForConstant(), NFC
1 parent 3eb6581 commit 96c6c2e

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

lib/SIL/SILFunctionType.cpp

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,32 +1370,18 @@ getSILFunctionTypeForSelectorFamily(SILModule &M, SelectorFamily family,
13701370

13711371
static CanSILFunctionType
13721372
getUncachedSILFunctionTypeForConstant(SILModule &M, SILDeclRef constant,
1373-
CanAnyFunctionType origLoweredType,
1374-
CanAnyFunctionType origLoweredInterfaceType,
1375-
CanAnyFunctionType substFormalType,
1376-
CanAnyFunctionType substInterfaceType) {
1377-
assert(origLoweredType->getExtInfo().getSILRepresentation()
1373+
CanAnyFunctionType origLoweredInterfaceType) {
1374+
assert(origLoweredInterfaceType->getExtInfo().getSILRepresentation()
13781375
!= SILFunctionTypeRepresentation::Thick
1379-
&& origLoweredType->getExtInfo().getSILRepresentation()
1376+
&& origLoweredInterfaceType->getExtInfo().getSILRepresentation()
13801377
!= SILFunctionTypeRepresentation::Block);
13811378

1382-
auto extInfo = origLoweredType->getExtInfo();
1383-
1384-
CanAnyFunctionType substLoweredInterfaceType;
1385-
if (substInterfaceType) {
1386-
substLoweredInterfaceType
1387-
= M.Types.getLoweredASTFunctionType(substInterfaceType,
1388-
constant.uncurryLevel,
1389-
extInfo,
1390-
constant);
1391-
} else {
1392-
substLoweredInterfaceType = origLoweredInterfaceType;
1393-
}
1379+
auto extInfo = origLoweredInterfaceType->getExtInfo();
13941380

13951381
if (!constant.isForeign) {
13961382
return getNativeSILFunctionType(M,
13971383
AbstractionPattern(origLoweredInterfaceType),
1398-
substLoweredInterfaceType,
1384+
origLoweredInterfaceType,
13991385
extInfo,
14001386
constant,
14011387
constant.kind);
@@ -1413,16 +1399,16 @@ getUncachedSILFunctionTypeForConstant(SILModule &M, SILDeclRef constant,
14131399

14141400
if (auto clangDecl = findClangMethod(decl))
14151401
return getSILFunctionTypeForClangDecl(M, clangDecl,
1416-
origLoweredType,
1417-
substLoweredInterfaceType,
1402+
origLoweredInterfaceType,
1403+
origLoweredInterfaceType,
14181404
extInfo, foreignError);
14191405
}
14201406

14211407
// If the decl belongs to an ObjC method family, use that family's
14221408
// ownership conventions.
14231409
return getSILFunctionTypeForSelectorFamily(M, getSelectorFamily(constant),
1424-
origLoweredType,
1425-
substLoweredInterfaceType,
1410+
origLoweredInterfaceType,
1411+
origLoweredInterfaceType,
14261412
extInfo, foreignError);
14271413
}
14281414

@@ -1511,10 +1497,8 @@ SILConstantInfo TypeConverter::getConstantInfo(SILDeclRef constant) {
15111497

15121498
// The SIL type encodes conventions according to the original type.
15131499
CanSILFunctionType silFnType =
1514-
getUncachedSILFunctionTypeForConstant(M, constant, loweredType,
1515-
loweredInterfaceType,
1516-
CanAnyFunctionType(),
1517-
CanAnyFunctionType());
1500+
getUncachedSILFunctionTypeForConstant(M, constant,
1501+
loweredInterfaceType);
15181502

15191503
DEBUG(llvm::dbgs() << "lowering type for constant ";
15201504
constant.print(llvm::dbgs());

0 commit comments

Comments
 (0)