mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges."
This reverts commit r213474 (and r213475), which causes a miscompile on a stage2 LTO build. I'll reply on the list in a moment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -58,12 +58,13 @@ Function* PartialInliner::unswitchFunction(Function* F) {
|
||||
BasicBlock* returnBlock = nullptr;
|
||||
BasicBlock* nonReturnBlock = nullptr;
|
||||
unsigned returnCount = 0;
|
||||
for (BasicBlock *Succ : successors(entryBlock))
|
||||
if (isa<ReturnInst>(Succ->getTerminator())) {
|
||||
returnBlock = Succ;
|
||||
for (succ_iterator SI = succ_begin(entryBlock), SE = succ_end(entryBlock);
|
||||
SI != SE; ++SI)
|
||||
if (isa<ReturnInst>((*SI)->getTerminator())) {
|
||||
returnBlock = *SI;
|
||||
returnCount++;
|
||||
} else
|
||||
nonReturnBlock = Succ;
|
||||
nonReturnBlock = *SI;
|
||||
|
||||
if (returnCount != 1)
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user