Rewrite some isPlusOne calls to isPlusOneOrTrivial.

Whenever we want to forward to a +1 value but don't need to destroy
the original memory, use isPlusOneOrTrivial.

This follows the existing naming scheme.

Fixes rdar://108001491 (SIL verification failed: Found mutating or
consuming use of an in_guaranteed parameter?!:
!ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg))
This commit is contained in:
Andrew Trick
2023-05-01 22:59:40 -07:00
parent dc95b112cd
commit ea7b8055bc
9 changed files with 24 additions and 21 deletions

View File

@@ -1679,7 +1679,7 @@ emitCastOperand(SILGenFunction &SGF, SILLocation loc,
finalValue =
SGF.emitSubstToOrigValue(loc, finalValue, abstraction, sourceType, ctx);
}
assert(finalValue.isPlusOne(SGF));
assert(finalValue.isPlusOneOrTrivial(SGF));
// If we at this point do not require an address, return final value. We know
// that it is a +1 take always value.