mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Fixing a bug with WinEH PHI handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232851 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -524,11 +524,18 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
|
||||
|
||||
// Handle PHI nodes specially, as we have to remove references to dead
|
||||
// blocks.
|
||||
for (BasicBlock::const_iterator I = BI->begin(), E = BI->end(); I != E; ++I)
|
||||
if (const PHINode *PN = dyn_cast<PHINode>(I))
|
||||
PHIToResolve.push_back(PN);
|
||||
else
|
||||
for (BasicBlock::const_iterator I = BI->begin(), E = BI->end(); I != E; ++I) {
|
||||
// PHI nodes may have been remapped to non-PHI nodes by the caller or
|
||||
// during the cloning process.
|
||||
if (const PHINode *PN = dyn_cast<PHINode>(I)) {
|
||||
if (isa<PHINode>(VMap[PN]))
|
||||
PHIToResolve.push_back(PN);
|
||||
else
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, remap the terminator instructions, as those can't be remapped
|
||||
// until all BBs are mapped.
|
||||
|
Reference in New Issue
Block a user