Skip to content

Commit 0b9fe40

Browse files
committed
SIL: Teach about SILVerifier about TuplePackElementAddrInst and PackElementSetInst
1 parent d1973d6 commit 0b9fe40

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ struct ImmutableAddressUseVerifier {
675675
case SILInstructionKind::TailAddrInst:
676676
case SILInstructionKind::IndexRawPointerInst:
677677
case SILInstructionKind::MarkMustCheckInst:
678+
case SILInstructionKind::PackElementGetInst:
678679
// Add these to our worklist.
679680
for (auto result : inst->getResults()) {
680681
llvm::copy(result->getUses(), std::back_inserter(worklist));
@@ -693,6 +694,25 @@ struct ImmutableAddressUseVerifier {
693694
llvm_unreachable("invoking standard assertion failure");
694695
break;
695696
}
697+
case SILInstructionKind::TuplePackElementAddrInst: {
698+
if (&cast<TuplePackElementAddrInst>(inst)->getOperandRef(
699+
TuplePackElementAddrInst::TupleOperand) == use) {
700+
for (auto result : inst->getResults()) {
701+
llvm::copy(result->getUses(), std::back_inserter(worklist));
702+
}
703+
704+
break;
705+
}
706+
707+
return false;
708+
}
709+
case SILInstructionKind::PackElementSetInst: {
710+
if (&cast<PackElementSetInst>(inst)->getOperandRef(
711+
PackElementSetInst::PackOperand) == use)
712+
return true;
713+
714+
return false;
715+
}
696716
default:
697717
llvm::errs() << "Unhandled, unexpected instruction: " << *inst;
698718
llvm_unreachable("invoking standard assertion failure");

0 commit comments

Comments
 (0)