Skip to content

Commit 81a20e8

Browse files
committed
[region-isolation] Convert some if(!condition) { assert(false) } -> assert(condition).
1 parent bf64711 commit 81a20e8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/SILOptimizer/Mandatory/SendNonSendable.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,15 +1387,12 @@ class TransferRequireAccumulator {
13871387
// consumption does not correspond to an apply expression
13881388
return false;
13891389
auto isolationCrossing = apply->getIsolationCrossing();
1390-
if (!isolationCrossing) {
1391-
assert(false && "ApplyExprs should be transferring only if"
1392-
" they are isolation crossing");
1393-
return false;
1394-
}
1390+
assert(isolationCrossing && "ApplyExprs should be transferring only if "
1391+
"they are isolation crossing");
1392+
13951393
auto argExpr = transferOp.getSourceExpr();
1396-
if (!argExpr)
1397-
assert(false &&
1398-
"sourceExpr should be populated for ApplyExpr consumptions");
1394+
assert(argExpr &&
1395+
"sourceExpr should be populated for ApplyExpr consumptions");
13991396

14001397
sourceInst->getFunction()
14011398
->getASTContext()

0 commit comments

Comments
 (0)