File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1735,13 +1735,9 @@ CodeExtractor::extractCodeRegion(const CodeExtractorAnalysisCache &CEAC,
1735
1735
NumExitBlocks = ExitBlocks.size ();
1736
1736
1737
1737
for (BasicBlock *Block : Blocks) {
1738
- Instruction *TI = Block->getTerminator ();
1739
- for (unsigned i = 0 , e = TI->getNumSuccessors (); i != e; ++i) {
1740
- if (Blocks.count (TI->getSuccessor (i)))
1741
- continue ;
1742
- BasicBlock *OldTarget = TI->getSuccessor (i);
1743
- OldTargets.push_back (OldTarget);
1744
- }
1738
+ for (BasicBlock *OldTarget : successors (Block))
1739
+ if (!Blocks.contains (OldTarget))
1740
+ OldTargets.push_back (OldTarget);
1745
1741
}
1746
1742
1747
1743
// If we have to split PHI nodes of the entry or exit blocks, do so now.
You can’t perform that action at this time.
0 commit comments