summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-09-16 20:16:27 +0000
committerReid Kleckner <rnk@google.com>2015-09-16 20:16:27 +0000
commitb005d281c36c09eda1b85db59e2c183ed5defca5 (patch)
tree8263838e6c8079eceaccb60c61aa8c393205aa95 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp
parent10aa77032de43681231e81ee3f2e7d232b16dc9c (diff)
downloadbcm5719-llvm-b005d281c36c09eda1b85db59e2c183ed5defca5.tar.gz
bcm5719-llvm-b005d281c36c09eda1b85db59e2c183ed5defca5.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp10
1 files changed, 10 insertions, 0 deletions
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);
}
OpenPOWER on IntegriCloud