[WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.
authorAndrew Kaylor <andrew.kaylor@intel.com>
Mon, 20 Apr 2015 22:53:42 +0000 (22:53 +0000)
committerAndrew Kaylor <andrew.kaylor@intel.com>
Mon, 20 Apr 2015 22:53:42 +0000 (22:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235358 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/WinEHPrepare.cpp

index cba9ea530ba251b4407dd0644e8ced12e92207f0..f4e810d8173dabe8816cac67383f4334cdfd003c 100644 (file)
@@ -904,6 +904,10 @@ bool WinEHPrepare::outlineHandler(ActionHandler *Action, Function *SrcFn,
     ++II;
   }
 
     ++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();
 
   // Skip over PHIs and, if applicable, landingpad instructions.
   II = StartBB->getFirstInsertionPt();