File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1281,20 +1281,19 @@ bool swift::emitSuccessfulIndirectUnconditionalCast(
12811281// / Can the given cast be performed by the scalar checked-cast
12821282// / instructions at the current SIL stage?
12831283// /
1284- // / FIXME: Always return true for !useLoweredAddresses: Scalar casts are always
1284+ // / Always returns true for !useLoweredAddresses. Scalar casts are always
12851285// / valid for owned values. If the operand is +1, the case will always destroy
12861286// / or forward it. The result is always either +1 or trivial. The cast never
12871287// / hides a copy. doesCastPreserveOwnershipForTypes determines whether the
12881288// / scalar cast is also compatible with guaranteed values.
12891289bool swift::canSILUseScalarCheckedCastInstructions (SILModule &M,
12901290 CanType sourceFormalType,
12911291 CanType targetFormalType) {
1292- if (M.useLoweredAddresses ())
1293- return canIRGenUseScalarCheckedCastInstructions (M, sourceFormalType,
1294- targetFormalType);
1292+ if (!M.useLoweredAddresses ())
1293+ return true ;
12951294
1296- return
1297- doesCastPreserveOwnershipForTypes (M, sourceFormalType, targetFormalType);
1295+ return canIRGenUseScalarCheckedCastInstructions (M, sourceFormalType,
1296+ targetFormalType);
12981297}
12991298
13001299// / Can the given cast be performed by the scalar checked-cast
You can’t perform that action at this time.
0 commit comments