Skip to content

Commit b0f59dc

Browse files
committed
SIL: Remove uses of AbstractFunctionDecl::getParameterLists()
1 parent fd8a7b8 commit b0f59dc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/SIL/SILDeclRef.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ SILDeclRef::SILDeclRef(SILDeclRef::Loc baseLoc,
145145
} else if (auto *ACE = baseLoc.dyn_cast<AbstractClosureExpr *>()) {
146146
loc = ACE;
147147
kind = Kind::Func;
148-
assert(ACE->getParameterLists().size() >= 1 &&
149-
"no param patterns for function?!");
150148
} else {
151149
llvm_unreachable("impossible SILDeclRef loc");
152150
}
@@ -810,7 +808,7 @@ unsigned SILDeclRef::getParameterListCount() const {
810808
auto *vd = getDecl();
811809

812810
if (auto *func = dyn_cast<AbstractFunctionDecl>(vd)) {
813-
return func->getParameterLists().size();
811+
return func->getImplicitSelfDecl() ? 2 : 1;
814812
} else if (auto *ed = dyn_cast<EnumElementDecl>(vd)) {
815813
return ed->hasAssociatedValues() ? 2 : 1;
816814
} else if (isa<ClassDecl>(vd)) {

0 commit comments

Comments
 (0)