File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,9 @@ static constexpr bool ExpensiveChecksEnabled = false;
49
49
#endif
50
50
51
51
bool BasicBlockEdge::isSingleEdge () const {
52
- const Instruction *TI = Start->getTerminator ();
53
52
unsigned NumEdgesToEnd = 0 ;
54
- for (unsigned int i = 0 , n = TI-> getNumSuccessors (); i < n; ++i ) {
55
- if (TI-> getSuccessor (i) == End)
53
+ for (const BasicBlock *Succ : successors (Start) ) {
54
+ if (Succ == End)
56
55
++NumEdgesToEnd;
57
56
if (NumEdgesToEnd >= 2 )
58
57
return false ;
Original file line number Diff line number Diff line change @@ -125,12 +125,9 @@ class StructuralHashImpl {
125
125
for (auto &Inst : *BB)
126
126
updateInstruction (Inst, DetailedHash);
127
127
128
- const Instruction *Term = BB->getTerminator ();
129
- for (unsigned i = 0 , e = Term->getNumSuccessors (); i != e; ++i) {
130
- if (!VisitedBBs.insert (Term->getSuccessor (i)).second )
131
- continue ;
132
- BBs.push_back (Term->getSuccessor (i));
133
- }
128
+ for (const BasicBlock *Succ : successors (BB))
129
+ if (VisitedBBs.insert (Succ).second )
130
+ BBs.push_back (Succ);
134
131
}
135
132
}
136
133
You can’t perform that action at this time.
0 commit comments