[cfe-commits] r104902 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Jim Grosbach
grosbach at apple.com
Thu May 27 16:54:20 PDT 2010
Author: grosbach
Date: Thu May 27 18:54:20 2010
New Revision: 104902
URL: http://llvm.org/viewvc/llvm-project?rev=104902&view=rev
Log:
Update __builtin_setjmp codegen to match llvmCore changes in r104900.
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=104902&r1=104901&r2=104902&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu May 27 18:54:20 2010
@@ -567,6 +567,14 @@
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));
More information about the cfe-commits
mailing list