summaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfEHPrepare.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-26 21:36:12 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-26 21:36:12 +0000
commite8ef4cc053257c8cc330d4995aa775785e7f3f04 (patch)
tree2009d4708d9f26b5b8afe9d7dc5a409dee392a28 /lib/CodeGen/DwarfEHPrepare.cpp
parent43f51aeca8367ea35adad963c00bd2bc5b8d1391 (diff)
downloadllvm-e8ef4cc053257c8cc330d4995aa775785e7f3f04.tar.gz
llvm-e8ef4cc053257c8cc330d4995aa775785e7f3f04.tar.bz2
llvm-e8ef4cc053257c8cc330d4995aa775785e7f3f04.tar.xz
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
Diffstat (limited to 'lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp
index d2b129a448..ed9e409d3e 100644
--- a/lib/CodeGen/DwarfEHPrepare.cpp
+++ b/lib/CodeGen/DwarfEHPrepare.cpp
@@ -693,6 +693,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
// Extract the exception object from the ResumeInst and add it to the PHI node
// that feeds the _Unwind_Resume call.
+ BasicBlock *UnwindBBDom = Resumes[0]->getParent();
for (SmallVectorImpl<ResumeInst*>::iterator
I = Resumes.begin(), E = Resumes.end(); I != E; ++I) {
ResumeInst *RI = *I;
@@ -700,6 +701,7 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
ExtractValueInst *ExnObj = ExtractValueInst::Create(RI->getOperand(0),
0, "exn.obj", RI);
PN->addIncoming(ExnObj, RI->getParent());
+ UnwindBBDom = DT->findNearestCommonDominator(RI->getParent(), UnwindBBDom);
RI->eraseFromParent();
}
@@ -709,6 +711,9 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
// We never expect _Unwind_Resume to return.
new UnreachableInst(Ctx, UnwindBB);
+
+ // Now update DominatorTree analysis information.
+ DT->addNewBlock(UnwindBB, UnwindBBDom);
return true;
}