Skip to content

Commit 83ce3a1

Browse files
committed
Rename getArgumentOperandConvention to getCaptureConvention
The name was misleading and problematic. There is already a getArgumentConvention which is completely different.
1 parent 9c24933 commit 83ce3a1

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

include/swift/SIL/ApplySite.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,11 @@ class ApplySite {
375375
///
376376
/// For full applies, this is equivalent to `getArgumentConvention`. But for
377377
/// a partial_apply, the argument ownership convention at the partial_apply
378-
/// instruction itself is different from the argument convention of the callee.
378+
/// instruction itself is different from the argument convention of the
379+
/// callee.
380+
///
379381
/// For details see the partial_apply documentation in SIL.rst.
380-
SILArgumentConvention getArgumentOperandConvention(const Operand &oper) const {
382+
SILArgumentConvention getCaptureConvention(const Operand &oper) const {
381383
SILArgumentConvention conv = getArgumentConvention(oper);
382384
auto *pai = dyn_cast<PartialApplyInst>(Inst);
383385
if (!pai)

lib/SIL/Verifier/MemoryLifetimeVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ void MemoryLifetimeVerifier::initDataflowInBlock(SILBasicBlock *block,
434434
ApplySite AS(&I);
435435
for (Operand &op : I.getAllOperands()) {
436436
if (AS.isArgumentOperand(op)) {
437-
setFuncOperandBits(state, op, AS.getArgumentOperandConvention(op),
437+
setFuncOperandBits(state, op, AS.getCaptureConvention(op),
438438
isa<TryApplyInst>(&I));
439439
}
440440
}
@@ -771,7 +771,7 @@ void MemoryLifetimeVerifier::checkBlock(SILBasicBlock *block, Bits &bits) {
771771
ApplySite AS(&I);
772772
for (Operand &op : I.getAllOperands()) {
773773
if (AS.isArgumentOperand(op))
774-
checkFuncArgument(bits, op, AS.getArgumentOperandConvention(op), &I);
774+
checkFuncArgument(bits, op, AS.getCaptureConvention(op), &I);
775775
}
776776
break;
777777
}

lib/SILOptimizer/Mandatory/ConsumeOperatorCopyableAddressesChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ bool GatherLexicalLifetimeUseVisitor::visitUse(Operand *op,
13321332
return false;
13331333
}
13341334

1335-
if (fas.getArgumentOperandConvention(*op) ==
1335+
if (fas.getCaptureConvention(*op) ==
13361336
SILArgumentConvention::Indirect_InoutAliasable) {
13371337
// If we don't find the function, we can't handle this, so bail.
13381338
auto *func = fas.getCalleeFunction();

lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
23782378
// either.
23792379
if (auto *f = pas->getCalleeFunction()) {
23802380
if (f->hasSemanticsAttr(semantics::NO_MOVEONLY_DIAGNOSTICS)) {
2381-
if (ApplySite(pas).getArgumentOperandConvention(*op).isInoutConvention()) {
2381+
if (ApplySite(pas).getCaptureConvention(*op).isInoutConvention()) {
23822382
diagnosticEmitter.emitEarlierPassEmittedDiagnostic(markedValue);
23832383
return false;
23842384
}

lib/SILOptimizer/Mandatory/MoveOnlyUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ bool noncopyable::memInstMustReinitialize(Operand *memOper) {
258258
case SILInstructionKind::TryApplyInst:
259259
case SILInstructionKind::ApplyInst: {
260260
FullApplySite applySite(memInst);
261-
return applySite.getArgumentOperandConvention(*memOper).isInoutConvention();
261+
return applySite.getCaptureConvention(*memOper).isInoutConvention();
262262
}
263263
case SILInstructionKind::StoreInst:
264264
return cast<StoreInst>(memInst)->getOwnershipQualifier() ==
@@ -295,7 +295,7 @@ bool noncopyable::memInstMustConsume(Operand *memOper) {
295295
case SILInstructionKind::TryApplyInst:
296296
case SILInstructionKind::ApplyInst: {
297297
FullApplySite applySite(memInst);
298-
return applySite.getArgumentOperandConvention(*memOper).isOwnedConvention();
298+
return applySite.getCaptureConvention(*memOper).isOwnedConvention();
299299
}
300300
case SILInstructionKind::PartialApplyInst: {
301301
// If we are on the stack or have an inout convention, we do not

0 commit comments

Comments
 (0)