[llvm-commits] [llvm] r138664 - /llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp
Bill Wendling
isanbard at gmail.com
Fri Aug 26 14:36:12 PDT 2011
Author: void
Date: Fri Aug 26 16:36:12 2011
New Revision: 138664
URL: http://llvm.org/viewvc/llvm-project?rev=138664&view=rev
Log:
Update the dominator tree with the correct dominator for the new 'unwind' block.
Modified:
llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp
Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=138664&r1=138663&r2=138664&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Fri Aug 26 16:36:12 2011
@@ -693,6 +693,7 @@
// 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 @@
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 @@
// We never expect _Unwind_Resume to return.
new UnreachableInst(Ctx, UnwindBB);
+
+ // Now update DominatorTree analysis information.
+ DT->addNewBlock(UnwindBB, UnwindBBDom);
return true;
}
More information about the llvm-commits
mailing list