+ // If we are inlining a function that unwinds into a BB with an unwind dest,
+ // turn the inlined unwinds into branches to the unwind dest.
+ if (InlinedFunctionInfo.ContainsUnwinds && UnwindBB && isa<CallInst>(TheCall))
+ for (Function::iterator BB = FirstNewBlock, E = Caller->end();
+ BB != E; ++BB) {
+ TerminatorInst *Term = BB->getTerminator();
+ if (isa<UnwindInst>(Term)) {
+ new BranchInst(UnwindBB, Term);
+ BB->getInstList().erase(Term);
+ }
+ }
+