Skip to content

Commit 86bdc0c

Browse files
committed
[local] Convert llvm::none_of negative condition => llvm::all_of positive condition.
Outside of the actual function in question this is NFC.
1 parent 08c7391 commit 86bdc0c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/SILOptimizer/Utils/Local.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,20 +1379,18 @@ swift::analyzeStaticInitializer(SILValue V,
13791379
// If it is not a struct which is a simple type, bail.
13801380
if (!isSimpleType(SI->getType(), SI->getModule()))
13811381
return false;
1382-
return llvm::none_of(SI->getAllOperands(),
1383-
[&](Operand &Op) -> bool {
1384-
return !analyzeStaticInitializer(Op.get(), Insts);
1385-
});
1382+
return llvm::all_of(SI->getAllOperands(), [&](Operand &Op) -> bool {
1383+
return analyzeStaticInitializer(Op.get(), Insts);
1384+
});
13861385
}
13871386

13881387
if (auto *TI = dyn_cast<TupleInst>(V)) {
13891388
// If it is not a tuple which is a simple type, bail.
13901389
if (!isSimpleType(TI->getType(), TI->getModule()))
13911390
return false;
1392-
return llvm::none_of(TI->getAllOperands(),
1393-
[&](Operand &Op) -> bool {
1394-
return !analyzeStaticInitializer(Op.get(), Insts);
1395-
});
1391+
return llvm::all_of(TI->getAllOperands(), [&](Operand &Op) -> bool {
1392+
return analyzeStaticInitializer(Op.get(), Insts);
1393+
});
13961394
}
13971395

13981396
if (auto *bi = dyn_cast<BuiltinInst>(V)) {

0 commit comments

Comments
 (0)