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/AsmPrinter/WinException.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index cd360218f36..1b75051dd67 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -475,6 +475,16 @@ void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) { HT.CatchObjRecoverIdx); FrameAllocOffsetRef = MCSymbolRefExpr::create( FrameAllocOffset, MCSymbolRefExpr::VK_None, Asm->OutContext); + } else if (HT.CatchObj.FrameOffset != INT_MAX) { + int Offset = HT.CatchObj.FrameOffset; + // For 32-bit, the catch object offset is relative to the end of the + // EH registration node. For 64-bit, it's relative to SP at the end of + // the prologue. + if (!shouldEmitPersonality) { + assert(FuncInfo.EHRegNodeEndOffset != INT_MAX); + Offset += FuncInfo.EHRegNodeEndOffset; + } + FrameAllocOffsetRef = MCConstantExpr::create(Offset, Asm->OutContext); } else { FrameAllocOffsetRef = MCConstantExpr::create(0, Asm->OutContext); } -- cgit v1.2.3