diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-09-28 03:36:43 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-09-28 03:36:43 +0000 |
commit | 6ef94175d1bbab95f195770bb3c559b3ab38c4e5 (patch) | |
tree | 880bb6e6f6958f077b8d94873efe04fc4db22a99 /lib/CodeGen/SjLjEHPrepare.cpp | |
parent | 2b6bd7ba5819d8c73c89291c6de89a86dbbffe9c (diff) | |
download | llvm-6ef94175d1bbab95f195770bb3c559b3ab38c4e5.tar.gz llvm-6ef94175d1bbab95f195770bb3c559b3ab38c4e5.tar.bz2 llvm-6ef94175d1bbab95f195770bb3c559b3ab38c4e5.tar.xz |
Create and use an llvm.eh.sjlj.functioncontext intrinsic.
This intrinsic is used to pass the index of the function context to the back-end
for further processing. The back-end is in charge of filling in the rest of the
entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SjLjEHPrepare.cpp')
-rw-r--r-- | lib/CodeGen/SjLjEHPrepare.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp index baa70b961b..9749a7e119 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()); |