Skip to content

Commit 7361639

Browse files
committedAug 23, 2022
[move-only] Add support for explicit_copy_addr in a few places in MemAccessUtils that I missed when introducing the instruction.
I discovered these were missing when using explicit_copy_addr with the move only address checker.

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎lib/SIL/Utils/MemAccessUtils.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,7 @@ bool GatherUniqueStorageUses::visitUse(Operand *use, AccessUseType useTy) {
21082108
case SILInstructionKind::InjectEnumAddrInst:
21092109
return visitor.visitStore(use);
21102110

2111+
case SILInstructionKind::ExplicitCopyAddrInst:
21112112
case SILInstructionKind::CopyAddrInst:
21122113
if (operIdx == CopyLikeInstruction::Dest) {
21132114
return visitor.visitStore(use);
@@ -2146,6 +2147,10 @@ bool swift::memInstMustInitialize(Operand *memOper) {
21462147
auto *CAI = cast<CopyAddrInst>(memInst);
21472148
return CAI->getDest() == address && CAI->isInitializationOfDest();
21482149
}
2150+
case SILInstructionKind::ExplicitCopyAddrInst: {
2151+
auto *CAI = cast<ExplicitCopyAddrInst>(memInst);
2152+
return CAI->getDest() == address && CAI->isInitializationOfDest();
2153+
}
21492154
case SILInstructionKind::MarkUnresolvedMoveAddrInst: {
21502155
return cast<MarkUnresolvedMoveAddrInst>(memInst)->getDest() == address;
21512156
}
@@ -2594,6 +2599,11 @@ void swift::visitAccessedAddress(SILInstruction *I,
25942599
visitor(&I->getAllOperands()[CopyAddrInst::Dest]);
25952600
return;
25962601

2602+
case SILInstructionKind::ExplicitCopyAddrInst:
2603+
visitor(&I->getAllOperands()[ExplicitCopyAddrInst::Src]);
2604+
visitor(&I->getAllOperands()[ExplicitCopyAddrInst::Dest]);
2605+
return;
2606+
25972607
case SILInstructionKind::MarkUnresolvedMoveAddrInst:
25982608
visitor(&I->getAllOperands()[MarkUnresolvedMoveAddrInst::Src]);
25992609
visitor(&I->getAllOperands()[MarkUnresolvedMoveAddrInst::Dest]);

0 commit comments

Comments
 (0)
Please sign in to comment.