Skip to content

Commit 69cf528

Browse files
committed
[NFC] Rename isBorrowOrMutateAccessor -> isBorrowAccessor
1 parent b5d15ae commit 69cf528

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ class DestructureResults {
13861386
SmallVectorImpl<SILResultInfo> &Results;
13871387
TypeExpansionContext context;
13881388
bool hasSendingResult;
1389-
bool isBorrowOrMutateAccessor;
1389+
bool isBorrowAccessor;
13901390

13911391
public:
13921392
DestructureResults(TypeExpansionContext context, TypeConverter &TC,
@@ -1395,13 +1395,13 @@ class DestructureResults {
13951395
bool hasSendingResult, bool isBorrowOrMutateAccessor)
13961396
: TC(TC), Convs(conventions), Results(results), context(context),
13971397
hasSendingResult(hasSendingResult),
1398-
isBorrowOrMutateAccessor(isBorrowOrMutateAccessor) {}
1398+
isBorrowAccessor(isBorrowOrMutateAccessor) {}
13991399

14001400
void destructure(AbstractionPattern origType, CanType substType) {
14011401
// Recur into tuples.
14021402
// Do not explode tuples for borrow and mutate accessors since we cannot
14031403
// explode and reconstruct addresses.
1404-
if (origType.isTuple() && !isBorrowOrMutateAccessor) {
1404+
if (origType.isTuple() && !isBorrowAccessor) {
14051405
origType.forEachTupleElement(substType,
14061406
[&](TupleElementGenerator &elt) {
14071407
// If the original element type is not a pack expansion, just
@@ -1411,7 +1411,7 @@ class DestructureResults {
14111411
return;
14121412
}
14131413

1414-
if (isBorrowOrMutateAccessor) {
1414+
if (isBorrowAccessor) {
14151415
llvm_unreachable(
14161416
"Returning packs from borrow/mutate accessor is not implemented");
14171417
}
@@ -1448,7 +1448,7 @@ class DestructureResults {
14481448
// Determine the result convention.
14491449
ResultConvention convention;
14501450

1451-
if (isBorrowOrMutateAccessor) {
1451+
if (isBorrowAccessor) {
14521452
if (substResultTL.isTrivial()) {
14531453
convention = ResultConvention::Unowned;
14541454
} else if (isFormallyReturnedIndirectly(origType, substType,
@@ -2368,17 +2368,6 @@ getAsCoroutineAccessor(std::optional<SILDeclRef> constant) {
23682368
return accessor;
23692369
}
23702370

2371-
static bool isBorrowOrMutateAccessor(std::optional<SILDeclRef> constant) {
2372-
if (!constant || !constant->hasDecl())
2373-
return false;
2374-
2375-
auto accessor = dyn_cast<AccessorDecl>(constant->getDecl());
2376-
if (!accessor)
2377-
return false;
2378-
2379-
return accessor->isBorrowAccessor() || accessor->isMutateAccessor();
2380-
}
2381-
23822371
static void destructureYieldsForReadAccessor(TypeConverter &TC,
23832372
TypeExpansionContext expansion,
23842373
AbstractionPattern origType,
@@ -2729,7 +2718,7 @@ static CanSILFunctionType getSILFunctionType(
27292718
{
27302719
DestructureResults destructurer(expansionContext, TC, conventions, results,
27312720
hasSendingResult,
2732-
isBorrowOrMutateAccessor(constant));
2721+
constant->isBorrowAccessor());
27332722
destructurer.destructure(origResultType, substFormalResultType);
27342723
}
27352724

0 commit comments

Comments
 (0)