aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SjLjEHPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SjLjEHPrepare.cpp')
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index baa70b9..9749a7e 100644
--- a/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/lib/CodeGen/SjLjEHPrepare.cpp
@@ -721,6 +721,12 @@ void SjLjEHPass::setupFunctionContext(Function &F,
AllocaInst *FuncCtx =
new AllocaInst(FunctionContextTy, 0, Align, "fn_context", EntryBB->begin());
+ // Store a pointer to the function context so that the back-end will know
+ // where to look for it.
+ CallInst::Create(Intrinsic::getDeclaration(F.getParent(),
+ Intrinsic::eh_sjlj_functioncontext),
+ FuncCtx, "", EntryBB->getTerminator());
+
// Fill in the function context structure.
Value *Idxs[2];
Type *Int32Ty = Type::getInt32Ty(F.getContext());