From b005d281c36c09eda1b85db59e2c183ed5defca5 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 16 Sep 2015 20:16:27 +0000 Subject: [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 --- llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index fe359777a36..baf9ee990ea 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -294,11 +294,18 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, 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(H.Handler.get())) + 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(H.Handler.get())) H.Handler = MBBMap[BB]; + } + } for (WinEHUnwindMapEntry &UME : EHInfo.UnwindMap) if (UME.Cleanup) if (const auto *BB = dyn_cast(UME.Cleanup.get())) -- cgit v1.2.3