File tree Expand file tree Collapse file tree 3 files changed +4
-21
lines changed
lib/SILOptimizer/Analysis Expand file tree Collapse file tree 3 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -427,11 +427,6 @@ public SwiftObjectHeader {
427
427
return getTerminator ()->getSingleSuccessorBlock ();
428
428
}
429
429
430
- // / Returns true if \p BB is a successor of this block.
431
- bool isSuccessorBlock (SILBasicBlock *Block) const {
432
- return getTerminator ()->isSuccessorBlock (Block);
433
- }
434
-
435
430
using SuccessorBlockListTy = TermInst::SuccessorBlockListTy;
436
431
using ConstSuccessorBlockListTy = TermInst::ConstSuccessorBlockListTy;
437
432
@@ -459,12 +454,6 @@ public SwiftObjectHeader {
459
454
return {pred_begin (), pred_end ()};
460
455
}
461
456
462
- bool isPredecessorBlock (SILBasicBlock *BB) const {
463
- return any_of (
464
- getPredecessorBlocks (),
465
- [&BB](const SILBasicBlock *PredBB) -> bool { return BB == PredBB; });
466
- }
467
-
468
457
SILBasicBlock *getSinglePredecessorBlock () {
469
458
if (pred_empty () || std::next (pred_begin ()) != pred_end ())
470
459
return nullptr ;
Original file line number Diff line number Diff line change @@ -8940,14 +8940,6 @@ class TermInst : public NonValueInstruction {
8940
8940
return const_cast <TermInst *>(this )->getSingleSuccessorBlock ();
8941
8941
}
8942
8942
8943
- // / Returns true if \p BB is a successor of this block.
8944
- bool isSuccessorBlock (SILBasicBlock *BB) const {
8945
- auto Range = getSuccessorBlocks ();
8946
- return any_of (Range, [&BB](const SILBasicBlock *SuccBB) -> bool {
8947
- return BB == SuccBB;
8948
- });
8949
- }
8950
-
8951
8943
using SuccessorBlockArgumentListTy =
8952
8944
TransformRange<ConstSuccessorListTy, function_ref<ArrayRef<SILArgument *>(
8953
8945
const SILSuccessor &)>>;
Original file line number Diff line number Diff line change @@ -218,10 +218,12 @@ void LoopRegionFunctionInfo::verify() {
218
218
219
219
// If R and OtherR are blocks, then OtherR should be a successor of the
220
220
// real block.
221
- if (R->isBlock () && OtherR->isBlock ())
222
- assert (R->getBlock ()->isSuccessorBlock (OtherR->getBlock ()) &&
221
+ if (R->isBlock () && OtherR->isBlock ()) {
222
+ auto succs = R->getBlock ()->getSuccessors ();
223
+ assert (std::find (succs.begin (), succs.end (), OtherR->getBlock ()) != succs.end () &&
223
224
" Expected either R was not a block or OtherR was a CFG level "
224
225
" successor of R." );
226
+ }
225
227
}
226
228
}
227
229
#endif
You can’t perform that action at this time.
0 commit comments