From 7037a13679bfcec3c8071e1b7d9ab800f722222d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 6 May 2019 21:19:07 +0000 Subject: [AArch64] Add __builtin_sponentry, for calling setjmp in MinGW In MinGW, setjmp isn't expanded as a builtin in the compiler (like it is for MSVC), but manually hooked up as calls to the right underlying functions in headers. Using the actual CRT's real setjmp/longjmp functions requires this intrinsic. (Currently this is worked around by using MinGW specific reimplementations of setjmp/longjmp on aarch64.) Differential Revision: https://reviews.llvm.org/D61592 llvm-svn: 360082 --- clang/lib/CodeGen/CGBuiltin.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 14b8d0b18d3..048103275d5 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -7233,6 +7233,11 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID, return Builder.CreateCall(F); } + if (BuiltinID == AArch64::BI__builtin_sponentry) { + llvm::Function *F = CGM.getIntrinsic(Intrinsic::sponentry); + return Builder.CreateCall(F); + } + // Find out if any arguments are required to be integer constant // expressions. unsigned ICEArguments = 0; -- cgit v1.2.3