diff options
| author | Jim Grosbach <grosbach@apple.com> | 2010-05-27 23:54:20 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2010-05-27 23:54:20 +0000 |
| commit | 4cf59b9e91d6790be9c1be3eefc482a1026ed957 (patch) | |
| tree | ca0d10b6ad39f3ff6ea2fd959fd1b2734bf3550a /clang/lib/CodeGen/CGBuiltin.cpp | |
| parent | faa3abbe39a2b17546387fde04d2822e0402b418 (diff) | |
| download | bcm5719-llvm-4cf59b9e91d6790be9c1be3eefc482a1026ed957.tar.gz bcm5719-llvm-4cf59b9e91d6790be9c1be3eefc482a1026ed957.zip | |
Update __builtin_setjmp codegen to match llvmCore changes in r104900.
llvm-svn: 104902
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 8c3478c3b0c..2b27bebe66e 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -567,6 +567,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 0)); Builder.CreateStore(FrameAddr, Buf); + // Store the stack pointer to the setjmp buffer. + Value *StackAddr = + Builder.CreateCall(CGM.getIntrinsic(Intrinsic::stacksave)); + Value *StackSaveSlot = + Builder.CreateGEP(Buf, ConstantInt::get(llvm::Type::getInt32Ty(VMContext), + 2)); + Builder.CreateStore(StackAddr, StackSaveSlot); + // Call LLVM's EH setjmp, which is lightweight. Value *F = CGM.getIntrinsic(Intrinsic::eh_sjlj_setjmp); Buf = Builder.CreateBitCast(Buf, llvm::Type::getInt8PtrTy(VMContext)); |

