From: Andrew Kaylor Date: Mon, 20 Apr 2015 22:53:42 +0000 (+0000) Subject: [WinEH] Fix problem with landing pad return values used in PHI nodes during outlining. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0b5195703ddf15d79db903f1150ca52d5ee8efc;p=llvm [WinEH] Fix problem with landing pad return values used in PHI nodes during outlining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235358 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index cba9ea530ba..f4e810d8173 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -904,6 +904,10 @@ bool WinEHPrepare::outlineHandler(ActionHandler *Action, Function *SrcFn, ++II; } + // The landing pad value may be used by PHI nodes. It will ultimately be + // eliminated, but we need it in the map for intermediate handling. + VMap[LPad] = UndefValue::get(LPad->getType()); + // Skip over PHIs and, if applicable, landingpad instructions. II = StartBB->getFirstInsertionPt();