diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-26 21:36:12 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-26 21:36:12 +0000 |
commit | 71fce2c84de276ba15f74f9c818d4d74c35c762a (patch) | |
tree | 045a2bd5664af9b6bc3c44b4d891445a704db293 /llvm/lib/CodeGen/DwarfEHPrepare.cpp | |
parent | 39ab743e59634dfda9a936f7bc0fa99e1aba2326 (diff) | |
download | bcm5719-llvm-71fce2c84de276ba15f74f9c818d4d74c35c762a.tar.gz bcm5719-llvm-71fce2c84de276ba15f74f9c818d4d74c35c762a.zip |
Update the dominator tree with the correct dominator for the new 'unwind' block.
llvm-svn: 138664
Diffstat (limited to 'llvm/lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/DwarfEHPrepare.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/llvm/lib/CodeGen/DwarfEHPrepare.cpp index d2b129a448e..ed9e409d3e5 100644 --- a/llvm/lib/CodeGen/DwarfEHPrepare.cpp +++ b/llvm/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; } |