mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11180,15 +11180,12 @@ static void AddReachableCodeToWorklist(BasicBlock *BB,
|
||||
|
||||
// Recursively visit successors. If this is a branch or switch on a
|
||||
// constant, only visit the reachable successor.
|
||||
if (BB->getUnwindDest())
|
||||
Worklist.push_back(BB->getUnwindDest());
|
||||
TerminatorInst *TI = BB->getTerminator();
|
||||
if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
|
||||
if (BI->isConditional() && isa<ConstantInt>(BI->getCondition())) {
|
||||
bool CondVal = cast<ConstantInt>(BI->getCondition())->getZExtValue();
|
||||
BasicBlock *ReachableBB = BI->getSuccessor(!CondVal);
|
||||
if (ReachableBB != BB->getUnwindDest())
|
||||
Worklist.push_back(ReachableBB);
|
||||
Worklist.push_back(ReachableBB);
|
||||
continue;
|
||||
}
|
||||
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
|
||||
@@ -11197,8 +11194,7 @@ static void AddReachableCodeToWorklist(BasicBlock *BB,
|
||||
for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i)
|
||||
if (SI->getCaseValue(i) == Cond) {
|
||||
BasicBlock *ReachableBB = SI->getSuccessor(i);
|
||||
if (ReachableBB != BB->getUnwindDest())
|
||||
Worklist.push_back(ReachableBB);
|
||||
Worklist.push_back(ReachableBB);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user