Skip to content

Commit 7eafe07

Browse files
committed
NFC: Remove unused locator param from coerceImpicitlyUnwrappedOptionalToValue.
1 parent 7ffb1a4 commit 7eafe07

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

lib/Sema/CSApply.cpp

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,7 @@ namespace {
424424
/// \brief Coerce an expression of implicitly unwrapped optional type to its
425425
/// underlying value type, in the correct way for an implicit
426426
/// look-through.
427-
Expr *coerceImplicitlyUnwrappedOptionalToValue(Expr *expr, Type objTy,
428-
ConstraintLocatorBuilder locator);
427+
Expr *coerceImplicitlyUnwrappedOptionalToValue(Expr *expr, Type objTy);
429428

430429
/// \brief Build a collection upcast expression.
431430
///
@@ -814,7 +813,7 @@ namespace {
814813
// through ImplicitlyUnwrappedOptional<T>.
815814
if (!Implicit) {
816815
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)) {
817-
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy, locator);
816+
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy);
818817
baseTy = objTy;
819818
}
820819
}
@@ -1331,7 +1330,7 @@ namespace {
13311330
if (auto pathTy = cs.lookThroughImplicitlyUnwrappedOptionalType(keyPathExprTy)) {
13321331
keyPathExprTy = pathTy;
13331332
indexKP = coerceImplicitlyUnwrappedOptionalToValue(
1334-
indexKP, keyPathExprTy, locator);
1333+
indexKP, keyPathExprTy);
13351334
}
13361335

13371336
Type valueTy;
@@ -1416,7 +1415,7 @@ namespace {
14161415

14171416
// Handle accesses that implicitly look through ImplicitlyUnwrappedOptional<T>.
14181417
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)) {
1419-
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy, locator);
1418+
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy);
14201419
baseTy = cs.getType(base);
14211420
}
14221421

@@ -2568,8 +2567,7 @@ namespace {
25682567
// Look through an implicitly unwrapped optional.
25692568
auto baseTy = cs.getType(base);
25702569
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)){
2571-
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy,
2572-
cs.getConstraintLocator(base));
2570+
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy);
25732571
baseTy = objTy;
25742572
}
25752573

@@ -2617,8 +2615,7 @@ namespace {
26172615
case OverloadChoiceKind::TupleIndex: {
26182616
auto baseTy = cs.getType(base)->getRValueType();
26192617
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)){
2620-
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy,
2621-
cs.getConstraintLocator(base));
2618+
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy);
26222619
}
26232620

26242621
Type toType = simplifyType(cs.getType(expr));
@@ -2874,8 +2871,7 @@ namespace {
28742871
auto base = expr->getBase();
28752872
auto baseTy = cs.getType(base)->getRValueType();
28762873
if (auto objTy = cs.lookThroughImplicitlyUnwrappedOptionalType(baseTy)) {
2877-
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy,
2878-
cs.getConstraintLocator(base));
2874+
base = coerceImplicitlyUnwrappedOptionalToValue(base, objTy);
28792875
expr->setBase(base);
28802876
}
28812877

@@ -5105,7 +5101,7 @@ Expr *ExprRewriter::coerceExistential(Expr *expr, Type toType,
51055101
// FIXME: Hack. We shouldn't try to coerce existential when there is no
51065102
// existential upcast to perform.
51075103
if (ty->isEqual(toType)) {
5108-
return coerceImplicitlyUnwrappedOptionalToValue(expr, ty, locator);
5104+
return coerceImplicitlyUnwrappedOptionalToValue(expr, ty);
51095105
}
51105106
}
51115107

@@ -5251,8 +5247,7 @@ Expr *ExprRewriter::coerceOptionalToOptional(Expr *expr, Type toType,
52515247
return expr;
52525248
}
52535249

5254-
Expr *ExprRewriter::coerceImplicitlyUnwrappedOptionalToValue(Expr *expr, Type objTy,
5255-
ConstraintLocatorBuilder locator) {
5250+
Expr *ExprRewriter::coerceImplicitlyUnwrappedOptionalToValue(Expr *expr, Type objTy) {
52565251
auto optTy = cs.getType(expr);
52575252
// Coerce to an r-value.
52585253
if (optTy->is<LValueType>())
@@ -6086,14 +6081,14 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
60866081
case ConversionRestrictionKind::ForceUnchecked: {
60876082
auto valueTy = fromType->getImplicitlyUnwrappedOptionalObjectType();
60886083
assert(valueTy);
6089-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, valueTy, locator);
6084+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, valueTy);
60906085
return coerceToType(expr, toType, locator);
60916086
}
60926087

60936088
case ConversionRestrictionKind::ArrayUpcast: {
60946089
// Look through implicitly unwrapped optionals.
60956090
if (auto objTy= cs.lookThroughImplicitlyUnwrappedOptionalType(fromType)) {
6096-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy, locator);
6091+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy);
60976092
}
60986093

60996094
// Build the value conversion.
@@ -6105,7 +6100,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
61056100
// Look through implicitly unwrapped optionals.
61066101
if (auto objTy
61076102
= cs.lookThroughImplicitlyUnwrappedOptionalType(cs.getType(expr))) {
6108-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy, locator);
6103+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy);
61096104
}
61106105

61116106
// We want to check conformance on the rvalue, as that's what has
@@ -6129,7 +6124,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
61296124
// Look through implicitly unwrapped optionals.
61306125
if (auto objTy
61316126
= cs.lookThroughImplicitlyUnwrappedOptionalType(cs.getType(expr))) {
6132-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy, locator);
6127+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy);
61336128
}
61346129

61356130
// Build the value conversion.
@@ -6141,7 +6136,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
61416136
// Look through implicitly unwrapped optionals.
61426137
if (auto objTy
61436138
= cs.lookThroughImplicitlyUnwrappedOptionalType(cs.getType(expr))) {
6144-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy, locator);
6139+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, objTy);
61456140
}
61466141

61476142
// Build the value conversion.
@@ -6410,7 +6405,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
64106405

64116406
// Look through ImplicitlyUnwrappedOptional<T> before coercing expression.
64126407
if (auto ty = cs.lookThroughImplicitlyUnwrappedOptionalType(fromType)) {
6413-
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, ty, locator);
6408+
expr = coerceImplicitlyUnwrappedOptionalToValue(expr, ty);
64146409
return coerceToType(expr, toType, locator);
64156410
}
64166411

@@ -7028,7 +7023,7 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
70287023

70297024
// Handle applications that look through ImplicitlyUnwrappedOptional<T>.
70307025
if (auto fnTy = cs.lookThroughImplicitlyUnwrappedOptionalType(cs.getType(fn)))
7031-
fn = coerceImplicitlyUnwrappedOptionalToValue(fn, fnTy, locator);
7026+
fn = coerceImplicitlyUnwrappedOptionalToValue(fn, fnTy);
70327027

70337028
// If we're applying a function that resulted from a covariant
70347029
// function conversion, strip off that conversion.

0 commit comments

Comments
 (0)