[WinEH] Pull Adjectives and CatchObj out of the catchpad arg list

Clang now passes the adjectives as an argument to catchpad.

Getting the CatchObj working is simply a matter of threading another
static alloca through codegen, first as an alloca, then as a frame
index, and finally as a frame offset.

llvm-svn: 247844
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index fe35977..baf9ee9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -294,11 +294,18 @@
     calculateSEHStateNumbers(WinEHParentFn, EHInfo);
 
   // Map all BB references in the WinEH data to MBBs.
-  for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap)
-    for (WinEHHandlerType &H : TBME.HandlerArray)
-      if (const auto *BB =
-              dyn_cast<BasicBlock>(H.Handler.get<const Value *>()))
+  for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
+    for (WinEHHandlerType &H : TBME.HandlerArray) {
+      if (H.CatchObjRecoverIdx == -2 && H.CatchObj.Alloca) {
+        assert(StaticAllocaMap.count(H.CatchObj.Alloca));
+        H.CatchObj.FrameIndex = StaticAllocaMap[H.CatchObj.Alloca];
+      } else {
+        H.CatchObj.FrameIndex = INT_MAX;
+      }
+      if (const auto *BB = dyn_cast<BasicBlock>(H.Handler.get<const Value *>()))
         H.Handler = MBBMap[BB];
+    }
+  }
   for (WinEHUnwindMapEntry &UME : EHInfo.UnwindMap)
     if (UME.Cleanup)
       if (const auto *BB = dyn_cast<BasicBlock>(UME.Cleanup.get<const Value *>()))