Skip to content

Commit ba34ee1

Browse files
committed
Sema: Pass TypeResolution around by const reference since it's large
1 parent e3de3da commit ba34ee1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,8 @@ void swift::diagnoseInvalidGenericArguments(SourceLoc loc,
735735
/// error.
736736
///
737737
/// \see TypeResolution::applyUnboundGenericArguments
738-
static Type applyGenericArguments(Type type, TypeResolution resolution,
738+
static Type applyGenericArguments(Type type,
739+
const TypeResolution &resolution,
739740
SILTypeResolutionContext *silContext,
740741
DeclRefTypeRepr *repr) {
741742
auto options = resolution.getOptions();
@@ -1249,7 +1250,7 @@ static void maybeDiagnoseBadConformanceRef(DeclContext *dc,
12491250

12501251
/// Returns a valid type or ErrorType in case of an error.
12511252
static Type resolveTypeDecl(TypeDecl *typeDecl, DeclContext *foundDC,
1252-
TypeResolution resolution,
1253+
const TypeResolution &resolution,
12531254
SILTypeResolutionContext *silContext,
12541255
UnqualifiedIdentTypeRepr *repr) {
12551256
// Resolve the type declaration to a specific type. How this occurs
@@ -1306,7 +1307,7 @@ static std::string getDeclNameFromContext(DeclContext *dc,
13061307
///
13071308
/// \returns either the corrected type, if possible, or an error type to
13081309
/// that correction failed.
1309-
static Type diagnoseUnknownType(TypeResolution resolution,
1310+
static Type diagnoseUnknownType(const TypeResolution &resolution,
13101311
Type parentType,
13111312
SourceRange parentRange,
13121313
DeclRefTypeRepr *repr,
@@ -1570,7 +1571,7 @@ static SelfTypeKind getSelfTypeKind(DeclContext *dc,
15701571
}
15711572
}
15721573

1573-
static void diagnoseGenericArgumentsOnSelf(TypeResolution resolution,
1574+
static void diagnoseGenericArgumentsOnSelf(const TypeResolution &resolution,
15741575
UnqualifiedIdentTypeRepr *repr,
15751576
DeclContext *typeDC) {
15761577
ASTContext &ctx = resolution.getASTContext();
@@ -1597,7 +1598,7 @@ static void diagnoseGenericArgumentsOnSelf(TypeResolution resolution,
15971598
/// \returns Either the resolved type or a null type, the latter of
15981599
/// which indicates that some dependencies were unsatisfied.
15991600
static Type
1600-
resolveUnqualifiedIdentTypeRepr(TypeResolution resolution,
1601+
resolveUnqualifiedIdentTypeRepr(const TypeResolution &resolution,
16011602
SILTypeResolutionContext *silContext,
16021603
UnqualifiedIdentTypeRepr *repr) {
16031604
const auto options = resolution.getOptions();
@@ -1773,7 +1774,7 @@ static void diagnoseAmbiguousMemberType(Type baseTy, SourceRange baseRange,
17731774
/// lookup within the given parent type, returning the type it
17741775
/// references.
17751776
/// \param silContext Used to look up generic parameters in SIL mode.
1776-
static Type resolveQualifiedIdentTypeRepr(TypeResolution resolution,
1777+
static Type resolveQualifiedIdentTypeRepr(const TypeResolution &resolution,
17771778
SILTypeResolutionContext *silContext,
17781779
Type parentTy,
17791780
QualifiedIdentTypeRepr *repr) {

0 commit comments

Comments
 (0)