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 {
427427 return getTerminator ()->getSingleSuccessorBlock ();
428428 }
429429
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-
435430 using SuccessorBlockListTy = TermInst::SuccessorBlockListTy;
436431 using ConstSuccessorBlockListTy = TermInst::ConstSuccessorBlockListTy;
437432
@@ -459,12 +454,6 @@ public SwiftObjectHeader {
459454 return {pred_begin (), pred_end ()};
460455 }
461456
462- bool isPredecessorBlock (SILBasicBlock *BB) const {
463- return any_of (
464- getPredecessorBlocks (),
465- [&BB](const SILBasicBlock *PredBB) -> bool { return BB == PredBB; });
466- }
467-
468457 SILBasicBlock *getSinglePredecessorBlock () {
469458 if (pred_empty () || std::next (pred_begin ()) != pred_end ())
470459 return nullptr ;
Original file line number Diff line number Diff line change @@ -8940,14 +8940,6 @@ class TermInst : public NonValueInstruction {
89408940 return const_cast <TermInst *>(this )->getSingleSuccessorBlock ();
89418941 }
89428942
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-
89518943 using SuccessorBlockArgumentListTy =
89528944 TransformRange<ConstSuccessorListTy, function_ref<ArrayRef<SILArgument *>(
89538945 const SILSuccessor &)>>;
Original file line number Diff line number Diff line change @@ -218,10 +218,12 @@ void LoopRegionFunctionInfo::verify() {
218218
219219 // If R and OtherR are blocks, then OtherR should be a successor of the
220220 // 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 () &&
223224 " Expected either R was not a block or OtherR was a CFG level "
224225 " successor of R." );
226+ }
225227 }
226228 }
227229#endif
You can’t perform that action at this time.
0 commit comments