Skip to content

Commit d7b005f

Browse files
committed
[NFC] Drop unused parameter from applyNonEscaping
Rename it while we're here.
1 parent 1901f81 commit d7b005f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,8 +1578,7 @@ static bool diagnoseAvailability(IdentTypeRepr *IdType,
15781578
}
15791579

15801580
// Hack to apply context-specific @escaping to an AST function type.
1581-
static Type applyNonEscapingFromContext(DeclContext *DC,
1582-
Type ty,
1581+
static Type applyNonEscapingIfNecessary(Type ty,
15831582
TypeResolutionOptions options) {
15841583
// Remember whether this is a function parameter.
15851584
bool defaultNoEscape = options.is(TypeResolverContext::FunctionInput) &&
@@ -1890,7 +1889,7 @@ NeverNullType TypeResolver::resolveType(TypeRepr *repr,
18901889
auto result =
18911890
resolveASTFunctionType(cast<FunctionTypeRepr>(repr), options);
18921891
if (result && result->is<FunctionType>())
1893-
return applyNonEscapingFromContext(getDeclContext(), result, options);
1892+
return applyNonEscapingIfNecessary(result, options);
18941893
return result;
18951894
}
18961895
return resolveSILFunctionType(cast<FunctionTypeRepr>(repr), options);
@@ -2343,7 +2342,7 @@ Type TypeResolver::resolveAttributedType(TypeAttributes &attrs,
23432342
attrs.clearAttribute(TAK_escaping);
23442343
} else {
23452344
// No attribute; set the isNoEscape bit if we're in parameter context.
2346-
ty = applyNonEscapingFromContext(getDeclContext(), ty, options);
2345+
ty = applyNonEscapingIfNecessary(ty, options);
23472346
}
23482347
}
23492348

@@ -3254,7 +3253,7 @@ Type TypeResolver::resolveIdentifierType(IdentTypeRepr *IdType,
32543253
// Hack to apply context-specific @escaping to a typealias with an underlying
32553254
// function type.
32563255
if (result->is<FunctionType>())
3257-
result = applyNonEscapingFromContext(getDeclContext(), result, options);
3256+
result = applyNonEscapingIfNecessary(result, options);
32583257

32593258
// Check the availability of the type.
32603259

0 commit comments

Comments
 (0)