Skip to content

Commit 2f7a30c

Browse files
committed
[IRGen] Assert on retaining noncopyable.
1 parent 8e8e486 commit 2f7a30c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5028,6 +5028,7 @@ void IRGenSILFunction::visitCondBranchInst(swift::CondBranchInst *i) {
50285028
}
50295029

50305030
void IRGenSILFunction::visitRetainValueInst(swift::RetainValueInst *i) {
5031+
assert(!i->getOperand()->getType().isMoveOnly());
50315032
Explosion in = getLoweredExplosion(i->getOperand());
50325033
Explosion out;
50335034
cast<LoadableTypeInfo>(getTypeInfo(i->getOperand()->getType()))
@@ -5038,6 +5039,7 @@ void IRGenSILFunction::visitRetainValueInst(swift::RetainValueInst *i) {
50385039

50395040
void IRGenSILFunction::visitRetainValueAddrInst(swift::RetainValueAddrInst *i) {
50405041
SILValue operandValue = i->getOperand();
5042+
assert(!operandValue->getType().isMoveOnly());
50415043
Address addr = getLoweredAddress(operandValue);
50425044
SILType addrTy = operandValue->getType();
50435045
SILType objectT = addrTy.getObjectType();

0 commit comments

Comments
 (0)