summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2018-10-31 23:17:36 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2018-10-31 23:17:36 +0000
commite7c7934a11b18df4a26b55408c8f0ee481d177ca (patch)
tree4281e6a7d4fa385cdd4c6374f21f1094dc22c7f2 /clang/lib/CodeGen/CGBuiltin.cpp
parent88ad9ac7200e104afd6087ccadb79cc0c6b9446b (diff)
downloadbcm5719-llvm-e7c7934a11b18df4a26b55408c8f0ee481d177ca.tar.gz
bcm5719-llvm-e7c7934a11b18df4a26b55408c8f0ee481d177ca.zip
[COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry
Summary: ARM64 setjmp expects sp on entry instead of framepointer. Reviewers: mgrang, rnk, TomTan, compnerd, mstorsjo, efriedma Reviewed By: mstorsjo Subscribers: javed.absar, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53684 llvm-svn: 345792
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 4dcf158b840..f4c0854d293 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -711,8 +711,11 @@ static RValue EmitMSVCRTSetJmp(CodeGenFunction &CGF, MSVCSetJmpKind SJKind,
} else {
Name = SJKind == MSVCSetJmpKind::_setjmp ? "_setjmp" : "_setjmpex";
Arg1Ty = CGF.Int8PtrTy;
- Arg1 = CGF.Builder.CreateCall(CGF.CGM.getIntrinsic(Intrinsic::frameaddress),
- llvm::ConstantInt::get(CGF.Int32Ty, 0));
+ if (CGF.getTarget().getTriple().getArch() == llvm::Triple::aarch64) {
+ Arg1 = CGF.Builder.CreateCall(CGF.CGM.getIntrinsic(Intrinsic::sponentry));
+ } else
+ Arg1 = CGF.Builder.CreateCall(CGF.CGM.getIntrinsic(Intrinsic::frameaddress),
+ llvm::ConstantInt::get(CGF.Int32Ty, 0));
}
// Mark the call site and declaration with ReturnsTwice.
OpenPOWER on IntegriCloud