summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-04-03 22:49:05 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-04-03 22:49:05 +0000
commit69132a7fb28600d47e43f4f776f6352856efb967 (patch)
treebb88146212e608f5539f5c172f30c81faab375ef /llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
parent3337064a47a7fbc1e40c41975a8fe084493fd759 (diff)
downloadbcm5719-llvm-69132a7fb28600d47e43f4f776f6352856efb967.tar.gz
bcm5719-llvm-69132a7fb28600d47e43f4f776f6352856efb967.zip
[WinEH] Fill out .xdata for catch objects
This add support for catching an exception such that an exception object available to the catch handler will be initialized by the runtime. llvm-svn: 234062
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
index 7a82daa3337..676ce65dedb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
@@ -450,9 +450,16 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
const MCSymbolRefExpr *ParentFrameOffsetRef = MCSymbolRefExpr::Create(
ParentFrameOffset, MCSymbolRefExpr::VK_None, Asm->OutContext);
+ MCSymbol *FrameAllocOffset =
+ Asm->OutContext.getOrCreateFrameAllocSymbol(
+ GlobalValue::getRealLinkageName(F->getName()),
+ HT.CatchObjRecoverIdx);
+ const MCSymbolRefExpr *FrameAllocOffsetRef = MCSymbolRefExpr::Create(
+ FrameAllocOffset, MCSymbolRefExpr::VK_None, Asm->OutContext);
+
OS.EmitIntValue(HT.Adjectives, 4); // Adjectives
OS.EmitValue(createImageRel32(HT.TypeDescriptor), 4); // Type
- OS.EmitIntValue(HT.CatchObjOffset, 4); // CatchObjOffset
+ OS.EmitValue(FrameAllocOffsetRef, 4); // CatchObjOffset
OS.EmitValue(createImageRel32(HT.Handler), 4); // Handler
OS.EmitValue(ParentFrameOffsetRef, 4); // ParentFrameOffset
}
OpenPOWER on IntegriCloud