[WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.
llvm-svn: 235358
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 @@
++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();