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(
1281
1281
// / Can the given cast be performed by the scalar checked-cast
1282
1282
// / instructions at the current SIL stage?
1283
1283
// /
1284
- // / FIXME: Always return true for !useLoweredAddresses: Scalar casts are always
1284
+ // / Always returns true for !useLoweredAddresses. Scalar casts are always
1285
1285
// / valid for owned values. If the operand is +1, the case will always destroy
1286
1286
// / or forward it. The result is always either +1 or trivial. The cast never
1287
1287
// / hides a copy. doesCastPreserveOwnershipForTypes determines whether the
1288
1288
// / scalar cast is also compatible with guaranteed values.
1289
1289
bool swift::canSILUseScalarCheckedCastInstructions (SILModule &M,
1290
1290
CanType sourceFormalType,
1291
1291
CanType targetFormalType) {
1292
- if (M.useLoweredAddresses ())
1293
- return canIRGenUseScalarCheckedCastInstructions (M, sourceFormalType,
1294
- targetFormalType);
1292
+ if (!M.useLoweredAddresses ())
1293
+ return true ;
1295
1294
1296
- return
1297
- doesCastPreserveOwnershipForTypes (M, sourceFormalType, targetFormalType);
1295
+ return canIRGenUseScalarCheckedCastInstructions (M, sourceFormalType,
1296
+ targetFormalType);
1298
1297
}
1299
1298
1300
1299
// / Can the given cast be performed by the scalar checked-cast
You can’t perform that action at this time.
0 commit comments