Skip to content

Commit 3593f1b

Browse files
committed
[NFC] CSApply: 'isPartialApplication' → 'needsCurryThunk' which is more accurate
1 parent 4c4e2b4 commit 3593f1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Sema/CSApply.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ namespace {
14781478

14791479
const bool isUnboundInstanceMember =
14801480
(!baseIsInstance && member->isInstanceMember());
1481-
const bool isPartialApplication =
1481+
const bool needsCurryThunk =
14821482
shouldBuildCurryThunk(choice, baseIsInstance);
14831483

14841484
// The formal type of the 'self' value for the member's declaration.
@@ -1511,7 +1511,7 @@ namespace {
15111511
// the thunk to accept a class to avoid potential abstraction, so the
15121512
// existential base must be opened eagerly in order to be upcast to the
15131513
// appropriate class reference type before it is passed to the thunk.
1514-
if (!isPartialApplication ||
1514+
if (!needsCurryThunk ||
15151515
(!member->getDeclContext()->getSelfProtocolDecl() &&
15161516
!isUnboundInstanceMember)) {
15171517
// Open the existential before performing the member reference.
@@ -1590,7 +1590,7 @@ namespace {
15901590
}
15911591

15921592
// Handle dynamic references.
1593-
if (isDynamic || (!isPartialApplication &&
1593+
if (isDynamic || (!needsCurryThunk &&
15941594
member->getAttrs().hasAttribute<OptionalAttr>())) {
15951595
base = cs.coerceToRValue(base);
15961596
Expr *ref = new (context) DynamicMemberRefExpr(base, dotLoc, memberRef,
@@ -1690,12 +1690,12 @@ namespace {
16901690
// very specific shape, we only emit a single closure here and
16911691
// capture the original SuperRefExpr, since its evaluation does not
16921692
// have side effects, instead of abstracting out a 'self' parameter.
1693-
const auto isSuperPartialApplication = isPartialApplication && isSuper;
1693+
const auto isSuperPartialApplication = needsCurryThunk && isSuper;
16941694
if (isSuperPartialApplication) {
16951695
ref = buildSingleCurryThunk(base, declRefExpr,
16961696
cast<AbstractFunctionDecl>(member),
16971697
memberLocator);
1698-
} else if (isPartialApplication) {
1698+
} else if (needsCurryThunk) {
16991699
// Another case where we want to build a single closure is when
17001700
// we have a partial application of a constructor on a statically-
17011701
// derived metatype value. Again, there are no order of evaluation

0 commit comments

Comments
 (0)