From 00e5d9ee5f71ecbe1fcbf25cf09ab96f785a2de7 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Mon, 20 Apr 2015 22:53:42 +0000 Subject: [PATCH] [WinEH] Fix problem with landing pad return values used in PHI nodes during outlining. llvm-svn: 235358 --- llvm/lib/CodeGen/WinEHPrepare.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index cba9ea5..f4e810d 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/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(); -- 2.7.4