mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Update the dominator tree with the correct dominator for the new 'unwind' block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -693,6 +693,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
|
|||||||
|
|
||||||
// Extract the exception object from the ResumeInst and add it to the PHI node
|
// Extract the exception object from the ResumeInst and add it to the PHI node
|
||||||
// that feeds the _Unwind_Resume call.
|
// that feeds the _Unwind_Resume call.
|
||||||
|
BasicBlock *UnwindBBDom = Resumes[0]->getParent();
|
||||||
for (SmallVectorImpl<ResumeInst*>::iterator
|
for (SmallVectorImpl<ResumeInst*>::iterator
|
||||||
I = Resumes.begin(), E = Resumes.end(); I != E; ++I) {
|
I = Resumes.begin(), E = Resumes.end(); I != E; ++I) {
|
||||||
ResumeInst *RI = *I;
|
ResumeInst *RI = *I;
|
||||||
@@ -700,6 +701,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
|
|||||||
ExtractValueInst *ExnObj = ExtractValueInst::Create(RI->getOperand(0),
|
ExtractValueInst *ExnObj = ExtractValueInst::Create(RI->getOperand(0),
|
||||||
0, "exn.obj", RI);
|
0, "exn.obj", RI);
|
||||||
PN->addIncoming(ExnObj, RI->getParent());
|
PN->addIncoming(ExnObj, RI->getParent());
|
||||||
|
UnwindBBDom = DT->findNearestCommonDominator(RI->getParent(), UnwindBBDom);
|
||||||
RI->eraseFromParent();
|
RI->eraseFromParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,6 +711,9 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
|
|||||||
|
|
||||||
// We never expect _Unwind_Resume to return.
|
// We never expect _Unwind_Resume to return.
|
||||||
new UnreachableInst(Ctx, UnwindBB);
|
new UnreachableInst(Ctx, UnwindBB);
|
||||||
|
|
||||||
|
// Now update DominatorTree analysis information.
|
||||||
|
DT->addNewBlock(UnwindBB, UnwindBBDom);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user