Skip to content

Commit 204276c

Browse files
committed
Sema: Remove unused TypeResolution::Resolver variable
1 parent cdcb8e4 commit 204276c

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,8 +3808,7 @@ static void validateResultType(ValueDecl *decl,
38083808
: ErrorType::get(decl->getASTContext()));
38093809
} else {
38103810
auto *dc = decl->getInnermostDeclContext();
3811-
auto resolution = TypeResolution::forInterface(
3812-
dc, dc->getGenericSignatureOfContext());
3811+
auto resolution = TypeResolution::forInterface(dc);
38133812
TypeChecker::validateType(dc->getASTContext(),
38143813
resultTyLoc, resolution,
38153814
TypeResolverContext::FunctionResult);
@@ -4074,8 +4073,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
40744073

40754074
// We want the function to be available for name lookup as soon
40764075
// as it has a valid interface type.
4077-
auto resolution = TypeResolution::forInterface(FD,
4078-
FD->getGenericSignature());
4076+
auto resolution = TypeResolution::forInterface(FD);
40794077
typeCheckParameterList(FD->getParameters(), resolution,
40804078
TypeResolverContext::AbstractFunctionDecl);
40814079
validateResultType(FD, FD->getBodyResultTypeLoc());
@@ -4114,7 +4112,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
41144112

41154113
DeclValidationRAII IBV(CD);
41164114

4117-
auto res = TypeResolution::forInterface(CD, CD->getGenericSignature());
4115+
auto res = TypeResolution::forInterface(CD);
41184116
typeCheckParameterList(CD->getParameters(), res,
41194117
TypeResolverContext::AbstractFunctionDecl);
41204118
CD->computeType();
@@ -4126,7 +4124,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
41264124

41274125
DeclValidationRAII IBV(DD);
41284126

4129-
auto res = TypeResolution::forInterface(DD, DD->getGenericSignature());
4127+
auto res = TypeResolution::forInterface(DD);
41304128
typeCheckParameterList(DD->getParameters(), res,
41314129
TypeResolverContext::AbstractFunctionDecl);
41324130
DD->computeType();
@@ -4138,7 +4136,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
41384136

41394137
DeclValidationRAII IBV(SD);
41404138

4141-
auto res = TypeResolution::forInterface(SD, SD->getGenericSignature());
4139+
auto res = TypeResolution::forInterface(SD);
41424140
typeCheckParameterList(SD->getIndices(), res,
41434141
TypeResolverContext::SubscriptDecl);
41444142
validateResultType(SD, SD->getElementTypeLoc());
@@ -4154,7 +4152,7 @@ void TypeChecker::validateDecl(ValueDecl *D) {
41544152
DeclValidationRAII IBV(EED);
41554153

41564154
if (auto *PL = EED->getParameterList()) {
4157-
auto res = TypeResolution::forInterface(ED, ED->getGenericSignature());
4155+
auto res = TypeResolution::forInterface(ED);
41584156
typeCheckParameterList(PL, res,
41594157
TypeResolverContext::EnumElementDecl);
41604158
}

lib/Sema/TypeCheckType.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,13 @@ TypeResolution TypeResolution::forStructural(DeclContext *dc) {
5858
return TypeResolution(dc, TypeResolutionStage::Structural);
5959
}
6060

61-
TypeResolution TypeResolution::forInterface(DeclContext *dc,
62-
LazyResolver *resolver) {
63-
return forInterface(dc, dc->getGenericSignatureOfContext(), resolver);
61+
TypeResolution TypeResolution::forInterface(DeclContext *dc) {
62+
return forInterface(dc, dc->getGenericSignatureOfContext());
6463
}
6564

6665
TypeResolution TypeResolution::forInterface(DeclContext *dc,
67-
GenericSignature genericSig,
68-
LazyResolver *resolver) {
66+
GenericSignature genericSig) {
6967
TypeResolution result(dc, TypeResolutionStage::Interface);
70-
result.Resolver = resolver;
7168
result.complete.genericSig = genericSig;
7269
result.complete.builder = nullptr;
7370
return result;

lib/Sema/TypeCheckType.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,23 +295,19 @@ class TypeResolution {
295295
GenericSignatureBuilder *getGenericSignatureBuilder() const;
296296

297297
public:
298-
LazyResolver *Resolver = nullptr;
299-
300298
/// Form a type resolution for the structure of a type, which does not
301299
/// attempt to resolve member types of type parameters to a particular
302300
/// associated type.
303301
static TypeResolution forStructural(DeclContext *dc);
304302

305303
/// Form a type resolution for an interface type, which is a complete
306304
/// description of the type using generic parameters.
307-
static TypeResolution forInterface(DeclContext *dc,
308-
LazyResolver *resolver = nullptr);
305+
static TypeResolution forInterface(DeclContext *dc);
309306

310307
/// Form a type resolution for an interface type, which is a complete
311308
/// description of the type using generic parameters.
312309
static TypeResolution forInterface(DeclContext *dc,
313-
GenericSignature genericSig,
314-
LazyResolver *resolver = nullptr);
310+
GenericSignature genericSig);
315311

316312
/// Form a type resolution for a contextual type, which is a complete
317313
/// description of the type using the archetypes of the given declaration

0 commit comments

Comments
 (0)